| // Copyright 2016 Google LLC |
| // |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file or at |
| // https://developers.google.com/open-source/licenses/bsd |
| |
| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: deprecated_member_use_from_same_package |
| // ignore_for_file: doc_directive_unknown |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_const_declarations |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unintended_html_in_doc_comment |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: unreachable_from_main |
| // ignore_for_file: unused_local_variable |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert; |
| import 'dart:core' as core; |
| |
| import 'package:googleapis/vision/v1.dart' as api; |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import '../test_shared.dart'; |
| |
| core.int buildCounterAddProductToProductSetRequest = 0; |
| api.AddProductToProductSetRequest buildAddProductToProductSetRequest() { |
| final o = api.AddProductToProductSetRequest(); |
| buildCounterAddProductToProductSetRequest++; |
| if (buildCounterAddProductToProductSetRequest < 3) { |
| o.product = 'foo'; |
| } |
| buildCounterAddProductToProductSetRequest--; |
| return o; |
| } |
| |
| void checkAddProductToProductSetRequest(api.AddProductToProductSetRequest o) { |
| buildCounterAddProductToProductSetRequest++; |
| if (buildCounterAddProductToProductSetRequest < 3) { |
| unittest.expect(o.product!, unittest.equals('foo')); |
| } |
| buildCounterAddProductToProductSetRequest--; |
| } |
| |
| core.List<api.Feature> buildUnnamed0() => [buildFeature(), buildFeature()]; |
| |
| void checkUnnamed0(core.List<api.Feature> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkFeature(o[0]); |
| checkFeature(o[1]); |
| } |
| |
| core.List<core.int> buildUnnamed1() => [42, 42]; |
| |
| void checkUnnamed1(core.List<core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42)); |
| unittest.expect(o[1], unittest.equals(42)); |
| } |
| |
| core.int buildCounterAnnotateFileRequest = 0; |
| api.AnnotateFileRequest buildAnnotateFileRequest() { |
| final o = api.AnnotateFileRequest(); |
| buildCounterAnnotateFileRequest++; |
| if (buildCounterAnnotateFileRequest < 3) { |
| o.features = buildUnnamed0(); |
| o.imageContext = buildImageContext(); |
| o.inputConfig = buildInputConfig(); |
| o.pages = buildUnnamed1(); |
| } |
| buildCounterAnnotateFileRequest--; |
| return o; |
| } |
| |
| void checkAnnotateFileRequest(api.AnnotateFileRequest o) { |
| buildCounterAnnotateFileRequest++; |
| if (buildCounterAnnotateFileRequest < 3) { |
| checkUnnamed0(o.features!); |
| checkImageContext(o.imageContext!); |
| checkInputConfig(o.inputConfig!); |
| checkUnnamed1(o.pages!); |
| } |
| buildCounterAnnotateFileRequest--; |
| } |
| |
| core.List<api.AnnotateImageResponse> buildUnnamed2() => [ |
| buildAnnotateImageResponse(), |
| buildAnnotateImageResponse(), |
| ]; |
| |
| void checkUnnamed2(core.List<api.AnnotateImageResponse> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAnnotateImageResponse(o[0]); |
| checkAnnotateImageResponse(o[1]); |
| } |
| |
| core.int buildCounterAnnotateFileResponse = 0; |
| api.AnnotateFileResponse buildAnnotateFileResponse() { |
| final o = api.AnnotateFileResponse(); |
| buildCounterAnnotateFileResponse++; |
| if (buildCounterAnnotateFileResponse < 3) { |
| o.error = buildStatus(); |
| o.inputConfig = buildInputConfig(); |
| o.responses = buildUnnamed2(); |
| o.totalPages = 42; |
| } |
| buildCounterAnnotateFileResponse--; |
| return o; |
| } |
| |
| void checkAnnotateFileResponse(api.AnnotateFileResponse o) { |
| buildCounterAnnotateFileResponse++; |
| if (buildCounterAnnotateFileResponse < 3) { |
| checkStatus(o.error!); |
| checkInputConfig(o.inputConfig!); |
| checkUnnamed2(o.responses!); |
| unittest.expect(o.totalPages!, unittest.equals(42)); |
| } |
| buildCounterAnnotateFileResponse--; |
| } |
| |
| core.List<api.Feature> buildUnnamed3() => [buildFeature(), buildFeature()]; |
| |
| void checkUnnamed3(core.List<api.Feature> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkFeature(o[0]); |
| checkFeature(o[1]); |
| } |
| |
| core.int buildCounterAnnotateImageRequest = 0; |
| api.AnnotateImageRequest buildAnnotateImageRequest() { |
| final o = api.AnnotateImageRequest(); |
| buildCounterAnnotateImageRequest++; |
| if (buildCounterAnnotateImageRequest < 3) { |
| o.features = buildUnnamed3(); |
| o.image = buildImage(); |
| o.imageContext = buildImageContext(); |
| } |
| buildCounterAnnotateImageRequest--; |
| return o; |
| } |
| |
| void checkAnnotateImageRequest(api.AnnotateImageRequest o) { |
| buildCounterAnnotateImageRequest++; |
| if (buildCounterAnnotateImageRequest < 3) { |
| checkUnnamed3(o.features!); |
| checkImage(o.image!); |
| checkImageContext(o.imageContext!); |
| } |
| buildCounterAnnotateImageRequest--; |
| } |
| |
| core.List<api.FaceAnnotation> buildUnnamed4() => [ |
| buildFaceAnnotation(), |
| buildFaceAnnotation(), |
| ]; |
| |
| void checkUnnamed4(core.List<api.FaceAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkFaceAnnotation(o[0]); |
| checkFaceAnnotation(o[1]); |
| } |
| |
| core.List<api.EntityAnnotation> buildUnnamed5() => [ |
| buildEntityAnnotation(), |
| buildEntityAnnotation(), |
| ]; |
| |
| void checkUnnamed5(core.List<api.EntityAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEntityAnnotation(o[0]); |
| checkEntityAnnotation(o[1]); |
| } |
| |
| core.List<api.EntityAnnotation> buildUnnamed6() => [ |
| buildEntityAnnotation(), |
| buildEntityAnnotation(), |
| ]; |
| |
| void checkUnnamed6(core.List<api.EntityAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEntityAnnotation(o[0]); |
| checkEntityAnnotation(o[1]); |
| } |
| |
| core.List<api.LocalizedObjectAnnotation> buildUnnamed7() => [ |
| buildLocalizedObjectAnnotation(), |
| buildLocalizedObjectAnnotation(), |
| ]; |
| |
| void checkUnnamed7(core.List<api.LocalizedObjectAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLocalizedObjectAnnotation(o[0]); |
| checkLocalizedObjectAnnotation(o[1]); |
| } |
| |
| core.List<api.EntityAnnotation> buildUnnamed8() => [ |
| buildEntityAnnotation(), |
| buildEntityAnnotation(), |
| ]; |
| |
| void checkUnnamed8(core.List<api.EntityAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEntityAnnotation(o[0]); |
| checkEntityAnnotation(o[1]); |
| } |
| |
| core.List<api.EntityAnnotation> buildUnnamed9() => [ |
| buildEntityAnnotation(), |
| buildEntityAnnotation(), |
| ]; |
| |
| void checkUnnamed9(core.List<api.EntityAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkEntityAnnotation(o[0]); |
| checkEntityAnnotation(o[1]); |
| } |
| |
| core.int buildCounterAnnotateImageResponse = 0; |
| api.AnnotateImageResponse buildAnnotateImageResponse() { |
| final o = api.AnnotateImageResponse(); |
| buildCounterAnnotateImageResponse++; |
| if (buildCounterAnnotateImageResponse < 3) { |
| o.context = buildImageAnnotationContext(); |
| o.cropHintsAnnotation = buildCropHintsAnnotation(); |
| o.error = buildStatus(); |
| o.faceAnnotations = buildUnnamed4(); |
| o.fullTextAnnotation = buildTextAnnotation(); |
| o.imagePropertiesAnnotation = buildImageProperties(); |
| o.labelAnnotations = buildUnnamed5(); |
| o.landmarkAnnotations = buildUnnamed6(); |
| o.localizedObjectAnnotations = buildUnnamed7(); |
| o.logoAnnotations = buildUnnamed8(); |
| o.productSearchResults = buildProductSearchResults(); |
| o.safeSearchAnnotation = buildSafeSearchAnnotation(); |
| o.textAnnotations = buildUnnamed9(); |
| o.webDetection = buildWebDetection(); |
| } |
| buildCounterAnnotateImageResponse--; |
| return o; |
| } |
| |
| void checkAnnotateImageResponse(api.AnnotateImageResponse o) { |
| buildCounterAnnotateImageResponse++; |
| if (buildCounterAnnotateImageResponse < 3) { |
| checkImageAnnotationContext(o.context!); |
| checkCropHintsAnnotation(o.cropHintsAnnotation!); |
| checkStatus(o.error!); |
| checkUnnamed4(o.faceAnnotations!); |
| checkTextAnnotation(o.fullTextAnnotation!); |
| checkImageProperties(o.imagePropertiesAnnotation!); |
| checkUnnamed5(o.labelAnnotations!); |
| checkUnnamed6(o.landmarkAnnotations!); |
| checkUnnamed7(o.localizedObjectAnnotations!); |
| checkUnnamed8(o.logoAnnotations!); |
| checkProductSearchResults(o.productSearchResults!); |
| checkSafeSearchAnnotation(o.safeSearchAnnotation!); |
| checkUnnamed9(o.textAnnotations!); |
| checkWebDetection(o.webDetection!); |
| } |
| buildCounterAnnotateImageResponse--; |
| } |
| |
| core.List<api.Feature> buildUnnamed10() => [buildFeature(), buildFeature()]; |
| |
| void checkUnnamed10(core.List<api.Feature> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkFeature(o[0]); |
| checkFeature(o[1]); |
| } |
| |
| core.int buildCounterAsyncAnnotateFileRequest = 0; |
| api.AsyncAnnotateFileRequest buildAsyncAnnotateFileRequest() { |
| final o = api.AsyncAnnotateFileRequest(); |
| buildCounterAsyncAnnotateFileRequest++; |
| if (buildCounterAsyncAnnotateFileRequest < 3) { |
| o.features = buildUnnamed10(); |
| o.imageContext = buildImageContext(); |
| o.inputConfig = buildInputConfig(); |
| o.outputConfig = buildOutputConfig(); |
| } |
| buildCounterAsyncAnnotateFileRequest--; |
| return o; |
| } |
| |
| void checkAsyncAnnotateFileRequest(api.AsyncAnnotateFileRequest o) { |
| buildCounterAsyncAnnotateFileRequest++; |
| if (buildCounterAsyncAnnotateFileRequest < 3) { |
| checkUnnamed10(o.features!); |
| checkImageContext(o.imageContext!); |
| checkInputConfig(o.inputConfig!); |
| checkOutputConfig(o.outputConfig!); |
| } |
| buildCounterAsyncAnnotateFileRequest--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed11() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed11(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x']!, unittest.equals('foo')); |
| unittest.expect(o['y']!, unittest.equals('foo')); |
| } |
| |
| core.List<api.AsyncAnnotateFileRequest> buildUnnamed12() => [ |
| buildAsyncAnnotateFileRequest(), |
| buildAsyncAnnotateFileRequest(), |
| ]; |
| |
| void checkUnnamed12(core.List<api.AsyncAnnotateFileRequest> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAsyncAnnotateFileRequest(o[0]); |
| checkAsyncAnnotateFileRequest(o[1]); |
| } |
| |
| core.int buildCounterAsyncBatchAnnotateFilesRequest = 0; |
| api.AsyncBatchAnnotateFilesRequest buildAsyncBatchAnnotateFilesRequest() { |
| final o = api.AsyncBatchAnnotateFilesRequest(); |
| buildCounterAsyncBatchAnnotateFilesRequest++; |
| if (buildCounterAsyncBatchAnnotateFilesRequest < 3) { |
| o.labels = buildUnnamed11(); |
| o.parent = 'foo'; |
| o.requests = buildUnnamed12(); |
| } |
| buildCounterAsyncBatchAnnotateFilesRequest--; |
| return o; |
| } |
| |
| void checkAsyncBatchAnnotateFilesRequest(api.AsyncBatchAnnotateFilesRequest o) { |
| buildCounterAsyncBatchAnnotateFilesRequest++; |
| if (buildCounterAsyncBatchAnnotateFilesRequest < 3) { |
| checkUnnamed11(o.labels!); |
| unittest.expect(o.parent!, unittest.equals('foo')); |
| checkUnnamed12(o.requests!); |
| } |
| buildCounterAsyncBatchAnnotateFilesRequest--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed13() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed13(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x']!, unittest.equals('foo')); |
| unittest.expect(o['y']!, unittest.equals('foo')); |
| } |
| |
| core.List<api.AnnotateImageRequest> buildUnnamed14() => [ |
| buildAnnotateImageRequest(), |
| buildAnnotateImageRequest(), |
| ]; |
| |
| void checkUnnamed14(core.List<api.AnnotateImageRequest> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAnnotateImageRequest(o[0]); |
| checkAnnotateImageRequest(o[1]); |
| } |
| |
| core.int buildCounterAsyncBatchAnnotateImagesRequest = 0; |
| api.AsyncBatchAnnotateImagesRequest buildAsyncBatchAnnotateImagesRequest() { |
| final o = api.AsyncBatchAnnotateImagesRequest(); |
| buildCounterAsyncBatchAnnotateImagesRequest++; |
| if (buildCounterAsyncBatchAnnotateImagesRequest < 3) { |
| o.labels = buildUnnamed13(); |
| o.outputConfig = buildOutputConfig(); |
| o.parent = 'foo'; |
| o.requests = buildUnnamed14(); |
| } |
| buildCounterAsyncBatchAnnotateImagesRequest--; |
| return o; |
| } |
| |
| void checkAsyncBatchAnnotateImagesRequest( |
| api.AsyncBatchAnnotateImagesRequest o, |
| ) { |
| buildCounterAsyncBatchAnnotateImagesRequest++; |
| if (buildCounterAsyncBatchAnnotateImagesRequest < 3) { |
| checkUnnamed13(o.labels!); |
| checkOutputConfig(o.outputConfig!); |
| unittest.expect(o.parent!, unittest.equals('foo')); |
| checkUnnamed14(o.requests!); |
| } |
| buildCounterAsyncBatchAnnotateImagesRequest--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed15() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed15(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x']!, unittest.equals('foo')); |
| unittest.expect(o['y']!, unittest.equals('foo')); |
| } |
| |
| core.List<api.AnnotateFileRequest> buildUnnamed16() => [ |
| buildAnnotateFileRequest(), |
| buildAnnotateFileRequest(), |
| ]; |
| |
| void checkUnnamed16(core.List<api.AnnotateFileRequest> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAnnotateFileRequest(o[0]); |
| checkAnnotateFileRequest(o[1]); |
| } |
| |
| core.int buildCounterBatchAnnotateFilesRequest = 0; |
| api.BatchAnnotateFilesRequest buildBatchAnnotateFilesRequest() { |
| final o = api.BatchAnnotateFilesRequest(); |
| buildCounterBatchAnnotateFilesRequest++; |
| if (buildCounterBatchAnnotateFilesRequest < 3) { |
| o.labels = buildUnnamed15(); |
| o.parent = 'foo'; |
| o.requests = buildUnnamed16(); |
| } |
| buildCounterBatchAnnotateFilesRequest--; |
| return o; |
| } |
| |
| void checkBatchAnnotateFilesRequest(api.BatchAnnotateFilesRequest o) { |
| buildCounterBatchAnnotateFilesRequest++; |
| if (buildCounterBatchAnnotateFilesRequest < 3) { |
| checkUnnamed15(o.labels!); |
| unittest.expect(o.parent!, unittest.equals('foo')); |
| checkUnnamed16(o.requests!); |
| } |
| buildCounterBatchAnnotateFilesRequest--; |
| } |
| |
| core.List<api.AnnotateFileResponse> buildUnnamed17() => [ |
| buildAnnotateFileResponse(), |
| buildAnnotateFileResponse(), |
| ]; |
| |
| void checkUnnamed17(core.List<api.AnnotateFileResponse> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAnnotateFileResponse(o[0]); |
| checkAnnotateFileResponse(o[1]); |
| } |
| |
| core.int buildCounterBatchAnnotateFilesResponse = 0; |
| api.BatchAnnotateFilesResponse buildBatchAnnotateFilesResponse() { |
| final o = api.BatchAnnotateFilesResponse(); |
| buildCounterBatchAnnotateFilesResponse++; |
| if (buildCounterBatchAnnotateFilesResponse < 3) { |
| o.responses = buildUnnamed17(); |
| } |
| buildCounterBatchAnnotateFilesResponse--; |
| return o; |
| } |
| |
| void checkBatchAnnotateFilesResponse(api.BatchAnnotateFilesResponse o) { |
| buildCounterBatchAnnotateFilesResponse++; |
| if (buildCounterBatchAnnotateFilesResponse < 3) { |
| checkUnnamed17(o.responses!); |
| } |
| buildCounterBatchAnnotateFilesResponse--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed18() => {'x': 'foo', 'y': 'foo'}; |
| |
| void checkUnnamed18(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x']!, unittest.equals('foo')); |
| unittest.expect(o['y']!, unittest.equals('foo')); |
| } |
| |
| core.List<api.AnnotateImageRequest> buildUnnamed19() => [ |
| buildAnnotateImageRequest(), |
| buildAnnotateImageRequest(), |
| ]; |
| |
| void checkUnnamed19(core.List<api.AnnotateImageRequest> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAnnotateImageRequest(o[0]); |
| checkAnnotateImageRequest(o[1]); |
| } |
| |
| core.int buildCounterBatchAnnotateImagesRequest = 0; |
| api.BatchAnnotateImagesRequest buildBatchAnnotateImagesRequest() { |
| final o = api.BatchAnnotateImagesRequest(); |
| buildCounterBatchAnnotateImagesRequest++; |
| if (buildCounterBatchAnnotateImagesRequest < 3) { |
| o.labels = buildUnnamed18(); |
| o.parent = 'foo'; |
| o.requests = buildUnnamed19(); |
| } |
| buildCounterBatchAnnotateImagesRequest--; |
| return o; |
| } |
| |
| void checkBatchAnnotateImagesRequest(api.BatchAnnotateImagesRequest o) { |
| buildCounterBatchAnnotateImagesRequest++; |
| if (buildCounterBatchAnnotateImagesRequest < 3) { |
| checkUnnamed18(o.labels!); |
| unittest.expect(o.parent!, unittest.equals('foo')); |
| checkUnnamed19(o.requests!); |
| } |
| buildCounterBatchAnnotateImagesRequest--; |
| } |
| |
| core.List<api.AnnotateImageResponse> buildUnnamed20() => [ |
| buildAnnotateImageResponse(), |
| buildAnnotateImageResponse(), |
| ]; |
| |
| void checkUnnamed20(core.List<api.AnnotateImageResponse> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAnnotateImageResponse(o[0]); |
| checkAnnotateImageResponse(o[1]); |
| } |
| |
| core.int buildCounterBatchAnnotateImagesResponse = 0; |
| api.BatchAnnotateImagesResponse buildBatchAnnotateImagesResponse() { |
| final o = api.BatchAnnotateImagesResponse(); |
| buildCounterBatchAnnotateImagesResponse++; |
| if (buildCounterBatchAnnotateImagesResponse < 3) { |
| o.responses = buildUnnamed20(); |
| } |
| buildCounterBatchAnnotateImagesResponse--; |
| return o; |
| } |
| |
| void checkBatchAnnotateImagesResponse(api.BatchAnnotateImagesResponse o) { |
| buildCounterBatchAnnotateImagesResponse++; |
| if (buildCounterBatchAnnotateImagesResponse < 3) { |
| checkUnnamed20(o.responses!); |
| } |
| buildCounterBatchAnnotateImagesResponse--; |
| } |
| |
| core.List<api.Paragraph> buildUnnamed21() => [ |
| buildParagraph(), |
| buildParagraph(), |
| ]; |
| |
| void checkUnnamed21(core.List<api.Paragraph> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkParagraph(o[0]); |
| checkParagraph(o[1]); |
| } |
| |
| core.int buildCounterBlock = 0; |
| api.Block buildBlock() { |
| final o = api.Block(); |
| buildCounterBlock++; |
| if (buildCounterBlock < 3) { |
| o.blockType = 'foo'; |
| o.boundingBox = buildBoundingPoly(); |
| o.confidence = 42.0; |
| o.paragraphs = buildUnnamed21(); |
| o.property = buildTextProperty(); |
| } |
| buildCounterBlock--; |
| return o; |
| } |
| |
| void checkBlock(api.Block o) { |
| buildCounterBlock++; |
| if (buildCounterBlock < 3) { |
| unittest.expect(o.blockType!, unittest.equals('foo')); |
| checkBoundingPoly(o.boundingBox!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| checkUnnamed21(o.paragraphs!); |
| checkTextProperty(o.property!); |
| } |
| buildCounterBlock--; |
| } |
| |
| core.List<api.NormalizedVertex> buildUnnamed22() => [ |
| buildNormalizedVertex(), |
| buildNormalizedVertex(), |
| ]; |
| |
| void checkUnnamed22(core.List<api.NormalizedVertex> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkNormalizedVertex(o[0]); |
| checkNormalizedVertex(o[1]); |
| } |
| |
| core.List<api.Vertex> buildUnnamed23() => [buildVertex(), buildVertex()]; |
| |
| void checkUnnamed23(core.List<api.Vertex> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkVertex(o[0]); |
| checkVertex(o[1]); |
| } |
| |
| core.int buildCounterBoundingPoly = 0; |
| api.BoundingPoly buildBoundingPoly() { |
| final o = api.BoundingPoly(); |
| buildCounterBoundingPoly++; |
| if (buildCounterBoundingPoly < 3) { |
| o.normalizedVertices = buildUnnamed22(); |
| o.vertices = buildUnnamed23(); |
| } |
| buildCounterBoundingPoly--; |
| return o; |
| } |
| |
| void checkBoundingPoly(api.BoundingPoly o) { |
| buildCounterBoundingPoly++; |
| if (buildCounterBoundingPoly < 3) { |
| checkUnnamed22(o.normalizedVertices!); |
| checkUnnamed23(o.vertices!); |
| } |
| buildCounterBoundingPoly--; |
| } |
| |
| core.int buildCounterCancelOperationRequest = 0; |
| api.CancelOperationRequest buildCancelOperationRequest() { |
| final o = api.CancelOperationRequest(); |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| return o; |
| } |
| |
| void checkCancelOperationRequest(api.CancelOperationRequest o) { |
| buildCounterCancelOperationRequest++; |
| if (buildCounterCancelOperationRequest < 3) {} |
| buildCounterCancelOperationRequest--; |
| } |
| |
| core.int buildCounterColor = 0; |
| api.Color buildColor() { |
| final o = api.Color(); |
| buildCounterColor++; |
| if (buildCounterColor < 3) { |
| o.alpha = 42.0; |
| o.blue = 42.0; |
| o.green = 42.0; |
| o.red = 42.0; |
| } |
| buildCounterColor--; |
| return o; |
| } |
| |
| void checkColor(api.Color o) { |
| buildCounterColor++; |
| if (buildCounterColor < 3) { |
| unittest.expect(o.alpha!, unittest.equals(42.0)); |
| unittest.expect(o.blue!, unittest.equals(42.0)); |
| unittest.expect(o.green!, unittest.equals(42.0)); |
| unittest.expect(o.red!, unittest.equals(42.0)); |
| } |
| buildCounterColor--; |
| } |
| |
| core.int buildCounterColorInfo = 0; |
| api.ColorInfo buildColorInfo() { |
| final o = api.ColorInfo(); |
| buildCounterColorInfo++; |
| if (buildCounterColorInfo < 3) { |
| o.color = buildColor(); |
| o.pixelFraction = 42.0; |
| o.score = 42.0; |
| } |
| buildCounterColorInfo--; |
| return o; |
| } |
| |
| void checkColorInfo(api.ColorInfo o) { |
| buildCounterColorInfo++; |
| if (buildCounterColorInfo < 3) { |
| checkColor(o.color!); |
| unittest.expect(o.pixelFraction!, unittest.equals(42.0)); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| } |
| buildCounterColorInfo--; |
| } |
| |
| core.int buildCounterCropHint = 0; |
| api.CropHint buildCropHint() { |
| final o = api.CropHint(); |
| buildCounterCropHint++; |
| if (buildCounterCropHint < 3) { |
| o.boundingPoly = buildBoundingPoly(); |
| o.confidence = 42.0; |
| o.importanceFraction = 42.0; |
| } |
| buildCounterCropHint--; |
| return o; |
| } |
| |
| void checkCropHint(api.CropHint o) { |
| buildCounterCropHint++; |
| if (buildCounterCropHint < 3) { |
| checkBoundingPoly(o.boundingPoly!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| unittest.expect(o.importanceFraction!, unittest.equals(42.0)); |
| } |
| buildCounterCropHint--; |
| } |
| |
| core.List<api.CropHint> buildUnnamed24() => [buildCropHint(), buildCropHint()]; |
| |
| void checkUnnamed24(core.List<api.CropHint> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCropHint(o[0]); |
| checkCropHint(o[1]); |
| } |
| |
| core.int buildCounterCropHintsAnnotation = 0; |
| api.CropHintsAnnotation buildCropHintsAnnotation() { |
| final o = api.CropHintsAnnotation(); |
| buildCounterCropHintsAnnotation++; |
| if (buildCounterCropHintsAnnotation < 3) { |
| o.cropHints = buildUnnamed24(); |
| } |
| buildCounterCropHintsAnnotation--; |
| return o; |
| } |
| |
| void checkCropHintsAnnotation(api.CropHintsAnnotation o) { |
| buildCounterCropHintsAnnotation++; |
| if (buildCounterCropHintsAnnotation < 3) { |
| checkUnnamed24(o.cropHints!); |
| } |
| buildCounterCropHintsAnnotation--; |
| } |
| |
| core.List<core.double> buildUnnamed25() => [42.0, 42.0]; |
| |
| void checkUnnamed25(core.List<core.double> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals(42.0)); |
| unittest.expect(o[1], unittest.equals(42.0)); |
| } |
| |
| core.int buildCounterCropHintsParams = 0; |
| api.CropHintsParams buildCropHintsParams() { |
| final o = api.CropHintsParams(); |
| buildCounterCropHintsParams++; |
| if (buildCounterCropHintsParams < 3) { |
| o.aspectRatios = buildUnnamed25(); |
| } |
| buildCounterCropHintsParams--; |
| return o; |
| } |
| |
| void checkCropHintsParams(api.CropHintsParams o) { |
| buildCounterCropHintsParams++; |
| if (buildCounterCropHintsParams < 3) { |
| checkUnnamed25(o.aspectRatios!); |
| } |
| buildCounterCropHintsParams--; |
| } |
| |
| core.int buildCounterDetectedBreak = 0; |
| api.DetectedBreak buildDetectedBreak() { |
| final o = api.DetectedBreak(); |
| buildCounterDetectedBreak++; |
| if (buildCounterDetectedBreak < 3) { |
| o.isPrefix = true; |
| o.type = 'foo'; |
| } |
| buildCounterDetectedBreak--; |
| return o; |
| } |
| |
| void checkDetectedBreak(api.DetectedBreak o) { |
| buildCounterDetectedBreak++; |
| if (buildCounterDetectedBreak < 3) { |
| unittest.expect(o.isPrefix!, unittest.isTrue); |
| unittest.expect(o.type!, unittest.equals('foo')); |
| } |
| buildCounterDetectedBreak--; |
| } |
| |
| core.int buildCounterDetectedLanguage = 0; |
| api.DetectedLanguage buildDetectedLanguage() { |
| final o = api.DetectedLanguage(); |
| buildCounterDetectedLanguage++; |
| if (buildCounterDetectedLanguage < 3) { |
| o.confidence = 42.0; |
| o.languageCode = 'foo'; |
| } |
| buildCounterDetectedLanguage--; |
| return o; |
| } |
| |
| void checkDetectedLanguage(api.DetectedLanguage o) { |
| buildCounterDetectedLanguage++; |
| if (buildCounterDetectedLanguage < 3) { |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| unittest.expect(o.languageCode!, unittest.equals('foo')); |
| } |
| buildCounterDetectedLanguage--; |
| } |
| |
| core.List<api.ColorInfo> buildUnnamed26() => [ |
| buildColorInfo(), |
| buildColorInfo(), |
| ]; |
| |
| void checkUnnamed26(core.List<api.ColorInfo> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkColorInfo(o[0]); |
| checkColorInfo(o[1]); |
| } |
| |
| core.int buildCounterDominantColorsAnnotation = 0; |
| api.DominantColorsAnnotation buildDominantColorsAnnotation() { |
| final o = api.DominantColorsAnnotation(); |
| buildCounterDominantColorsAnnotation++; |
| if (buildCounterDominantColorsAnnotation < 3) { |
| o.colors = buildUnnamed26(); |
| } |
| buildCounterDominantColorsAnnotation--; |
| return o; |
| } |
| |
| void checkDominantColorsAnnotation(api.DominantColorsAnnotation o) { |
| buildCounterDominantColorsAnnotation++; |
| if (buildCounterDominantColorsAnnotation < 3) { |
| checkUnnamed26(o.colors!); |
| } |
| buildCounterDominantColorsAnnotation--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| final o = api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| void checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.List<api.LocationInfo> buildUnnamed27() => [ |
| buildLocationInfo(), |
| buildLocationInfo(), |
| ]; |
| |
| void checkUnnamed27(core.List<api.LocationInfo> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLocationInfo(o[0]); |
| checkLocationInfo(o[1]); |
| } |
| |
| core.List<api.Property> buildUnnamed28() => [buildProperty(), buildProperty()]; |
| |
| void checkUnnamed28(core.List<api.Property> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkProperty(o[0]); |
| checkProperty(o[1]); |
| } |
| |
| core.int buildCounterEntityAnnotation = 0; |
| api.EntityAnnotation buildEntityAnnotation() { |
| final o = api.EntityAnnotation(); |
| buildCounterEntityAnnotation++; |
| if (buildCounterEntityAnnotation < 3) { |
| o.boundingPoly = buildBoundingPoly(); |
| o.confidence = 42.0; |
| o.description = 'foo'; |
| o.locale = 'foo'; |
| o.locations = buildUnnamed27(); |
| o.mid = 'foo'; |
| o.properties = buildUnnamed28(); |
| o.score = 42.0; |
| o.topicality = 42.0; |
| } |
| buildCounterEntityAnnotation--; |
| return o; |
| } |
| |
| void checkEntityAnnotation(api.EntityAnnotation o) { |
| buildCounterEntityAnnotation++; |
| if (buildCounterEntityAnnotation < 3) { |
| checkBoundingPoly(o.boundingPoly!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| unittest.expect(o.description!, unittest.equals('foo')); |
| unittest.expect(o.locale!, unittest.equals('foo')); |
| checkUnnamed27(o.locations!); |
| unittest.expect(o.mid!, unittest.equals('foo')); |
| checkUnnamed28(o.properties!); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| unittest.expect(o.topicality!, unittest.equals(42.0)); |
| } |
| buildCounterEntityAnnotation--; |
| } |
| |
| core.List<api.Landmark> buildUnnamed29() => [buildLandmark(), buildLandmark()]; |
| |
| void checkUnnamed29(core.List<api.Landmark> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkLandmark(o[0]); |
| checkLandmark(o[1]); |
| } |
| |
| core.int buildCounterFaceAnnotation = 0; |
| api.FaceAnnotation buildFaceAnnotation() { |
| final o = api.FaceAnnotation(); |
| buildCounterFaceAnnotation++; |
| if (buildCounterFaceAnnotation < 3) { |
| o.angerLikelihood = 'foo'; |
| o.blurredLikelihood = 'foo'; |
| o.boundingPoly = buildBoundingPoly(); |
| o.detectionConfidence = 42.0; |
| o.fdBoundingPoly = buildBoundingPoly(); |
| o.headwearLikelihood = 'foo'; |
| o.joyLikelihood = 'foo'; |
| o.landmarkingConfidence = 42.0; |
| o.landmarks = buildUnnamed29(); |
| o.panAngle = 42.0; |
| o.rollAngle = 42.0; |
| o.sorrowLikelihood = 'foo'; |
| o.surpriseLikelihood = 'foo'; |
| o.tiltAngle = 42.0; |
| o.underExposedLikelihood = 'foo'; |
| } |
| buildCounterFaceAnnotation--; |
| return o; |
| } |
| |
| void checkFaceAnnotation(api.FaceAnnotation o) { |
| buildCounterFaceAnnotation++; |
| if (buildCounterFaceAnnotation < 3) { |
| unittest.expect(o.angerLikelihood!, unittest.equals('foo')); |
| unittest.expect(o.blurredLikelihood!, unittest.equals('foo')); |
| checkBoundingPoly(o.boundingPoly!); |
| unittest.expect(o.detectionConfidence!, unittest.equals(42.0)); |
| checkBoundingPoly(o.fdBoundingPoly!); |
| unittest.expect(o.headwearLikelihood!, unittest.equals('foo')); |
| unittest.expect(o.joyLikelihood!, unittest.equals('foo')); |
| unittest.expect(o.landmarkingConfidence!, unittest.equals(42.0)); |
| checkUnnamed29(o.landmarks!); |
| unittest.expect(o.panAngle!, unittest.equals(42.0)); |
| unittest.expect(o.rollAngle!, unittest.equals(42.0)); |
| unittest.expect(o.sorrowLikelihood!, unittest.equals('foo')); |
| unittest.expect(o.surpriseLikelihood!, unittest.equals('foo')); |
| unittest.expect(o.tiltAngle!, unittest.equals(42.0)); |
| unittest.expect(o.underExposedLikelihood!, unittest.equals('foo')); |
| } |
| buildCounterFaceAnnotation--; |
| } |
| |
| core.int buildCounterFeature = 0; |
| api.Feature buildFeature() { |
| final o = api.Feature(); |
| buildCounterFeature++; |
| if (buildCounterFeature < 3) { |
| o.maxResults = 42; |
| o.model = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterFeature--; |
| return o; |
| } |
| |
| void checkFeature(api.Feature o) { |
| buildCounterFeature++; |
| if (buildCounterFeature < 3) { |
| unittest.expect(o.maxResults!, unittest.equals(42)); |
| unittest.expect(o.model!, unittest.equals('foo')); |
| unittest.expect(o.type!, unittest.equals('foo')); |
| } |
| buildCounterFeature--; |
| } |
| |
| core.int buildCounterGcsDestination = 0; |
| api.GcsDestination buildGcsDestination() { |
| final o = api.GcsDestination(); |
| buildCounterGcsDestination++; |
| if (buildCounterGcsDestination < 3) { |
| o.uri = 'foo'; |
| } |
| buildCounterGcsDestination--; |
| return o; |
| } |
| |
| void checkGcsDestination(api.GcsDestination o) { |
| buildCounterGcsDestination++; |
| if (buildCounterGcsDestination < 3) { |
| unittest.expect(o.uri!, unittest.equals('foo')); |
| } |
| buildCounterGcsDestination--; |
| } |
| |
| core.int buildCounterGcsSource = 0; |
| api.GcsSource buildGcsSource() { |
| final o = api.GcsSource(); |
| buildCounterGcsSource++; |
| if (buildCounterGcsSource < 3) { |
| o.uri = 'foo'; |
| } |
| buildCounterGcsSource--; |
| return o; |
| } |
| |
| void checkGcsSource(api.GcsSource o) { |
| buildCounterGcsSource++; |
| if (buildCounterGcsSource < 3) { |
| unittest.expect(o.uri!, unittest.equals('foo')); |
| } |
| buildCounterGcsSource--; |
| } |
| |
| core.List<api.ObjectAnnotation> buildUnnamed30() => [ |
| buildObjectAnnotation(), |
| buildObjectAnnotation(), |
| ]; |
| |
| void checkUnnamed30(core.List<api.ObjectAnnotation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkObjectAnnotation(o[0]); |
| checkObjectAnnotation(o[1]); |
| } |
| |
| core.List<api.Result> buildUnnamed31() => [buildResult(), buildResult()]; |
| |
| void checkUnnamed31(core.List<api.Result> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkResult(o[0]); |
| checkResult(o[1]); |
| } |
| |
| core.int buildCounterGroupedResult = 0; |
| api.GroupedResult buildGroupedResult() { |
| final o = api.GroupedResult(); |
| buildCounterGroupedResult++; |
| if (buildCounterGroupedResult < 3) { |
| o.boundingPoly = buildBoundingPoly(); |
| o.objectAnnotations = buildUnnamed30(); |
| o.results = buildUnnamed31(); |
| } |
| buildCounterGroupedResult--; |
| return o; |
| } |
| |
| void checkGroupedResult(api.GroupedResult o) { |
| buildCounterGroupedResult++; |
| if (buildCounterGroupedResult < 3) { |
| checkBoundingPoly(o.boundingPoly!); |
| checkUnnamed30(o.objectAnnotations!); |
| checkUnnamed31(o.results!); |
| } |
| buildCounterGroupedResult--; |
| } |
| |
| core.int buildCounterImage = 0; |
| api.Image buildImage() { |
| final o = api.Image(); |
| buildCounterImage++; |
| if (buildCounterImage < 3) { |
| o.content = 'foo'; |
| o.source = buildImageSource(); |
| } |
| buildCounterImage--; |
| return o; |
| } |
| |
| void checkImage(api.Image o) { |
| buildCounterImage++; |
| if (buildCounterImage < 3) { |
| unittest.expect(o.content!, unittest.equals('foo')); |
| checkImageSource(o.source!); |
| } |
| buildCounterImage--; |
| } |
| |
| core.int buildCounterImageAnnotationContext = 0; |
| api.ImageAnnotationContext buildImageAnnotationContext() { |
| final o = api.ImageAnnotationContext(); |
| buildCounterImageAnnotationContext++; |
| if (buildCounterImageAnnotationContext < 3) { |
| o.pageNumber = 42; |
| o.uri = 'foo'; |
| } |
| buildCounterImageAnnotationContext--; |
| return o; |
| } |
| |
| void checkImageAnnotationContext(api.ImageAnnotationContext o) { |
| buildCounterImageAnnotationContext++; |
| if (buildCounterImageAnnotationContext < 3) { |
| unittest.expect(o.pageNumber!, unittest.equals(42)); |
| unittest.expect(o.uri!, unittest.equals('foo')); |
| } |
| buildCounterImageAnnotationContext--; |
| } |
| |
| core.List<core.String> buildUnnamed32() => ['foo', 'foo']; |
| |
| void checkUnnamed32(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterImageContext = 0; |
| api.ImageContext buildImageContext() { |
| final o = api.ImageContext(); |
| buildCounterImageContext++; |
| if (buildCounterImageContext < 3) { |
| o.cropHintsParams = buildCropHintsParams(); |
| o.languageHints = buildUnnamed32(); |
| o.latLongRect = buildLatLongRect(); |
| o.productSearchParams = buildProductSearchParams(); |
| o.textDetectionParams = buildTextDetectionParams(); |
| o.webDetectionParams = buildWebDetectionParams(); |
| } |
| buildCounterImageContext--; |
| return o; |
| } |
| |
| void checkImageContext(api.ImageContext o) { |
| buildCounterImageContext++; |
| if (buildCounterImageContext < 3) { |
| checkCropHintsParams(o.cropHintsParams!); |
| checkUnnamed32(o.languageHints!); |
| checkLatLongRect(o.latLongRect!); |
| checkProductSearchParams(o.productSearchParams!); |
| checkTextDetectionParams(o.textDetectionParams!); |
| checkWebDetectionParams(o.webDetectionParams!); |
| } |
| buildCounterImageContext--; |
| } |
| |
| core.int buildCounterImageProperties = 0; |
| api.ImageProperties buildImageProperties() { |
| final o = api.ImageProperties(); |
| buildCounterImageProperties++; |
| if (buildCounterImageProperties < 3) { |
| o.dominantColors = buildDominantColorsAnnotation(); |
| } |
| buildCounterImageProperties--; |
| return o; |
| } |
| |
| void checkImageProperties(api.ImageProperties o) { |
| buildCounterImageProperties++; |
| if (buildCounterImageProperties < 3) { |
| checkDominantColorsAnnotation(o.dominantColors!); |
| } |
| buildCounterImageProperties--; |
| } |
| |
| core.int buildCounterImageSource = 0; |
| api.ImageSource buildImageSource() { |
| final o = api.ImageSource(); |
| buildCounterImageSource++; |
| if (buildCounterImageSource < 3) { |
| o.gcsImageUri = 'foo'; |
| o.imageUri = 'foo'; |
| } |
| buildCounterImageSource--; |
| return o; |
| } |
| |
| void checkImageSource(api.ImageSource o) { |
| buildCounterImageSource++; |
| if (buildCounterImageSource < 3) { |
| unittest.expect(o.gcsImageUri!, unittest.equals('foo')); |
| unittest.expect(o.imageUri!, unittest.equals('foo')); |
| } |
| buildCounterImageSource--; |
| } |
| |
| core.int buildCounterImportProductSetsGcsSource = 0; |
| api.ImportProductSetsGcsSource buildImportProductSetsGcsSource() { |
| final o = api.ImportProductSetsGcsSource(); |
| buildCounterImportProductSetsGcsSource++; |
| if (buildCounterImportProductSetsGcsSource < 3) { |
| o.csvFileUri = 'foo'; |
| } |
| buildCounterImportProductSetsGcsSource--; |
| return o; |
| } |
| |
| void checkImportProductSetsGcsSource(api.ImportProductSetsGcsSource o) { |
| buildCounterImportProductSetsGcsSource++; |
| if (buildCounterImportProductSetsGcsSource < 3) { |
| unittest.expect(o.csvFileUri!, unittest.equals('foo')); |
| } |
| buildCounterImportProductSetsGcsSource--; |
| } |
| |
| core.int buildCounterImportProductSetsInputConfig = 0; |
| api.ImportProductSetsInputConfig buildImportProductSetsInputConfig() { |
| final o = api.ImportProductSetsInputConfig(); |
| buildCounterImportProductSetsInputConfig++; |
| if (buildCounterImportProductSetsInputConfig < 3) { |
| o.gcsSource = buildImportProductSetsGcsSource(); |
| } |
| buildCounterImportProductSetsInputConfig--; |
| return o; |
| } |
| |
| void checkImportProductSetsInputConfig(api.ImportProductSetsInputConfig o) { |
| buildCounterImportProductSetsInputConfig++; |
| if (buildCounterImportProductSetsInputConfig < 3) { |
| checkImportProductSetsGcsSource(o.gcsSource!); |
| } |
| buildCounterImportProductSetsInputConfig--; |
| } |
| |
| core.int buildCounterImportProductSetsRequest = 0; |
| api.ImportProductSetsRequest buildImportProductSetsRequest() { |
| final o = api.ImportProductSetsRequest(); |
| buildCounterImportProductSetsRequest++; |
| if (buildCounterImportProductSetsRequest < 3) { |
| o.inputConfig = buildImportProductSetsInputConfig(); |
| } |
| buildCounterImportProductSetsRequest--; |
| return o; |
| } |
| |
| void checkImportProductSetsRequest(api.ImportProductSetsRequest o) { |
| buildCounterImportProductSetsRequest++; |
| if (buildCounterImportProductSetsRequest < 3) { |
| checkImportProductSetsInputConfig(o.inputConfig!); |
| } |
| buildCounterImportProductSetsRequest--; |
| } |
| |
| core.int buildCounterInputConfig = 0; |
| api.InputConfig buildInputConfig() { |
| final o = api.InputConfig(); |
| buildCounterInputConfig++; |
| if (buildCounterInputConfig < 3) { |
| o.content = 'foo'; |
| o.gcsSource = buildGcsSource(); |
| o.mimeType = 'foo'; |
| } |
| buildCounterInputConfig--; |
| return o; |
| } |
| |
| void checkInputConfig(api.InputConfig o) { |
| buildCounterInputConfig++; |
| if (buildCounterInputConfig < 3) { |
| unittest.expect(o.content!, unittest.equals('foo')); |
| checkGcsSource(o.gcsSource!); |
| unittest.expect(o.mimeType!, unittest.equals('foo')); |
| } |
| buildCounterInputConfig--; |
| } |
| |
| core.int buildCounterKeyValue = 0; |
| api.KeyValue buildKeyValue() { |
| final o = api.KeyValue(); |
| buildCounterKeyValue++; |
| if (buildCounterKeyValue < 3) { |
| o.key = 'foo'; |
| o.value = 'foo'; |
| } |
| buildCounterKeyValue--; |
| return o; |
| } |
| |
| void checkKeyValue(api.KeyValue o) { |
| buildCounterKeyValue++; |
| if (buildCounterKeyValue < 3) { |
| unittest.expect(o.key!, unittest.equals('foo')); |
| unittest.expect(o.value!, unittest.equals('foo')); |
| } |
| buildCounterKeyValue--; |
| } |
| |
| core.int buildCounterLandmark = 0; |
| api.Landmark buildLandmark() { |
| final o = api.Landmark(); |
| buildCounterLandmark++; |
| if (buildCounterLandmark < 3) { |
| o.position = buildPosition(); |
| o.type = 'foo'; |
| } |
| buildCounterLandmark--; |
| return o; |
| } |
| |
| void checkLandmark(api.Landmark o) { |
| buildCounterLandmark++; |
| if (buildCounterLandmark < 3) { |
| checkPosition(o.position!); |
| unittest.expect(o.type!, unittest.equals('foo')); |
| } |
| buildCounterLandmark--; |
| } |
| |
| core.int buildCounterLatLng = 0; |
| api.LatLng buildLatLng() { |
| final o = api.LatLng(); |
| buildCounterLatLng++; |
| if (buildCounterLatLng < 3) { |
| o.latitude = 42.0; |
| o.longitude = 42.0; |
| } |
| buildCounterLatLng--; |
| return o; |
| } |
| |
| void checkLatLng(api.LatLng o) { |
| buildCounterLatLng++; |
| if (buildCounterLatLng < 3) { |
| unittest.expect(o.latitude!, unittest.equals(42.0)); |
| unittest.expect(o.longitude!, unittest.equals(42.0)); |
| } |
| buildCounterLatLng--; |
| } |
| |
| core.int buildCounterLatLongRect = 0; |
| api.LatLongRect buildLatLongRect() { |
| final o = api.LatLongRect(); |
| buildCounterLatLongRect++; |
| if (buildCounterLatLongRect < 3) { |
| o.maxLatLng = buildLatLng(); |
| o.minLatLng = buildLatLng(); |
| } |
| buildCounterLatLongRect--; |
| return o; |
| } |
| |
| void checkLatLongRect(api.LatLongRect o) { |
| buildCounterLatLongRect++; |
| if (buildCounterLatLongRect < 3) { |
| checkLatLng(o.maxLatLng!); |
| checkLatLng(o.minLatLng!); |
| } |
| buildCounterLatLongRect--; |
| } |
| |
| core.List<api.Operation> buildUnnamed33() => [ |
| buildOperation(), |
| buildOperation(), |
| ]; |
| |
| void checkUnnamed33(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.List<core.String> buildUnnamed34() => ['foo', 'foo']; |
| |
| void checkUnnamed34(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| final o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed33(); |
| o.unreachable = buildUnnamed34(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed33(o.operations!); |
| checkUnnamed34(o.unreachable!); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.ProductSet> buildUnnamed35() => [ |
| buildProductSet(), |
| buildProductSet(), |
| ]; |
| |
| void checkUnnamed35(core.List<api.ProductSet> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkProductSet(o[0]); |
| checkProductSet(o[1]); |
| } |
| |
| core.int buildCounterListProductSetsResponse = 0; |
| api.ListProductSetsResponse buildListProductSetsResponse() { |
| final o = api.ListProductSetsResponse(); |
| buildCounterListProductSetsResponse++; |
| if (buildCounterListProductSetsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.productSets = buildUnnamed35(); |
| } |
| buildCounterListProductSetsResponse--; |
| return o; |
| } |
| |
| void checkListProductSetsResponse(api.ListProductSetsResponse o) { |
| buildCounterListProductSetsResponse++; |
| if (buildCounterListProductSetsResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed35(o.productSets!); |
| } |
| buildCounterListProductSetsResponse--; |
| } |
| |
| core.List<api.Product> buildUnnamed36() => [buildProduct(), buildProduct()]; |
| |
| void checkUnnamed36(core.List<api.Product> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkProduct(o[0]); |
| checkProduct(o[1]); |
| } |
| |
| core.int buildCounterListProductsInProductSetResponse = 0; |
| api.ListProductsInProductSetResponse buildListProductsInProductSetResponse() { |
| final o = api.ListProductsInProductSetResponse(); |
| buildCounterListProductsInProductSetResponse++; |
| if (buildCounterListProductsInProductSetResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.products = buildUnnamed36(); |
| } |
| buildCounterListProductsInProductSetResponse--; |
| return o; |
| } |
| |
| void checkListProductsInProductSetResponse( |
| api.ListProductsInProductSetResponse o, |
| ) { |
| buildCounterListProductsInProductSetResponse++; |
| if (buildCounterListProductsInProductSetResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed36(o.products!); |
| } |
| buildCounterListProductsInProductSetResponse--; |
| } |
| |
| core.List<api.Product> buildUnnamed37() => [buildProduct(), buildProduct()]; |
| |
| void checkUnnamed37(core.List<api.Product> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkProduct(o[0]); |
| checkProduct(o[1]); |
| } |
| |
| core.int buildCounterListProductsResponse = 0; |
| api.ListProductsResponse buildListProductsResponse() { |
| final o = api.ListProductsResponse(); |
| buildCounterListProductsResponse++; |
| if (buildCounterListProductsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.products = buildUnnamed37(); |
| } |
| buildCounterListProductsResponse--; |
| return o; |
| } |
| |
| void checkListProductsResponse(api.ListProductsResponse o) { |
| buildCounterListProductsResponse++; |
| if (buildCounterListProductsResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| checkUnnamed37(o.products!); |
| } |
| buildCounterListProductsResponse--; |
| } |
| |
| core.List<api.ReferenceImage> buildUnnamed38() => [ |
| buildReferenceImage(), |
| buildReferenceImage(), |
| ]; |
| |
| void checkUnnamed38(core.List<api.ReferenceImage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkReferenceImage(o[0]); |
| checkReferenceImage(o[1]); |
| } |
| |
| core.int buildCounterListReferenceImagesResponse = 0; |
| api.ListReferenceImagesResponse buildListReferenceImagesResponse() { |
| final o = api.ListReferenceImagesResponse(); |
| buildCounterListReferenceImagesResponse++; |
| if (buildCounterListReferenceImagesResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.pageSize = 42; |
| o.referenceImages = buildUnnamed38(); |
| } |
| buildCounterListReferenceImagesResponse--; |
| return o; |
| } |
| |
| void checkListReferenceImagesResponse(api.ListReferenceImagesResponse o) { |
| buildCounterListReferenceImagesResponse++; |
| if (buildCounterListReferenceImagesResponse < 3) { |
| unittest.expect(o.nextPageToken!, unittest.equals('foo')); |
| unittest.expect(o.pageSize!, unittest.equals(42)); |
| checkUnnamed38(o.referenceImages!); |
| } |
| buildCounterListReferenceImagesResponse--; |
| } |
| |
| core.int buildCounterLocalizedObjectAnnotation = 0; |
| api.LocalizedObjectAnnotation buildLocalizedObjectAnnotation() { |
| final o = api.LocalizedObjectAnnotation(); |
| buildCounterLocalizedObjectAnnotation++; |
| if (buildCounterLocalizedObjectAnnotation < 3) { |
| o.boundingPoly = buildBoundingPoly(); |
| o.languageCode = 'foo'; |
| o.mid = 'foo'; |
| o.name = 'foo'; |
| o.score = 42.0; |
| } |
| buildCounterLocalizedObjectAnnotation--; |
| return o; |
| } |
| |
| void checkLocalizedObjectAnnotation(api.LocalizedObjectAnnotation o) { |
| buildCounterLocalizedObjectAnnotation++; |
| if (buildCounterLocalizedObjectAnnotation < 3) { |
| checkBoundingPoly(o.boundingPoly!); |
| unittest.expect(o.languageCode!, unittest.equals('foo')); |
| unittest.expect(o.mid!, unittest.equals('foo')); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| } |
| buildCounterLocalizedObjectAnnotation--; |
| } |
| |
| core.int buildCounterLocationInfo = 0; |
| api.LocationInfo buildLocationInfo() { |
| final o = api.LocationInfo(); |
| buildCounterLocationInfo++; |
| if (buildCounterLocationInfo < 3) { |
| o.latLng = buildLatLng(); |
| } |
| buildCounterLocationInfo--; |
| return o; |
| } |
| |
| void checkLocationInfo(api.LocationInfo o) { |
| buildCounterLocationInfo++; |
| if (buildCounterLocationInfo < 3) { |
| checkLatLng(o.latLng!); |
| } |
| buildCounterLocationInfo--; |
| } |
| |
| core.int buildCounterNormalizedVertex = 0; |
| api.NormalizedVertex buildNormalizedVertex() { |
| final o = api.NormalizedVertex(); |
| buildCounterNormalizedVertex++; |
| if (buildCounterNormalizedVertex < 3) { |
| o.x = 42.0; |
| o.y = 42.0; |
| } |
| buildCounterNormalizedVertex--; |
| return o; |
| } |
| |
| void checkNormalizedVertex(api.NormalizedVertex o) { |
| buildCounterNormalizedVertex++; |
| if (buildCounterNormalizedVertex < 3) { |
| unittest.expect(o.x!, unittest.equals(42.0)); |
| unittest.expect(o.y!, unittest.equals(42.0)); |
| } |
| buildCounterNormalizedVertex--; |
| } |
| |
| core.int buildCounterObjectAnnotation = 0; |
| api.ObjectAnnotation buildObjectAnnotation() { |
| final o = api.ObjectAnnotation(); |
| buildCounterObjectAnnotation++; |
| if (buildCounterObjectAnnotation < 3) { |
| o.languageCode = 'foo'; |
| o.mid = 'foo'; |
| o.name = 'foo'; |
| o.score = 42.0; |
| } |
| buildCounterObjectAnnotation--; |
| return o; |
| } |
| |
| void checkObjectAnnotation(api.ObjectAnnotation o) { |
| buildCounterObjectAnnotation++; |
| if (buildCounterObjectAnnotation < 3) { |
| unittest.expect(o.languageCode!, unittest.equals('foo')); |
| unittest.expect(o.mid!, unittest.equals('foo')); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| } |
| buildCounterObjectAnnotation--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed39() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed39(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted1 = (o['x']!) as core.Map; |
| unittest.expect(casted1, unittest.hasLength(3)); |
| unittest.expect(casted1['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted1['bool'], unittest.equals(true)); |
| unittest.expect(casted1['string'], unittest.equals('foo')); |
| var casted2 = (o['y']!) as core.Map; |
| unittest.expect(casted2, unittest.hasLength(3)); |
| unittest.expect(casted2['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted2['bool'], unittest.equals(true)); |
| unittest.expect(casted2['string'], unittest.equals('foo')); |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed40() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed40(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o['x']!) as core.Map; |
| unittest.expect(casted3, unittest.hasLength(3)); |
| unittest.expect(casted3['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted3['bool'], unittest.equals(true)); |
| unittest.expect(casted3['string'], unittest.equals('foo')); |
| var casted4 = (o['y']!) as core.Map; |
| unittest.expect(casted4, unittest.hasLength(3)); |
| unittest.expect(casted4['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted4['bool'], unittest.equals(true)); |
| unittest.expect(casted4['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| final o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed39(); |
| o.name = 'foo'; |
| o.response = buildUnnamed40(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done!, unittest.isTrue); |
| checkStatus(o.error!); |
| checkUnnamed39(o.metadata!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| checkUnnamed40(o.response!); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOutputConfig = 0; |
| api.OutputConfig buildOutputConfig() { |
| final o = api.OutputConfig(); |
| buildCounterOutputConfig++; |
| if (buildCounterOutputConfig < 3) { |
| o.batchSize = 42; |
| o.gcsDestination = buildGcsDestination(); |
| } |
| buildCounterOutputConfig--; |
| return o; |
| } |
| |
| void checkOutputConfig(api.OutputConfig o) { |
| buildCounterOutputConfig++; |
| if (buildCounterOutputConfig < 3) { |
| unittest.expect(o.batchSize!, unittest.equals(42)); |
| checkGcsDestination(o.gcsDestination!); |
| } |
| buildCounterOutputConfig--; |
| } |
| |
| core.List<api.Block> buildUnnamed41() => [buildBlock(), buildBlock()]; |
| |
| void checkUnnamed41(core.List<api.Block> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBlock(o[0]); |
| checkBlock(o[1]); |
| } |
| |
| core.int buildCounterPage = 0; |
| api.Page buildPage() { |
| final o = api.Page(); |
| buildCounterPage++; |
| if (buildCounterPage < 3) { |
| o.blocks = buildUnnamed41(); |
| o.confidence = 42.0; |
| o.height = 42; |
| o.property = buildTextProperty(); |
| o.width = 42; |
| } |
| buildCounterPage--; |
| return o; |
| } |
| |
| void checkPage(api.Page o) { |
| buildCounterPage++; |
| if (buildCounterPage < 3) { |
| checkUnnamed41(o.blocks!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| unittest.expect(o.height!, unittest.equals(42)); |
| checkTextProperty(o.property!); |
| unittest.expect(o.width!, unittest.equals(42)); |
| } |
| buildCounterPage--; |
| } |
| |
| core.List<api.Word> buildUnnamed42() => [buildWord(), buildWord()]; |
| |
| void checkUnnamed42(core.List<api.Word> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWord(o[0]); |
| checkWord(o[1]); |
| } |
| |
| core.int buildCounterParagraph = 0; |
| api.Paragraph buildParagraph() { |
| final o = api.Paragraph(); |
| buildCounterParagraph++; |
| if (buildCounterParagraph < 3) { |
| o.boundingBox = buildBoundingPoly(); |
| o.confidence = 42.0; |
| o.property = buildTextProperty(); |
| o.words = buildUnnamed42(); |
| } |
| buildCounterParagraph--; |
| return o; |
| } |
| |
| void checkParagraph(api.Paragraph o) { |
| buildCounterParagraph++; |
| if (buildCounterParagraph < 3) { |
| checkBoundingPoly(o.boundingBox!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| checkTextProperty(o.property!); |
| checkUnnamed42(o.words!); |
| } |
| buildCounterParagraph--; |
| } |
| |
| core.int buildCounterPosition = 0; |
| api.Position buildPosition() { |
| final o = api.Position(); |
| buildCounterPosition++; |
| if (buildCounterPosition < 3) { |
| o.x = 42.0; |
| o.y = 42.0; |
| o.z = 42.0; |
| } |
| buildCounterPosition--; |
| return o; |
| } |
| |
| void checkPosition(api.Position o) { |
| buildCounterPosition++; |
| if (buildCounterPosition < 3) { |
| unittest.expect(o.x!, unittest.equals(42.0)); |
| unittest.expect(o.y!, unittest.equals(42.0)); |
| unittest.expect(o.z!, unittest.equals(42.0)); |
| } |
| buildCounterPosition--; |
| } |
| |
| core.List<api.KeyValue> buildUnnamed43() => [buildKeyValue(), buildKeyValue()]; |
| |
| void checkUnnamed43(core.List<api.KeyValue> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkKeyValue(o[0]); |
| checkKeyValue(o[1]); |
| } |
| |
| core.int buildCounterProduct = 0; |
| api.Product buildProduct() { |
| final o = api.Product(); |
| buildCounterProduct++; |
| if (buildCounterProduct < 3) { |
| o.description = 'foo'; |
| o.displayName = 'foo'; |
| o.name = 'foo'; |
| o.productCategory = 'foo'; |
| o.productLabels = buildUnnamed43(); |
| } |
| buildCounterProduct--; |
| return o; |
| } |
| |
| void checkProduct(api.Product o) { |
| buildCounterProduct++; |
| if (buildCounterProduct < 3) { |
| unittest.expect(o.description!, unittest.equals('foo')); |
| unittest.expect(o.displayName!, unittest.equals('foo')); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.productCategory!, unittest.equals('foo')); |
| checkUnnamed43(o.productLabels!); |
| } |
| buildCounterProduct--; |
| } |
| |
| core.List<core.String> buildUnnamed44() => ['foo', 'foo']; |
| |
| void checkUnnamed44(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterProductSearchParams = 0; |
| api.ProductSearchParams buildProductSearchParams() { |
| final o = api.ProductSearchParams(); |
| buildCounterProductSearchParams++; |
| if (buildCounterProductSearchParams < 3) { |
| o.boundingPoly = buildBoundingPoly(); |
| o.filter = 'foo'; |
| o.productCategories = buildUnnamed44(); |
| o.productSet = 'foo'; |
| } |
| buildCounterProductSearchParams--; |
| return o; |
| } |
| |
| void checkProductSearchParams(api.ProductSearchParams o) { |
| buildCounterProductSearchParams++; |
| if (buildCounterProductSearchParams < 3) { |
| checkBoundingPoly(o.boundingPoly!); |
| unittest.expect(o.filter!, unittest.equals('foo')); |
| checkUnnamed44(o.productCategories!); |
| unittest.expect(o.productSet!, unittest.equals('foo')); |
| } |
| buildCounterProductSearchParams--; |
| } |
| |
| core.List<api.GroupedResult> buildUnnamed45() => [ |
| buildGroupedResult(), |
| buildGroupedResult(), |
| ]; |
| |
| void checkUnnamed45(core.List<api.GroupedResult> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkGroupedResult(o[0]); |
| checkGroupedResult(o[1]); |
| } |
| |
| core.List<api.Result> buildUnnamed46() => [buildResult(), buildResult()]; |
| |
| void checkUnnamed46(core.List<api.Result> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkResult(o[0]); |
| checkResult(o[1]); |
| } |
| |
| core.int buildCounterProductSearchResults = 0; |
| api.ProductSearchResults buildProductSearchResults() { |
| final o = api.ProductSearchResults(); |
| buildCounterProductSearchResults++; |
| if (buildCounterProductSearchResults < 3) { |
| o.indexTime = 'foo'; |
| o.productGroupedResults = buildUnnamed45(); |
| o.results = buildUnnamed46(); |
| } |
| buildCounterProductSearchResults--; |
| return o; |
| } |
| |
| void checkProductSearchResults(api.ProductSearchResults o) { |
| buildCounterProductSearchResults++; |
| if (buildCounterProductSearchResults < 3) { |
| unittest.expect(o.indexTime!, unittest.equals('foo')); |
| checkUnnamed45(o.productGroupedResults!); |
| checkUnnamed46(o.results!); |
| } |
| buildCounterProductSearchResults--; |
| } |
| |
| core.int buildCounterProductSet = 0; |
| api.ProductSet buildProductSet() { |
| final o = api.ProductSet(); |
| buildCounterProductSet++; |
| if (buildCounterProductSet < 3) { |
| o.displayName = 'foo'; |
| o.indexError = buildStatus(); |
| o.indexTime = 'foo'; |
| o.name = 'foo'; |
| } |
| buildCounterProductSet--; |
| return o; |
| } |
| |
| void checkProductSet(api.ProductSet o) { |
| buildCounterProductSet++; |
| if (buildCounterProductSet < 3) { |
| unittest.expect(o.displayName!, unittest.equals('foo')); |
| checkStatus(o.indexError!); |
| unittest.expect(o.indexTime!, unittest.equals('foo')); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| } |
| buildCounterProductSet--; |
| } |
| |
| core.int buildCounterProductSetPurgeConfig = 0; |
| api.ProductSetPurgeConfig buildProductSetPurgeConfig() { |
| final o = api.ProductSetPurgeConfig(); |
| buildCounterProductSetPurgeConfig++; |
| if (buildCounterProductSetPurgeConfig < 3) { |
| o.productSetId = 'foo'; |
| } |
| buildCounterProductSetPurgeConfig--; |
| return o; |
| } |
| |
| void checkProductSetPurgeConfig(api.ProductSetPurgeConfig o) { |
| buildCounterProductSetPurgeConfig++; |
| if (buildCounterProductSetPurgeConfig < 3) { |
| unittest.expect(o.productSetId!, unittest.equals('foo')); |
| } |
| buildCounterProductSetPurgeConfig--; |
| } |
| |
| core.int buildCounterProperty = 0; |
| api.Property buildProperty() { |
| final o = api.Property(); |
| buildCounterProperty++; |
| if (buildCounterProperty < 3) { |
| o.name = 'foo'; |
| o.uint64Value = 'foo'; |
| o.value = 'foo'; |
| } |
| buildCounterProperty--; |
| return o; |
| } |
| |
| void checkProperty(api.Property o) { |
| buildCounterProperty++; |
| if (buildCounterProperty < 3) { |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.uint64Value!, unittest.equals('foo')); |
| unittest.expect(o.value!, unittest.equals('foo')); |
| } |
| buildCounterProperty--; |
| } |
| |
| core.int buildCounterPurgeProductsRequest = 0; |
| api.PurgeProductsRequest buildPurgeProductsRequest() { |
| final o = api.PurgeProductsRequest(); |
| buildCounterPurgeProductsRequest++; |
| if (buildCounterPurgeProductsRequest < 3) { |
| o.deleteOrphanProducts = true; |
| o.force = true; |
| o.productSetPurgeConfig = buildProductSetPurgeConfig(); |
| } |
| buildCounterPurgeProductsRequest--; |
| return o; |
| } |
| |
| void checkPurgeProductsRequest(api.PurgeProductsRequest o) { |
| buildCounterPurgeProductsRequest++; |
| if (buildCounterPurgeProductsRequest < 3) { |
| unittest.expect(o.deleteOrphanProducts!, unittest.isTrue); |
| unittest.expect(o.force!, unittest.isTrue); |
| checkProductSetPurgeConfig(o.productSetPurgeConfig!); |
| } |
| buildCounterPurgeProductsRequest--; |
| } |
| |
| core.List<api.BoundingPoly> buildUnnamed47() => [ |
| buildBoundingPoly(), |
| buildBoundingPoly(), |
| ]; |
| |
| void checkUnnamed47(core.List<api.BoundingPoly> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBoundingPoly(o[0]); |
| checkBoundingPoly(o[1]); |
| } |
| |
| core.int buildCounterReferenceImage = 0; |
| api.ReferenceImage buildReferenceImage() { |
| final o = api.ReferenceImage(); |
| buildCounterReferenceImage++; |
| if (buildCounterReferenceImage < 3) { |
| o.boundingPolys = buildUnnamed47(); |
| o.name = 'foo'; |
| o.uri = 'foo'; |
| } |
| buildCounterReferenceImage--; |
| return o; |
| } |
| |
| void checkReferenceImage(api.ReferenceImage o) { |
| buildCounterReferenceImage++; |
| if (buildCounterReferenceImage < 3) { |
| checkUnnamed47(o.boundingPolys!); |
| unittest.expect(o.name!, unittest.equals('foo')); |
| unittest.expect(o.uri!, unittest.equals('foo')); |
| } |
| buildCounterReferenceImage--; |
| } |
| |
| core.int buildCounterRemoveProductFromProductSetRequest = 0; |
| api.RemoveProductFromProductSetRequest |
| buildRemoveProductFromProductSetRequest() { |
| final o = api.RemoveProductFromProductSetRequest(); |
| buildCounterRemoveProductFromProductSetRequest++; |
| if (buildCounterRemoveProductFromProductSetRequest < 3) { |
| o.product = 'foo'; |
| } |
| buildCounterRemoveProductFromProductSetRequest--; |
| return o; |
| } |
| |
| void checkRemoveProductFromProductSetRequest( |
| api.RemoveProductFromProductSetRequest o, |
| ) { |
| buildCounterRemoveProductFromProductSetRequest++; |
| if (buildCounterRemoveProductFromProductSetRequest < 3) { |
| unittest.expect(o.product!, unittest.equals('foo')); |
| } |
| buildCounterRemoveProductFromProductSetRequest--; |
| } |
| |
| core.int buildCounterResult = 0; |
| api.Result buildResult() { |
| final o = api.Result(); |
| buildCounterResult++; |
| if (buildCounterResult < 3) { |
| o.image = 'foo'; |
| o.product = buildProduct(); |
| o.score = 42.0; |
| } |
| buildCounterResult--; |
| return o; |
| } |
| |
| void checkResult(api.Result o) { |
| buildCounterResult++; |
| if (buildCounterResult < 3) { |
| unittest.expect(o.image!, unittest.equals('foo')); |
| checkProduct(o.product!); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| } |
| buildCounterResult--; |
| } |
| |
| core.int buildCounterSafeSearchAnnotation = 0; |
| api.SafeSearchAnnotation buildSafeSearchAnnotation() { |
| final o = api.SafeSearchAnnotation(); |
| buildCounterSafeSearchAnnotation++; |
| if (buildCounterSafeSearchAnnotation < 3) { |
| o.adult = 'foo'; |
| o.medical = 'foo'; |
| o.racy = 'foo'; |
| o.spoof = 'foo'; |
| o.violence = 'foo'; |
| } |
| buildCounterSafeSearchAnnotation--; |
| return o; |
| } |
| |
| void checkSafeSearchAnnotation(api.SafeSearchAnnotation o) { |
| buildCounterSafeSearchAnnotation++; |
| if (buildCounterSafeSearchAnnotation < 3) { |
| unittest.expect(o.adult!, unittest.equals('foo')); |
| unittest.expect(o.medical!, unittest.equals('foo')); |
| unittest.expect(o.racy!, unittest.equals('foo')); |
| unittest.expect(o.spoof!, unittest.equals('foo')); |
| unittest.expect(o.violence!, unittest.equals('foo')); |
| } |
| buildCounterSafeSearchAnnotation--; |
| } |
| |
| core.Map<core.String, core.Object?> buildUnnamed48() => { |
| 'x': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| 'y': { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo', |
| }, |
| }; |
| |
| void checkUnnamed48(core.Map<core.String, core.Object?> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted5 = (o['x']!) as core.Map; |
| unittest.expect(casted5, unittest.hasLength(3)); |
| unittest.expect(casted5['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted5['bool'], unittest.equals(true)); |
| unittest.expect(casted5['string'], unittest.equals('foo')); |
| var casted6 = (o['y']!) as core.Map; |
| unittest.expect(casted6, unittest.hasLength(3)); |
| unittest.expect(casted6['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted6['bool'], unittest.equals(true)); |
| unittest.expect(casted6['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Map<core.String, core.Object?>> buildUnnamed49() => [ |
| buildUnnamed48(), |
| buildUnnamed48(), |
| ]; |
| |
| void checkUnnamed49(core.List<core.Map<core.String, core.Object?>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed48(o[0]); |
| checkUnnamed48(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| final o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed49(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code!, unittest.equals(42)); |
| checkUnnamed49(o.details!); |
| unittest.expect(o.message!, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterSymbol = 0; |
| api.Symbol buildSymbol() { |
| final o = api.Symbol(); |
| buildCounterSymbol++; |
| if (buildCounterSymbol < 3) { |
| o.boundingBox = buildBoundingPoly(); |
| o.confidence = 42.0; |
| o.property = buildTextProperty(); |
| o.text = 'foo'; |
| } |
| buildCounterSymbol--; |
| return o; |
| } |
| |
| void checkSymbol(api.Symbol o) { |
| buildCounterSymbol++; |
| if (buildCounterSymbol < 3) { |
| checkBoundingPoly(o.boundingBox!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| checkTextProperty(o.property!); |
| unittest.expect(o.text!, unittest.equals('foo')); |
| } |
| buildCounterSymbol--; |
| } |
| |
| core.List<api.Page> buildUnnamed50() => [buildPage(), buildPage()]; |
| |
| void checkUnnamed50(core.List<api.Page> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPage(o[0]); |
| checkPage(o[1]); |
| } |
| |
| core.int buildCounterTextAnnotation = 0; |
| api.TextAnnotation buildTextAnnotation() { |
| final o = api.TextAnnotation(); |
| buildCounterTextAnnotation++; |
| if (buildCounterTextAnnotation < 3) { |
| o.pages = buildUnnamed50(); |
| o.text = 'foo'; |
| } |
| buildCounterTextAnnotation--; |
| return o; |
| } |
| |
| void checkTextAnnotation(api.TextAnnotation o) { |
| buildCounterTextAnnotation++; |
| if (buildCounterTextAnnotation < 3) { |
| checkUnnamed50(o.pages!); |
| unittest.expect(o.text!, unittest.equals('foo')); |
| } |
| buildCounterTextAnnotation--; |
| } |
| |
| core.List<core.String> buildUnnamed51() => ['foo', 'foo']; |
| |
| void checkUnnamed51(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterTextDetectionParams = 0; |
| api.TextDetectionParams buildTextDetectionParams() { |
| final o = api.TextDetectionParams(); |
| buildCounterTextDetectionParams++; |
| if (buildCounterTextDetectionParams < 3) { |
| o.advancedOcrOptions = buildUnnamed51(); |
| o.enableTextDetectionConfidenceScore = true; |
| } |
| buildCounterTextDetectionParams--; |
| return o; |
| } |
| |
| void checkTextDetectionParams(api.TextDetectionParams o) { |
| buildCounterTextDetectionParams++; |
| if (buildCounterTextDetectionParams < 3) { |
| checkUnnamed51(o.advancedOcrOptions!); |
| unittest.expect(o.enableTextDetectionConfidenceScore!, unittest.isTrue); |
| } |
| buildCounterTextDetectionParams--; |
| } |
| |
| core.List<api.DetectedLanguage> buildUnnamed52() => [ |
| buildDetectedLanguage(), |
| buildDetectedLanguage(), |
| ]; |
| |
| void checkUnnamed52(core.List<api.DetectedLanguage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDetectedLanguage(o[0]); |
| checkDetectedLanguage(o[1]); |
| } |
| |
| core.int buildCounterTextProperty = 0; |
| api.TextProperty buildTextProperty() { |
| final o = api.TextProperty(); |
| buildCounterTextProperty++; |
| if (buildCounterTextProperty < 3) { |
| o.detectedBreak = buildDetectedBreak(); |
| o.detectedLanguages = buildUnnamed52(); |
| } |
| buildCounterTextProperty--; |
| return o; |
| } |
| |
| void checkTextProperty(api.TextProperty o) { |
| buildCounterTextProperty++; |
| if (buildCounterTextProperty < 3) { |
| checkDetectedBreak(o.detectedBreak!); |
| checkUnnamed52(o.detectedLanguages!); |
| } |
| buildCounterTextProperty--; |
| } |
| |
| core.int buildCounterVertex = 0; |
| api.Vertex buildVertex() { |
| final o = api.Vertex(); |
| buildCounterVertex++; |
| if (buildCounterVertex < 3) { |
| o.x = 42; |
| o.y = 42; |
| } |
| buildCounterVertex--; |
| return o; |
| } |
| |
| void checkVertex(api.Vertex o) { |
| buildCounterVertex++; |
| if (buildCounterVertex < 3) { |
| unittest.expect(o.x!, unittest.equals(42)); |
| unittest.expect(o.y!, unittest.equals(42)); |
| } |
| buildCounterVertex--; |
| } |
| |
| core.List<api.WebLabel> buildUnnamed53() => [buildWebLabel(), buildWebLabel()]; |
| |
| void checkUnnamed53(core.List<api.WebLabel> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebLabel(o[0]); |
| checkWebLabel(o[1]); |
| } |
| |
| core.List<api.WebImage> buildUnnamed54() => [buildWebImage(), buildWebImage()]; |
| |
| void checkUnnamed54(core.List<api.WebImage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebImage(o[0]); |
| checkWebImage(o[1]); |
| } |
| |
| core.List<api.WebPage> buildUnnamed55() => [buildWebPage(), buildWebPage()]; |
| |
| void checkUnnamed55(core.List<api.WebPage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebPage(o[0]); |
| checkWebPage(o[1]); |
| } |
| |
| core.List<api.WebImage> buildUnnamed56() => [buildWebImage(), buildWebImage()]; |
| |
| void checkUnnamed56(core.List<api.WebImage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebImage(o[0]); |
| checkWebImage(o[1]); |
| } |
| |
| core.List<api.WebImage> buildUnnamed57() => [buildWebImage(), buildWebImage()]; |
| |
| void checkUnnamed57(core.List<api.WebImage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebImage(o[0]); |
| checkWebImage(o[1]); |
| } |
| |
| core.List<api.WebEntity> buildUnnamed58() => [ |
| buildWebEntity(), |
| buildWebEntity(), |
| ]; |
| |
| void checkUnnamed58(core.List<api.WebEntity> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebEntity(o[0]); |
| checkWebEntity(o[1]); |
| } |
| |
| core.int buildCounterWebDetection = 0; |
| api.WebDetection buildWebDetection() { |
| final o = api.WebDetection(); |
| buildCounterWebDetection++; |
| if (buildCounterWebDetection < 3) { |
| o.bestGuessLabels = buildUnnamed53(); |
| o.fullMatchingImages = buildUnnamed54(); |
| o.pagesWithMatchingImages = buildUnnamed55(); |
| o.partialMatchingImages = buildUnnamed56(); |
| o.visuallySimilarImages = buildUnnamed57(); |
| o.webEntities = buildUnnamed58(); |
| } |
| buildCounterWebDetection--; |
| return o; |
| } |
| |
| void checkWebDetection(api.WebDetection o) { |
| buildCounterWebDetection++; |
| if (buildCounterWebDetection < 3) { |
| checkUnnamed53(o.bestGuessLabels!); |
| checkUnnamed54(o.fullMatchingImages!); |
| checkUnnamed55(o.pagesWithMatchingImages!); |
| checkUnnamed56(o.partialMatchingImages!); |
| checkUnnamed57(o.visuallySimilarImages!); |
| checkUnnamed58(o.webEntities!); |
| } |
| buildCounterWebDetection--; |
| } |
| |
| core.int buildCounterWebDetectionParams = 0; |
| api.WebDetectionParams buildWebDetectionParams() { |
| final o = api.WebDetectionParams(); |
| buildCounterWebDetectionParams++; |
| if (buildCounterWebDetectionParams < 3) { |
| o.includeGeoResults = true; |
| } |
| buildCounterWebDetectionParams--; |
| return o; |
| } |
| |
| void checkWebDetectionParams(api.WebDetectionParams o) { |
| buildCounterWebDetectionParams++; |
| if (buildCounterWebDetectionParams < 3) { |
| unittest.expect(o.includeGeoResults!, unittest.isTrue); |
| } |
| buildCounterWebDetectionParams--; |
| } |
| |
| core.int buildCounterWebEntity = 0; |
| api.WebEntity buildWebEntity() { |
| final o = api.WebEntity(); |
| buildCounterWebEntity++; |
| if (buildCounterWebEntity < 3) { |
| o.description = 'foo'; |
| o.entityId = 'foo'; |
| o.score = 42.0; |
| } |
| buildCounterWebEntity--; |
| return o; |
| } |
| |
| void checkWebEntity(api.WebEntity o) { |
| buildCounterWebEntity++; |
| if (buildCounterWebEntity < 3) { |
| unittest.expect(o.description!, unittest.equals('foo')); |
| unittest.expect(o.entityId!, unittest.equals('foo')); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| } |
| buildCounterWebEntity--; |
| } |
| |
| core.int buildCounterWebImage = 0; |
| api.WebImage buildWebImage() { |
| final o = api.WebImage(); |
| buildCounterWebImage++; |
| if (buildCounterWebImage < 3) { |
| o.score = 42.0; |
| o.url = 'foo'; |
| } |
| buildCounterWebImage--; |
| return o; |
| } |
| |
| void checkWebImage(api.WebImage o) { |
| buildCounterWebImage++; |
| if (buildCounterWebImage < 3) { |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| unittest.expect(o.url!, unittest.equals('foo')); |
| } |
| buildCounterWebImage--; |
| } |
| |
| core.int buildCounterWebLabel = 0; |
| api.WebLabel buildWebLabel() { |
| final o = api.WebLabel(); |
| buildCounterWebLabel++; |
| if (buildCounterWebLabel < 3) { |
| o.label = 'foo'; |
| o.languageCode = 'foo'; |
| } |
| buildCounterWebLabel--; |
| return o; |
| } |
| |
| void checkWebLabel(api.WebLabel o) { |
| buildCounterWebLabel++; |
| if (buildCounterWebLabel < 3) { |
| unittest.expect(o.label!, unittest.equals('foo')); |
| unittest.expect(o.languageCode!, unittest.equals('foo')); |
| } |
| buildCounterWebLabel--; |
| } |
| |
| core.List<api.WebImage> buildUnnamed59() => [buildWebImage(), buildWebImage()]; |
| |
| void checkUnnamed59(core.List<api.WebImage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebImage(o[0]); |
| checkWebImage(o[1]); |
| } |
| |
| core.List<api.WebImage> buildUnnamed60() => [buildWebImage(), buildWebImage()]; |
| |
| void checkUnnamed60(core.List<api.WebImage> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWebImage(o[0]); |
| checkWebImage(o[1]); |
| } |
| |
| core.int buildCounterWebPage = 0; |
| api.WebPage buildWebPage() { |
| final o = api.WebPage(); |
| buildCounterWebPage++; |
| if (buildCounterWebPage < 3) { |
| o.fullMatchingImages = buildUnnamed59(); |
| o.pageTitle = 'foo'; |
| o.partialMatchingImages = buildUnnamed60(); |
| o.score = 42.0; |
| o.url = 'foo'; |
| } |
| buildCounterWebPage--; |
| return o; |
| } |
| |
| void checkWebPage(api.WebPage o) { |
| buildCounterWebPage++; |
| if (buildCounterWebPage < 3) { |
| checkUnnamed59(o.fullMatchingImages!); |
| unittest.expect(o.pageTitle!, unittest.equals('foo')); |
| checkUnnamed60(o.partialMatchingImages!); |
| unittest.expect(o.score!, unittest.equals(42.0)); |
| unittest.expect(o.url!, unittest.equals('foo')); |
| } |
| buildCounterWebPage--; |
| } |
| |
| core.List<api.Symbol> buildUnnamed61() => [buildSymbol(), buildSymbol()]; |
| |
| void checkUnnamed61(core.List<api.Symbol> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSymbol(o[0]); |
| checkSymbol(o[1]); |
| } |
| |
| core.int buildCounterWord = 0; |
| api.Word buildWord() { |
| final o = api.Word(); |
| buildCounterWord++; |
| if (buildCounterWord < 3) { |
| o.boundingBox = buildBoundingPoly(); |
| o.confidence = 42.0; |
| o.property = buildTextProperty(); |
| o.symbols = buildUnnamed61(); |
| } |
| buildCounterWord--; |
| return o; |
| } |
| |
| void checkWord(api.Word o) { |
| buildCounterWord++; |
| if (buildCounterWord < 3) { |
| checkBoundingPoly(o.boundingBox!); |
| unittest.expect(o.confidence!, unittest.equals(42.0)); |
| checkTextProperty(o.property!); |
| checkUnnamed61(o.symbols!); |
| } |
| buildCounterWord--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-AddProductToProductSetRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAddProductToProductSetRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AddProductToProductSetRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAddProductToProductSetRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AnnotateFileRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAnnotateFileRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AnnotateFileRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAnnotateFileRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AnnotateFileResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAnnotateFileResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AnnotateFileResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAnnotateFileResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AnnotateImageRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAnnotateImageRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AnnotateImageRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAnnotateImageRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AnnotateImageResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAnnotateImageResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AnnotateImageResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAnnotateImageResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AsyncAnnotateFileRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAsyncAnnotateFileRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AsyncAnnotateFileRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncAnnotateFileRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AsyncBatchAnnotateFilesRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAsyncBatchAnnotateFilesRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AsyncBatchAnnotateFilesRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateFilesRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-AsyncBatchAnnotateImagesRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildAsyncBatchAnnotateImagesRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.AsyncBatchAnnotateImagesRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateImagesRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchAnnotateFilesRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBatchAnnotateFilesRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BatchAnnotateFilesRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateFilesRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchAnnotateFilesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBatchAnnotateFilesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BatchAnnotateFilesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateFilesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchAnnotateImagesRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBatchAnnotateImagesRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BatchAnnotateImagesRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateImagesRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchAnnotateImagesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBatchAnnotateImagesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BatchAnnotateImagesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateImagesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Block', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBlock(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Block.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBlock(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BoundingPoly', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildBoundingPoly(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.BoundingPoly.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkBoundingPoly(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CancelOperationRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCancelOperationRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CancelOperationRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCancelOperationRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Color', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildColor(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Color.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkColor(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ColorInfo', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildColorInfo(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ColorInfo.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkColorInfo(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CropHint', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCropHint(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CropHint.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCropHint(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CropHintsAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCropHintsAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CropHintsAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCropHintsAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CropHintsParams', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildCropHintsParams(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.CropHintsParams.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkCropHintsParams(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DetectedBreak', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDetectedBreak(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DetectedBreak.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDetectedBreak(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DetectedLanguage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDetectedLanguage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DetectedLanguage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDetectedLanguage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-DominantColorsAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildDominantColorsAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.DominantColorsAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkDominantColorsAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEmpty(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Empty.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkEmpty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-EntityAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildEntityAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.EntityAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkEntityAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-FaceAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildFaceAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.FaceAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkFaceAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Feature', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildFeature(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Feature.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkFeature(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GcsDestination', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGcsDestination(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GcsDestination.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkGcsDestination(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GcsSource', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGcsSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GcsSource.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkGcsSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GroupedResult', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildGroupedResult(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.GroupedResult.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkGroupedResult(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Image', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Image.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImageAnnotationContext', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImageAnnotationContext(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImageAnnotationContext.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImageAnnotationContext(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImageContext', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImageContext(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImageContext.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImageContext(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImageProperties', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImageProperties(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImageProperties.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImageProperties(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImageSource', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImageSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImageSource.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImageSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImportProductSetsGcsSource', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImportProductSetsGcsSource(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImportProductSetsGcsSource.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImportProductSetsGcsSource(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImportProductSetsInputConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImportProductSetsInputConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImportProductSetsInputConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImportProductSetsInputConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ImportProductSetsRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildImportProductSetsRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ImportProductSetsRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkImportProductSetsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-InputConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildInputConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.InputConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkInputConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-KeyValue', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildKeyValue(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.KeyValue.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkKeyValue(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Landmark', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLandmark(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Landmark.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkLandmark(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LatLng', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLatLng(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.LatLng.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkLatLng(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LatLongRect', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLatLongRect(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.LatLongRect.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkLatLongRect(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListOperationsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListOperationsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListProductSetsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListProductSetsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListProductSetsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListProductSetsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListProductsInProductSetResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListProductsInProductSetResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListProductsInProductSetResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListProductsInProductSetResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListProductsResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListProductsResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListProductsResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListProductsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListReferenceImagesResponse', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildListReferenceImagesResponse(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ListReferenceImagesResponse.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkListReferenceImagesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LocalizedObjectAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLocalizedObjectAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.LocalizedObjectAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkLocalizedObjectAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-LocationInfo', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildLocationInfo(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.LocationInfo.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkLocationInfo(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-NormalizedVertex', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildNormalizedVertex(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.NormalizedVertex.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkNormalizedVertex(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ObjectAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildObjectAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ObjectAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkObjectAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOperation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Operation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OutputConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildOutputConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.OutputConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkOutputConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Page', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildPage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Page.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkPage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Paragraph', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildParagraph(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Paragraph.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkParagraph(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Position', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildPosition(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Position.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkPosition(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Product', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProduct(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Product.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkProduct(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ProductSearchParams', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProductSearchParams(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ProductSearchParams.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkProductSearchParams(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ProductSearchResults', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProductSearchResults(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ProductSearchResults.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkProductSearchResults(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ProductSet', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProductSet(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ProductSet.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkProductSet(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ProductSetPurgeConfig', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProductSetPurgeConfig(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ProductSetPurgeConfig.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkProductSetPurgeConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Property', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildProperty(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Property.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkProperty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PurgeProductsRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildPurgeProductsRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.PurgeProductsRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkPurgeProductsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReferenceImage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildReferenceImage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.ReferenceImage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkReferenceImage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RemoveProductFromProductSetRequest', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildRemoveProductFromProductSetRequest(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.RemoveProductFromProductSetRequest.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkRemoveProductFromProductSetRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Result', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildResult(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Result.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkResult(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SafeSearchAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSafeSearchAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.SafeSearchAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkSafeSearchAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildStatus(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Status.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Symbol', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildSymbol(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Symbol.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkSymbol(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TextAnnotation', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildTextAnnotation(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.TextAnnotation.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkTextAnnotation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TextDetectionParams', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildTextDetectionParams(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.TextDetectionParams.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkTextDetectionParams(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TextProperty', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildTextProperty(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.TextProperty.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkTextProperty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Vertex', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildVertex(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Vertex.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkVertex(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WebDetection', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWebDetection(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WebDetection.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWebDetection(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WebDetectionParams', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWebDetectionParams(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WebDetectionParams.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWebDetectionParams(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WebEntity', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWebEntity(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WebEntity.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWebEntity(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WebImage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWebImage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WebImage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWebImage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WebLabel', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWebLabel(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WebLabel.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWebLabel(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-WebPage', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWebPage(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.WebPage.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWebPage(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Word', () { |
| unittest.test('to-json--from-json', () async { |
| final o = buildWord(); |
| final oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| final od = api.Word.fromJson( |
| oJson as core.Map<core.String, core.dynamic>, |
| ); |
| checkWord(od); |
| }); |
| }); |
| |
| unittest.group('resource-FilesResource', () { |
| unittest.test('method--annotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).files; |
| final arg_request = buildBatchAnnotateFilesRequest(); |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchAnnotateFilesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateFilesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 17), |
| unittest.equals('v1/files:annotate'), |
| ); |
| pathOffset += 17; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchAnnotateFilesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.annotate(arg_request, $fields: arg_$fields); |
| checkBatchAnnotateFilesResponse( |
| response as api.BatchAnnotateFilesResponse, |
| ); |
| }); |
| |
| unittest.test('method--asyncBatchAnnotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).files; |
| final arg_request = buildAsyncBatchAnnotateFilesRequest(); |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AsyncBatchAnnotateFilesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateFilesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 27), |
| unittest.equals('v1/files:asyncBatchAnnotate'), |
| ); |
| pathOffset += 27; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.asyncBatchAnnotate( |
| arg_request, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ImagesResource', () { |
| unittest.test('method--annotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).images; |
| final arg_request = buildBatchAnnotateImagesRequest(); |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchAnnotateImagesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateImagesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 18), |
| unittest.equals('v1/images:annotate'), |
| ); |
| pathOffset += 18; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchAnnotateImagesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.annotate(arg_request, $fields: arg_$fields); |
| checkBatchAnnotateImagesResponse( |
| response as api.BatchAnnotateImagesResponse, |
| ); |
| }); |
| |
| unittest.test('method--asyncBatchAnnotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).images; |
| final arg_request = buildAsyncBatchAnnotateImagesRequest(); |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AsyncBatchAnnotateImagesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateImagesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 28), |
| unittest.equals('v1/images:asyncBatchAnnotate'), |
| ); |
| pathOffset += 28; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.asyncBatchAnnotate( |
| arg_request, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-LocationsOperationsResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).locations.operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-OperationsResource', () { |
| unittest.test('method--cancel', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).operations; |
| final arg_request = buildCancelOperationRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.CancelOperationRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkCancelOperationRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.cancel( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).operations; |
| final arg_name = 'foo'; |
| final arg_filter = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_returnPartialSuccess = true; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['filter']!.first, |
| unittest.equals(arg_filter), |
| ); |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['returnPartialSuccess']!.first, |
| unittest.equals('$arg_returnPartialSuccess'), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| returnPartialSuccess: arg_returnPartialSuccess, |
| $fields: arg_$fields, |
| ); |
| checkListOperationsResponse(response as api.ListOperationsResponse); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsFilesResource', () { |
| unittest.test('method--annotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.files; |
| final arg_request = buildBatchAnnotateFilesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchAnnotateFilesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateFilesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchAnnotateFilesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.annotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkBatchAnnotateFilesResponse( |
| response as api.BatchAnnotateFilesResponse, |
| ); |
| }); |
| |
| unittest.test('method--asyncBatchAnnotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.files; |
| final arg_request = buildAsyncBatchAnnotateFilesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AsyncBatchAnnotateFilesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateFilesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.asyncBatchAnnotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsImagesResource', () { |
| unittest.test('method--annotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.images; |
| final arg_request = buildBatchAnnotateImagesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchAnnotateImagesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateImagesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchAnnotateImagesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.annotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkBatchAnnotateImagesResponse( |
| response as api.BatchAnnotateImagesResponse, |
| ); |
| }); |
| |
| unittest.test('method--asyncBatchAnnotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.images; |
| final arg_request = buildAsyncBatchAnnotateImagesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AsyncBatchAnnotateImagesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateImagesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.asyncBatchAnnotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsFilesResource', () { |
| unittest.test('method--annotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.files; |
| final arg_request = buildBatchAnnotateFilesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchAnnotateFilesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateFilesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchAnnotateFilesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.annotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkBatchAnnotateFilesResponse( |
| response as api.BatchAnnotateFilesResponse, |
| ); |
| }); |
| |
| unittest.test('method--asyncBatchAnnotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.files; |
| final arg_request = buildAsyncBatchAnnotateFilesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AsyncBatchAnnotateFilesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateFilesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.asyncBatchAnnotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsImagesResource', () { |
| unittest.test('method--annotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.images; |
| final arg_request = buildBatchAnnotateImagesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.BatchAnnotateImagesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkBatchAnnotateImagesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildBatchAnnotateImagesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.annotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkBatchAnnotateImagesResponse( |
| response as api.BatchAnnotateImagesResponse, |
| ); |
| }); |
| |
| unittest.test('method--asyncBatchAnnotate', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.images; |
| final arg_request = buildAsyncBatchAnnotateImagesRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AsyncBatchAnnotateImagesRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAsyncBatchAnnotateImagesRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.asyncBatchAnnotate( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsOperationsResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsProductSetsResource', () { |
| unittest.test('method--addProduct', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_request = buildAddProductToProductSetRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.AddProductToProductSetRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkAddProductToProductSetRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.addProduct( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--create', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_request = buildProductSet(); |
| final arg_parent = 'foo'; |
| final arg_productSetId = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.ProductSet.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkProductSet(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['productSetId']!.first, |
| unittest.equals(arg_productSetId), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildProductSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.create( |
| arg_request, |
| arg_parent, |
| productSetId: arg_productSetId, |
| $fields: arg_$fields, |
| ); |
| checkProductSet(response as api.ProductSet); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildProductSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkProductSet(response as api.ProductSet); |
| }); |
| |
| unittest.test('method--import', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_request = buildImportProductSetsRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.ImportProductSetsRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkImportProductSetsRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.import( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_parent = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildListProductSetsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields, |
| ); |
| checkListProductSetsResponse(response as api.ListProductSetsResponse); |
| }); |
| |
| unittest.test('method--patch', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_request = buildProductSet(); |
| final arg_name = 'foo'; |
| final arg_updateMask = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.ProductSet.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkProductSet(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['updateMask']!.first, |
| unittest.equals(arg_updateMask), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildProductSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.patch( |
| arg_request, |
| arg_name, |
| updateMask: arg_updateMask, |
| $fields: arg_$fields, |
| ); |
| checkProductSet(response as api.ProductSet); |
| }); |
| |
| unittest.test('method--removeProduct', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets; |
| final arg_request = buildRemoveProductFromProductSetRequest(); |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.RemoveProductFromProductSetRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkRemoveProductFromProductSetRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.removeProduct( |
| arg_request, |
| arg_name, |
| $fields: arg_$fields, |
| ); |
| checkEmpty(response as api.Empty); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsProductSetsProductsResource', () { |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.productSets.products; |
| final arg_name = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode( |
| buildListProductsInProductSetResponse(), |
| ); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| arg_name, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields, |
| ); |
| checkListProductsInProductSetResponse( |
| response as api.ListProductsInProductSetResponse, |
| ); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsProductsResource', () { |
| unittest.test('method--create', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.products; |
| final arg_request = buildProduct(); |
| final arg_parent = 'foo'; |
| final arg_productId = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.Product.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkProduct(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['productId']!.first, |
| unittest.equals(arg_productId), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildProduct()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.create( |
| arg_request, |
| arg_parent, |
| productId: arg_productId, |
| $fields: arg_$fields, |
| ); |
| checkProduct(response as api.Product); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.products; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.products; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildProduct()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkProduct(response as api.Product); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.products; |
| final arg_parent = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildListProductsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields, |
| ); |
| checkListProductsResponse(response as api.ListProductsResponse); |
| }); |
| |
| unittest.test('method--patch', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.products; |
| final arg_request = buildProduct(); |
| final arg_name = 'foo'; |
| final arg_updateMask = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.Product.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkProduct(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['updateMask']!.first, |
| unittest.equals(arg_updateMask), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildProduct()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.patch( |
| arg_request, |
| arg_name, |
| updateMask: arg_updateMask, |
| $fields: arg_$fields, |
| ); |
| checkProduct(response as api.Product); |
| }); |
| |
| unittest.test('method--purge', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.locations.products; |
| final arg_request = buildPurgeProductsRequest(); |
| final arg_parent = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.PurgeProductsRequest.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkPurgeProductsRequest(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.purge( |
| arg_request, |
| arg_parent, |
| $fields: arg_$fields, |
| ); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsLocationsProductsReferenceImagesResource', () { |
| unittest.test('method--create', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi( |
| mock, |
| ).projects.locations.products.referenceImages; |
| final arg_request = buildReferenceImage(); |
| final arg_parent = 'foo'; |
| final arg_referenceImageId = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final obj = api.ReferenceImage.fromJson( |
| json as core.Map<core.String, core.dynamic>, |
| ); |
| checkReferenceImage(obj); |
| |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['referenceImageId']!.first, |
| unittest.equals(arg_referenceImageId), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildReferenceImage()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.create( |
| arg_request, |
| arg_parent, |
| referenceImageId: arg_referenceImageId, |
| $fields: arg_$fields, |
| ); |
| checkReferenceImage(response as api.ReferenceImage); |
| }); |
| |
| unittest.test('method--delete', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi( |
| mock, |
| ).projects.locations.products.referenceImages; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.delete(arg_name, $fields: arg_$fields); |
| checkEmpty(response as api.Empty); |
| }); |
| |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi( |
| mock, |
| ).projects.locations.products.referenceImages; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildReferenceImage()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkReferenceImage(response as api.ReferenceImage); |
| }); |
| |
| unittest.test('method--list', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi( |
| mock, |
| ).projects.locations.products.referenceImages; |
| final arg_parent = 'foo'; |
| final arg_pageSize = 42; |
| final arg_pageToken = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| core.int.parse(queryMap['pageSize']!.first), |
| unittest.equals(arg_pageSize), |
| ); |
| unittest.expect( |
| queryMap['pageToken']!.first, |
| unittest.equals(arg_pageToken), |
| ); |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildListReferenceImagesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.list( |
| arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields, |
| ); |
| checkListReferenceImagesResponse( |
| response as api.ListReferenceImagesResponse, |
| ); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsOperationsResource', () { |
| unittest.test('method--get', () async { |
| final mock = HttpServerMock(); |
| final res = api.VisionApi(mock).projects.operations; |
| final arg_name = 'foo'; |
| final arg_$fields = 'foo'; |
| mock.register( |
| unittest.expectAsync2((http.BaseRequest req, json) { |
| final path = req.url.path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), |
| unittest.equals('/'), |
| ); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), |
| unittest.equals('v1/'), |
| ); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| final query = req.url.query; |
| var queryOffset = 0; |
| final queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(core.String n, core.String v) => |
| queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| final keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap['fields']!.first, |
| unittest.equals(arg_$fields), |
| ); |
| |
| final h = {'content-type': 'application/json; charset=utf-8'}; |
| final resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), |
| true, |
| ); |
| final response = await res.get(arg_name, $fields: arg_$fields); |
| checkOperation(response as api.Operation); |
| }); |
| }); |
| } |