| library googleapis.dataproc.v1.test; |
| |
| import "dart:core" as core; |
| import "dart:async" as async; |
| import "dart:convert" as convert; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import 'package:googleapis/dataproc/v1.dart' as api; |
| |
| class HttpServerMock extends http.BaseClient { |
| core.Function _callback; |
| core.bool _expectJson; |
| |
| void register(core.Function callback, core.bool expectJson) { |
| _callback = callback; |
| _expectJson = expectJson; |
| } |
| |
| async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| if (_expectJson) { |
| return request |
| .finalize() |
| .transform(convert.utf8.decoder) |
| .join('') |
| .then((core.String jsonString) { |
| if (jsonString.isEmpty) { |
| return _callback(request, null); |
| } else { |
| return _callback(request, convert.json.decode(jsonString)); |
| } |
| }); |
| } else { |
| var stream = request.finalize(); |
| if (stream == null) { |
| return _callback(request, []); |
| } else { |
| return stream.toBytes().then((data) { |
| return _callback(request, data); |
| }); |
| } |
| } |
| } |
| } |
| |
| http.StreamedResponse stringResponse(core.int status, |
| core.Map<core.String, core.String> headers, core.String body) { |
| var stream = new async.Stream.fromIterable([convert.utf8.encode(body)]); |
| return new http.StreamedResponse(stream, status, headers: headers); |
| } |
| |
| core.int buildCounterAcceleratorConfig = 0; |
| buildAcceleratorConfig() { |
| var o = new api.AcceleratorConfig(); |
| buildCounterAcceleratorConfig++; |
| if (buildCounterAcceleratorConfig < 3) { |
| o.acceleratorCount = 42; |
| o.acceleratorTypeUri = "foo"; |
| } |
| buildCounterAcceleratorConfig--; |
| return o; |
| } |
| |
| checkAcceleratorConfig(api.AcceleratorConfig o) { |
| buildCounterAcceleratorConfig++; |
| if (buildCounterAcceleratorConfig < 3) { |
| unittest.expect(o.acceleratorCount, unittest.equals(42)); |
| unittest.expect(o.acceleratorTypeUri, unittest.equals('foo')); |
| } |
| buildCounterAcceleratorConfig--; |
| } |
| |
| core.int buildCounterAutoscalingConfig = 0; |
| buildAutoscalingConfig() { |
| var o = new api.AutoscalingConfig(); |
| buildCounterAutoscalingConfig++; |
| if (buildCounterAutoscalingConfig < 3) { |
| o.policyUri = "foo"; |
| } |
| buildCounterAutoscalingConfig--; |
| return o; |
| } |
| |
| checkAutoscalingConfig(api.AutoscalingConfig o) { |
| buildCounterAutoscalingConfig++; |
| if (buildCounterAutoscalingConfig < 3) { |
| unittest.expect(o.policyUri, unittest.equals('foo')); |
| } |
| buildCounterAutoscalingConfig--; |
| } |
| |
| core.int buildCounterAutoscalingPolicy = 0; |
| buildAutoscalingPolicy() { |
| var o = new api.AutoscalingPolicy(); |
| buildCounterAutoscalingPolicy++; |
| if (buildCounterAutoscalingPolicy < 3) { |
| o.basicAlgorithm = buildBasicAutoscalingAlgorithm(); |
| o.id = "foo"; |
| o.name = "foo"; |
| o.secondaryWorkerConfig = buildInstanceGroupAutoscalingPolicyConfig(); |
| o.workerConfig = buildInstanceGroupAutoscalingPolicyConfig(); |
| } |
| buildCounterAutoscalingPolicy--; |
| return o; |
| } |
| |
| checkAutoscalingPolicy(api.AutoscalingPolicy o) { |
| buildCounterAutoscalingPolicy++; |
| if (buildCounterAutoscalingPolicy < 3) { |
| checkBasicAutoscalingAlgorithm(o.basicAlgorithm); |
| unittest.expect(o.id, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkInstanceGroupAutoscalingPolicyConfig(o.secondaryWorkerConfig); |
| checkInstanceGroupAutoscalingPolicyConfig(o.workerConfig); |
| } |
| buildCounterAutoscalingPolicy--; |
| } |
| |
| core.int buildCounterBasicAutoscalingAlgorithm = 0; |
| buildBasicAutoscalingAlgorithm() { |
| var o = new api.BasicAutoscalingAlgorithm(); |
| buildCounterBasicAutoscalingAlgorithm++; |
| if (buildCounterBasicAutoscalingAlgorithm < 3) { |
| o.cooldownPeriod = "foo"; |
| o.yarnConfig = buildBasicYarnAutoscalingConfig(); |
| } |
| buildCounterBasicAutoscalingAlgorithm--; |
| return o; |
| } |
| |
| checkBasicAutoscalingAlgorithm(api.BasicAutoscalingAlgorithm o) { |
| buildCounterBasicAutoscalingAlgorithm++; |
| if (buildCounterBasicAutoscalingAlgorithm < 3) { |
| unittest.expect(o.cooldownPeriod, unittest.equals('foo')); |
| checkBasicYarnAutoscalingConfig(o.yarnConfig); |
| } |
| buildCounterBasicAutoscalingAlgorithm--; |
| } |
| |
| core.int buildCounterBasicYarnAutoscalingConfig = 0; |
| buildBasicYarnAutoscalingConfig() { |
| var o = new api.BasicYarnAutoscalingConfig(); |
| buildCounterBasicYarnAutoscalingConfig++; |
| if (buildCounterBasicYarnAutoscalingConfig < 3) { |
| o.gracefulDecommissionTimeout = "foo"; |
| o.scaleDownFactor = 42.0; |
| o.scaleDownMinWorkerFraction = 42.0; |
| o.scaleUpFactor = 42.0; |
| o.scaleUpMinWorkerFraction = 42.0; |
| } |
| buildCounterBasicYarnAutoscalingConfig--; |
| return o; |
| } |
| |
| checkBasicYarnAutoscalingConfig(api.BasicYarnAutoscalingConfig o) { |
| buildCounterBasicYarnAutoscalingConfig++; |
| if (buildCounterBasicYarnAutoscalingConfig < 3) { |
| unittest.expect(o.gracefulDecommissionTimeout, unittest.equals('foo')); |
| unittest.expect(o.scaleDownFactor, unittest.equals(42.0)); |
| unittest.expect(o.scaleDownMinWorkerFraction, unittest.equals(42.0)); |
| unittest.expect(o.scaleUpFactor, unittest.equals(42.0)); |
| unittest.expect(o.scaleUpMinWorkerFraction, unittest.equals(42.0)); |
| } |
| buildCounterBasicYarnAutoscalingConfig--; |
| } |
| |
| buildUnnamed613() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed613(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 buildCounterBinding = 0; |
| buildBinding() { |
| var o = new api.Binding(); |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| o.condition = buildExpr(); |
| o.members = buildUnnamed613(); |
| o.role = "foo"; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| checkExpr(o.condition); |
| checkUnnamed613(o.members); |
| unittest.expect(o.role, unittest.equals('foo')); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.int buildCounterCancelJobRequest = 0; |
| buildCancelJobRequest() { |
| var o = new api.CancelJobRequest(); |
| buildCounterCancelJobRequest++; |
| if (buildCounterCancelJobRequest < 3) {} |
| buildCounterCancelJobRequest--; |
| return o; |
| } |
| |
| checkCancelJobRequest(api.CancelJobRequest o) { |
| buildCounterCancelJobRequest++; |
| if (buildCounterCancelJobRequest < 3) {} |
| buildCounterCancelJobRequest--; |
| } |
| |
| buildUnnamed614() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed614(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')); |
| } |
| |
| buildUnnamed615() { |
| var o = new core.List<api.ClusterStatus>(); |
| o.add(buildClusterStatus()); |
| o.add(buildClusterStatus()); |
| return o; |
| } |
| |
| checkUnnamed615(core.List<api.ClusterStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkClusterStatus(o[0]); |
| checkClusterStatus(o[1]); |
| } |
| |
| core.int buildCounterCluster = 0; |
| buildCluster() { |
| var o = new api.Cluster(); |
| buildCounterCluster++; |
| if (buildCounterCluster < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| o.config = buildClusterConfig(); |
| o.labels = buildUnnamed614(); |
| o.metrics = buildClusterMetrics(); |
| o.projectId = "foo"; |
| o.status = buildClusterStatus(); |
| o.statusHistory = buildUnnamed615(); |
| } |
| buildCounterCluster--; |
| return o; |
| } |
| |
| checkCluster(api.Cluster o) { |
| buildCounterCluster++; |
| if (buildCounterCluster < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| checkClusterConfig(o.config); |
| checkUnnamed614(o.labels); |
| checkClusterMetrics(o.metrics); |
| unittest.expect(o.projectId, unittest.equals('foo')); |
| checkClusterStatus(o.status); |
| checkUnnamed615(o.statusHistory); |
| } |
| buildCounterCluster--; |
| } |
| |
| buildUnnamed616() { |
| var o = new core.List<api.NodeInitializationAction>(); |
| o.add(buildNodeInitializationAction()); |
| o.add(buildNodeInitializationAction()); |
| return o; |
| } |
| |
| checkUnnamed616(core.List<api.NodeInitializationAction> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkNodeInitializationAction(o[0]); |
| checkNodeInitializationAction(o[1]); |
| } |
| |
| core.int buildCounterClusterConfig = 0; |
| buildClusterConfig() { |
| var o = new api.ClusterConfig(); |
| buildCounterClusterConfig++; |
| if (buildCounterClusterConfig < 3) { |
| o.autoscalingConfig = buildAutoscalingConfig(); |
| o.configBucket = "foo"; |
| o.encryptionConfig = buildEncryptionConfig(); |
| o.gceClusterConfig = buildGceClusterConfig(); |
| o.initializationActions = buildUnnamed616(); |
| o.lifecycleConfig = buildLifecycleConfig(); |
| o.masterConfig = buildInstanceGroupConfig(); |
| o.secondaryWorkerConfig = buildInstanceGroupConfig(); |
| o.securityConfig = buildSecurityConfig(); |
| o.softwareConfig = buildSoftwareConfig(); |
| o.workerConfig = buildInstanceGroupConfig(); |
| } |
| buildCounterClusterConfig--; |
| return o; |
| } |
| |
| checkClusterConfig(api.ClusterConfig o) { |
| buildCounterClusterConfig++; |
| if (buildCounterClusterConfig < 3) { |
| checkAutoscalingConfig(o.autoscalingConfig); |
| unittest.expect(o.configBucket, unittest.equals('foo')); |
| checkEncryptionConfig(o.encryptionConfig); |
| checkGceClusterConfig(o.gceClusterConfig); |
| checkUnnamed616(o.initializationActions); |
| checkLifecycleConfig(o.lifecycleConfig); |
| checkInstanceGroupConfig(o.masterConfig); |
| checkInstanceGroupConfig(o.secondaryWorkerConfig); |
| checkSecurityConfig(o.securityConfig); |
| checkSoftwareConfig(o.softwareConfig); |
| checkInstanceGroupConfig(o.workerConfig); |
| } |
| buildCounterClusterConfig--; |
| } |
| |
| buildUnnamed617() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed617(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')); |
| } |
| |
| buildUnnamed618() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed618(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.int buildCounterClusterMetrics = 0; |
| buildClusterMetrics() { |
| var o = new api.ClusterMetrics(); |
| buildCounterClusterMetrics++; |
| if (buildCounterClusterMetrics < 3) { |
| o.hdfsMetrics = buildUnnamed617(); |
| o.yarnMetrics = buildUnnamed618(); |
| } |
| buildCounterClusterMetrics--; |
| return o; |
| } |
| |
| checkClusterMetrics(api.ClusterMetrics o) { |
| buildCounterClusterMetrics++; |
| if (buildCounterClusterMetrics < 3) { |
| checkUnnamed617(o.hdfsMetrics); |
| checkUnnamed618(o.yarnMetrics); |
| } |
| buildCounterClusterMetrics--; |
| } |
| |
| core.int buildCounterClusterOperation = 0; |
| buildClusterOperation() { |
| var o = new api.ClusterOperation(); |
| buildCounterClusterOperation++; |
| if (buildCounterClusterOperation < 3) { |
| o.done = true; |
| o.error = "foo"; |
| o.operationId = "foo"; |
| } |
| buildCounterClusterOperation--; |
| return o; |
| } |
| |
| checkClusterOperation(api.ClusterOperation o) { |
| buildCounterClusterOperation++; |
| if (buildCounterClusterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| unittest.expect(o.error, unittest.equals('foo')); |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| } |
| buildCounterClusterOperation--; |
| } |
| |
| buildUnnamed619() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed619(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')); |
| } |
| |
| buildUnnamed620() { |
| var o = new core.List<api.ClusterOperationStatus>(); |
| o.add(buildClusterOperationStatus()); |
| o.add(buildClusterOperationStatus()); |
| return o; |
| } |
| |
| checkUnnamed620(core.List<api.ClusterOperationStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkClusterOperationStatus(o[0]); |
| checkClusterOperationStatus(o[1]); |
| } |
| |
| buildUnnamed621() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed621(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 buildCounterClusterOperationMetadata = 0; |
| buildClusterOperationMetadata() { |
| var o = new api.ClusterOperationMetadata(); |
| buildCounterClusterOperationMetadata++; |
| if (buildCounterClusterOperationMetadata < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| o.description = "foo"; |
| o.labels = buildUnnamed619(); |
| o.operationType = "foo"; |
| o.status = buildClusterOperationStatus(); |
| o.statusHistory = buildUnnamed620(); |
| o.warnings = buildUnnamed621(); |
| } |
| buildCounterClusterOperationMetadata--; |
| return o; |
| } |
| |
| checkClusterOperationMetadata(api.ClusterOperationMetadata o) { |
| buildCounterClusterOperationMetadata++; |
| if (buildCounterClusterOperationMetadata < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| unittest.expect(o.description, unittest.equals('foo')); |
| checkUnnamed619(o.labels); |
| unittest.expect(o.operationType, unittest.equals('foo')); |
| checkClusterOperationStatus(o.status); |
| checkUnnamed620(o.statusHistory); |
| checkUnnamed621(o.warnings); |
| } |
| buildCounterClusterOperationMetadata--; |
| } |
| |
| core.int buildCounterClusterOperationStatus = 0; |
| buildClusterOperationStatus() { |
| var o = new api.ClusterOperationStatus(); |
| buildCounterClusterOperationStatus++; |
| if (buildCounterClusterOperationStatus < 3) { |
| o.details = "foo"; |
| o.innerState = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| } |
| buildCounterClusterOperationStatus--; |
| return o; |
| } |
| |
| checkClusterOperationStatus(api.ClusterOperationStatus o) { |
| buildCounterClusterOperationStatus++; |
| if (buildCounterClusterOperationStatus < 3) { |
| unittest.expect(o.details, unittest.equals('foo')); |
| unittest.expect(o.innerState, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| } |
| buildCounterClusterOperationStatus--; |
| } |
| |
| buildUnnamed622() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed622(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.int buildCounterClusterSelector = 0; |
| buildClusterSelector() { |
| var o = new api.ClusterSelector(); |
| buildCounterClusterSelector++; |
| if (buildCounterClusterSelector < 3) { |
| o.clusterLabels = buildUnnamed622(); |
| o.zone = "foo"; |
| } |
| buildCounterClusterSelector--; |
| return o; |
| } |
| |
| checkClusterSelector(api.ClusterSelector o) { |
| buildCounterClusterSelector++; |
| if (buildCounterClusterSelector < 3) { |
| checkUnnamed622(o.clusterLabels); |
| unittest.expect(o.zone, unittest.equals('foo')); |
| } |
| buildCounterClusterSelector--; |
| } |
| |
| core.int buildCounterClusterStatus = 0; |
| buildClusterStatus() { |
| var o = new api.ClusterStatus(); |
| buildCounterClusterStatus++; |
| if (buildCounterClusterStatus < 3) { |
| o.detail = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| o.substate = "foo"; |
| } |
| buildCounterClusterStatus--; |
| return o; |
| } |
| |
| checkClusterStatus(api.ClusterStatus o) { |
| buildCounterClusterStatus++; |
| if (buildCounterClusterStatus < 3) { |
| unittest.expect(o.detail, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| unittest.expect(o.substate, unittest.equals('foo')); |
| } |
| buildCounterClusterStatus--; |
| } |
| |
| core.int buildCounterDiagnoseClusterRequest = 0; |
| buildDiagnoseClusterRequest() { |
| var o = new api.DiagnoseClusterRequest(); |
| buildCounterDiagnoseClusterRequest++; |
| if (buildCounterDiagnoseClusterRequest < 3) {} |
| buildCounterDiagnoseClusterRequest--; |
| return o; |
| } |
| |
| checkDiagnoseClusterRequest(api.DiagnoseClusterRequest o) { |
| buildCounterDiagnoseClusterRequest++; |
| if (buildCounterDiagnoseClusterRequest < 3) {} |
| buildCounterDiagnoseClusterRequest--; |
| } |
| |
| core.int buildCounterDiagnoseClusterResults = 0; |
| buildDiagnoseClusterResults() { |
| var o = new api.DiagnoseClusterResults(); |
| buildCounterDiagnoseClusterResults++; |
| if (buildCounterDiagnoseClusterResults < 3) { |
| o.outputUri = "foo"; |
| } |
| buildCounterDiagnoseClusterResults--; |
| return o; |
| } |
| |
| checkDiagnoseClusterResults(api.DiagnoseClusterResults o) { |
| buildCounterDiagnoseClusterResults++; |
| if (buildCounterDiagnoseClusterResults < 3) { |
| unittest.expect(o.outputUri, unittest.equals('foo')); |
| } |
| buildCounterDiagnoseClusterResults--; |
| } |
| |
| core.int buildCounterDiskConfig = 0; |
| buildDiskConfig() { |
| var o = new api.DiskConfig(); |
| buildCounterDiskConfig++; |
| if (buildCounterDiskConfig < 3) { |
| o.bootDiskSizeGb = 42; |
| o.bootDiskType = "foo"; |
| o.numLocalSsds = 42; |
| } |
| buildCounterDiskConfig--; |
| return o; |
| } |
| |
| checkDiskConfig(api.DiskConfig o) { |
| buildCounterDiskConfig++; |
| if (buildCounterDiskConfig < 3) { |
| unittest.expect(o.bootDiskSizeGb, unittest.equals(42)); |
| unittest.expect(o.bootDiskType, unittest.equals('foo')); |
| unittest.expect(o.numLocalSsds, unittest.equals(42)); |
| } |
| buildCounterDiskConfig--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| buildEmpty() { |
| var o = new api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.int buildCounterEncryptionConfig = 0; |
| buildEncryptionConfig() { |
| var o = new api.EncryptionConfig(); |
| buildCounterEncryptionConfig++; |
| if (buildCounterEncryptionConfig < 3) { |
| o.gcePdKmsKeyName = "foo"; |
| } |
| buildCounterEncryptionConfig--; |
| return o; |
| } |
| |
| checkEncryptionConfig(api.EncryptionConfig o) { |
| buildCounterEncryptionConfig++; |
| if (buildCounterEncryptionConfig < 3) { |
| unittest.expect(o.gcePdKmsKeyName, unittest.equals('foo')); |
| } |
| buildCounterEncryptionConfig--; |
| } |
| |
| core.int buildCounterExpr = 0; |
| buildExpr() { |
| var o = new api.Expr(); |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| o.description = "foo"; |
| o.expression = "foo"; |
| o.location = "foo"; |
| o.title = "foo"; |
| } |
| buildCounterExpr--; |
| return o; |
| } |
| |
| checkExpr(api.Expr o) { |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.expression, unittest.equals('foo')); |
| unittest.expect(o.location, unittest.equals('foo')); |
| unittest.expect(o.title, unittest.equals('foo')); |
| } |
| buildCounterExpr--; |
| } |
| |
| buildUnnamed623() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed623(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')); |
| } |
| |
| buildUnnamed624() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed624(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')); |
| } |
| |
| buildUnnamed625() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed625(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 buildCounterGceClusterConfig = 0; |
| buildGceClusterConfig() { |
| var o = new api.GceClusterConfig(); |
| buildCounterGceClusterConfig++; |
| if (buildCounterGceClusterConfig < 3) { |
| o.internalIpOnly = true; |
| o.metadata = buildUnnamed623(); |
| o.networkUri = "foo"; |
| o.reservationAffinity = buildReservationAffinity(); |
| o.serviceAccount = "foo"; |
| o.serviceAccountScopes = buildUnnamed624(); |
| o.subnetworkUri = "foo"; |
| o.tags = buildUnnamed625(); |
| o.zoneUri = "foo"; |
| } |
| buildCounterGceClusterConfig--; |
| return o; |
| } |
| |
| checkGceClusterConfig(api.GceClusterConfig o) { |
| buildCounterGceClusterConfig++; |
| if (buildCounterGceClusterConfig < 3) { |
| unittest.expect(o.internalIpOnly, unittest.isTrue); |
| checkUnnamed623(o.metadata); |
| unittest.expect(o.networkUri, unittest.equals('foo')); |
| checkReservationAffinity(o.reservationAffinity); |
| unittest.expect(o.serviceAccount, unittest.equals('foo')); |
| checkUnnamed624(o.serviceAccountScopes); |
| unittest.expect(o.subnetworkUri, unittest.equals('foo')); |
| checkUnnamed625(o.tags); |
| unittest.expect(o.zoneUri, unittest.equals('foo')); |
| } |
| buildCounterGceClusterConfig--; |
| } |
| |
| core.int buildCounterGetIamPolicyRequest = 0; |
| buildGetIamPolicyRequest() { |
| var o = new api.GetIamPolicyRequest(); |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| o.options = buildGetPolicyOptions(); |
| } |
| buildCounterGetIamPolicyRequest--; |
| return o; |
| } |
| |
| checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| checkGetPolicyOptions(o.options); |
| } |
| buildCounterGetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterGetPolicyOptions = 0; |
| buildGetPolicyOptions() { |
| var o = new api.GetPolicyOptions(); |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| o.requestedPolicyVersion = 42; |
| } |
| buildCounterGetPolicyOptions--; |
| return o; |
| } |
| |
| checkGetPolicyOptions(api.GetPolicyOptions o) { |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| unittest.expect(o.requestedPolicyVersion, unittest.equals(42)); |
| } |
| buildCounterGetPolicyOptions--; |
| } |
| |
| buildUnnamed626() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed626(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')); |
| } |
| |
| buildUnnamed627() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed627(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')); |
| } |
| |
| buildUnnamed628() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed628(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')); |
| } |
| |
| buildUnnamed629() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed629(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')); |
| } |
| |
| buildUnnamed630() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed630(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.int buildCounterHadoopJob = 0; |
| buildHadoopJob() { |
| var o = new api.HadoopJob(); |
| buildCounterHadoopJob++; |
| if (buildCounterHadoopJob < 3) { |
| o.archiveUris = buildUnnamed626(); |
| o.args = buildUnnamed627(); |
| o.fileUris = buildUnnamed628(); |
| o.jarFileUris = buildUnnamed629(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainClass = "foo"; |
| o.mainJarFileUri = "foo"; |
| o.properties = buildUnnamed630(); |
| } |
| buildCounterHadoopJob--; |
| return o; |
| } |
| |
| checkHadoopJob(api.HadoopJob o) { |
| buildCounterHadoopJob++; |
| if (buildCounterHadoopJob < 3) { |
| checkUnnamed626(o.archiveUris); |
| checkUnnamed627(o.args); |
| checkUnnamed628(o.fileUris); |
| checkUnnamed629(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainClass, unittest.equals('foo')); |
| unittest.expect(o.mainJarFileUri, unittest.equals('foo')); |
| checkUnnamed630(o.properties); |
| } |
| buildCounterHadoopJob--; |
| } |
| |
| buildUnnamed631() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed631(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')); |
| } |
| |
| buildUnnamed632() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed632(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')); |
| } |
| |
| buildUnnamed633() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed633(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.int buildCounterHiveJob = 0; |
| buildHiveJob() { |
| var o = new api.HiveJob(); |
| buildCounterHiveJob++; |
| if (buildCounterHiveJob < 3) { |
| o.continueOnFailure = true; |
| o.jarFileUris = buildUnnamed631(); |
| o.properties = buildUnnamed632(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| o.scriptVariables = buildUnnamed633(); |
| } |
| buildCounterHiveJob--; |
| return o; |
| } |
| |
| checkHiveJob(api.HiveJob o) { |
| buildCounterHiveJob++; |
| if (buildCounterHiveJob < 3) { |
| unittest.expect(o.continueOnFailure, unittest.isTrue); |
| checkUnnamed631(o.jarFileUris); |
| checkUnnamed632(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| checkUnnamed633(o.scriptVariables); |
| } |
| buildCounterHiveJob--; |
| } |
| |
| core.int buildCounterInstanceGroupAutoscalingPolicyConfig = 0; |
| buildInstanceGroupAutoscalingPolicyConfig() { |
| var o = new api.InstanceGroupAutoscalingPolicyConfig(); |
| buildCounterInstanceGroupAutoscalingPolicyConfig++; |
| if (buildCounterInstanceGroupAutoscalingPolicyConfig < 3) { |
| o.maxInstances = 42; |
| o.minInstances = 42; |
| o.weight = 42; |
| } |
| buildCounterInstanceGroupAutoscalingPolicyConfig--; |
| return o; |
| } |
| |
| checkInstanceGroupAutoscalingPolicyConfig( |
| api.InstanceGroupAutoscalingPolicyConfig o) { |
| buildCounterInstanceGroupAutoscalingPolicyConfig++; |
| if (buildCounterInstanceGroupAutoscalingPolicyConfig < 3) { |
| unittest.expect(o.maxInstances, unittest.equals(42)); |
| unittest.expect(o.minInstances, unittest.equals(42)); |
| unittest.expect(o.weight, unittest.equals(42)); |
| } |
| buildCounterInstanceGroupAutoscalingPolicyConfig--; |
| } |
| |
| buildUnnamed634() { |
| var o = new core.List<api.AcceleratorConfig>(); |
| o.add(buildAcceleratorConfig()); |
| o.add(buildAcceleratorConfig()); |
| return o; |
| } |
| |
| checkUnnamed634(core.List<api.AcceleratorConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAcceleratorConfig(o[0]); |
| checkAcceleratorConfig(o[1]); |
| } |
| |
| buildUnnamed635() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed635(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 buildCounterInstanceGroupConfig = 0; |
| buildInstanceGroupConfig() { |
| var o = new api.InstanceGroupConfig(); |
| buildCounterInstanceGroupConfig++; |
| if (buildCounterInstanceGroupConfig < 3) { |
| o.accelerators = buildUnnamed634(); |
| o.diskConfig = buildDiskConfig(); |
| o.imageUri = "foo"; |
| o.instanceNames = buildUnnamed635(); |
| o.isPreemptible = true; |
| o.machineTypeUri = "foo"; |
| o.managedGroupConfig = buildManagedGroupConfig(); |
| o.minCpuPlatform = "foo"; |
| o.numInstances = 42; |
| o.preemptibility = "foo"; |
| } |
| buildCounterInstanceGroupConfig--; |
| return o; |
| } |
| |
| checkInstanceGroupConfig(api.InstanceGroupConfig o) { |
| buildCounterInstanceGroupConfig++; |
| if (buildCounterInstanceGroupConfig < 3) { |
| checkUnnamed634(o.accelerators); |
| checkDiskConfig(o.diskConfig); |
| unittest.expect(o.imageUri, unittest.equals('foo')); |
| checkUnnamed635(o.instanceNames); |
| unittest.expect(o.isPreemptible, unittest.isTrue); |
| unittest.expect(o.machineTypeUri, unittest.equals('foo')); |
| checkManagedGroupConfig(o.managedGroupConfig); |
| unittest.expect(o.minCpuPlatform, unittest.equals('foo')); |
| unittest.expect(o.numInstances, unittest.equals(42)); |
| unittest.expect(o.preemptibility, unittest.equals('foo')); |
| } |
| buildCounterInstanceGroupConfig--; |
| } |
| |
| buildUnnamed636() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed636(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.int buildCounterInstantiateWorkflowTemplateRequest = 0; |
| buildInstantiateWorkflowTemplateRequest() { |
| var o = new api.InstantiateWorkflowTemplateRequest(); |
| buildCounterInstantiateWorkflowTemplateRequest++; |
| if (buildCounterInstantiateWorkflowTemplateRequest < 3) { |
| o.parameters = buildUnnamed636(); |
| o.requestId = "foo"; |
| o.version = 42; |
| } |
| buildCounterInstantiateWorkflowTemplateRequest--; |
| return o; |
| } |
| |
| checkInstantiateWorkflowTemplateRequest( |
| api.InstantiateWorkflowTemplateRequest o) { |
| buildCounterInstantiateWorkflowTemplateRequest++; |
| if (buildCounterInstantiateWorkflowTemplateRequest < 3) { |
| checkUnnamed636(o.parameters); |
| unittest.expect(o.requestId, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterInstantiateWorkflowTemplateRequest--; |
| } |
| |
| buildUnnamed637() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed637(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')); |
| } |
| |
| buildUnnamed638() { |
| var o = new core.List<api.JobStatus>(); |
| o.add(buildJobStatus()); |
| o.add(buildJobStatus()); |
| return o; |
| } |
| |
| checkUnnamed638(core.List<api.JobStatus> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkJobStatus(o[0]); |
| checkJobStatus(o[1]); |
| } |
| |
| buildUnnamed639() { |
| var o = new core.List<api.YarnApplication>(); |
| o.add(buildYarnApplication()); |
| o.add(buildYarnApplication()); |
| return o; |
| } |
| |
| checkUnnamed639(core.List<api.YarnApplication> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkYarnApplication(o[0]); |
| checkYarnApplication(o[1]); |
| } |
| |
| core.int buildCounterJob = 0; |
| buildJob() { |
| var o = new api.Job(); |
| buildCounterJob++; |
| if (buildCounterJob < 3) { |
| o.done = true; |
| o.driverControlFilesUri = "foo"; |
| o.driverOutputResourceUri = "foo"; |
| o.hadoopJob = buildHadoopJob(); |
| o.hiveJob = buildHiveJob(); |
| o.jobUuid = "foo"; |
| o.labels = buildUnnamed637(); |
| o.pigJob = buildPigJob(); |
| o.placement = buildJobPlacement(); |
| o.prestoJob = buildPrestoJob(); |
| o.pysparkJob = buildPySparkJob(); |
| o.reference = buildJobReference(); |
| o.scheduling = buildJobScheduling(); |
| o.sparkJob = buildSparkJob(); |
| o.sparkRJob = buildSparkRJob(); |
| o.sparkSqlJob = buildSparkSqlJob(); |
| o.status = buildJobStatus(); |
| o.statusHistory = buildUnnamed638(); |
| o.yarnApplications = buildUnnamed639(); |
| } |
| buildCounterJob--; |
| return o; |
| } |
| |
| checkJob(api.Job o) { |
| buildCounterJob++; |
| if (buildCounterJob < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| unittest.expect(o.driverControlFilesUri, unittest.equals('foo')); |
| unittest.expect(o.driverOutputResourceUri, unittest.equals('foo')); |
| checkHadoopJob(o.hadoopJob); |
| checkHiveJob(o.hiveJob); |
| unittest.expect(o.jobUuid, unittest.equals('foo')); |
| checkUnnamed637(o.labels); |
| checkPigJob(o.pigJob); |
| checkJobPlacement(o.placement); |
| checkPrestoJob(o.prestoJob); |
| checkPySparkJob(o.pysparkJob); |
| checkJobReference(o.reference); |
| checkJobScheduling(o.scheduling); |
| checkSparkJob(o.sparkJob); |
| checkSparkRJob(o.sparkRJob); |
| checkSparkSqlJob(o.sparkSqlJob); |
| checkJobStatus(o.status); |
| checkUnnamed638(o.statusHistory); |
| checkUnnamed639(o.yarnApplications); |
| } |
| buildCounterJob--; |
| } |
| |
| core.int buildCounterJobMetadata = 0; |
| buildJobMetadata() { |
| var o = new api.JobMetadata(); |
| buildCounterJobMetadata++; |
| if (buildCounterJobMetadata < 3) { |
| o.jobId = "foo"; |
| o.operationType = "foo"; |
| o.startTime = "foo"; |
| o.status = buildJobStatus(); |
| } |
| buildCounterJobMetadata--; |
| return o; |
| } |
| |
| checkJobMetadata(api.JobMetadata o) { |
| buildCounterJobMetadata++; |
| if (buildCounterJobMetadata < 3) { |
| unittest.expect(o.jobId, unittest.equals('foo')); |
| unittest.expect(o.operationType, unittest.equals('foo')); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| checkJobStatus(o.status); |
| } |
| buildCounterJobMetadata--; |
| } |
| |
| core.int buildCounterJobPlacement = 0; |
| buildJobPlacement() { |
| var o = new api.JobPlacement(); |
| buildCounterJobPlacement++; |
| if (buildCounterJobPlacement < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| } |
| buildCounterJobPlacement--; |
| return o; |
| } |
| |
| checkJobPlacement(api.JobPlacement o) { |
| buildCounterJobPlacement++; |
| if (buildCounterJobPlacement < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| } |
| buildCounterJobPlacement--; |
| } |
| |
| core.int buildCounterJobReference = 0; |
| buildJobReference() { |
| var o = new api.JobReference(); |
| buildCounterJobReference++; |
| if (buildCounterJobReference < 3) { |
| o.jobId = "foo"; |
| o.projectId = "foo"; |
| } |
| buildCounterJobReference--; |
| return o; |
| } |
| |
| checkJobReference(api.JobReference o) { |
| buildCounterJobReference++; |
| if (buildCounterJobReference < 3) { |
| unittest.expect(o.jobId, unittest.equals('foo')); |
| unittest.expect(o.projectId, unittest.equals('foo')); |
| } |
| buildCounterJobReference--; |
| } |
| |
| core.int buildCounterJobScheduling = 0; |
| buildJobScheduling() { |
| var o = new api.JobScheduling(); |
| buildCounterJobScheduling++; |
| if (buildCounterJobScheduling < 3) { |
| o.maxFailuresPerHour = 42; |
| } |
| buildCounterJobScheduling--; |
| return o; |
| } |
| |
| checkJobScheduling(api.JobScheduling o) { |
| buildCounterJobScheduling++; |
| if (buildCounterJobScheduling < 3) { |
| unittest.expect(o.maxFailuresPerHour, unittest.equals(42)); |
| } |
| buildCounterJobScheduling--; |
| } |
| |
| core.int buildCounterJobStatus = 0; |
| buildJobStatus() { |
| var o = new api.JobStatus(); |
| buildCounterJobStatus++; |
| if (buildCounterJobStatus < 3) { |
| o.details = "foo"; |
| o.state = "foo"; |
| o.stateStartTime = "foo"; |
| o.substate = "foo"; |
| } |
| buildCounterJobStatus--; |
| return o; |
| } |
| |
| checkJobStatus(api.JobStatus o) { |
| buildCounterJobStatus++; |
| if (buildCounterJobStatus < 3) { |
| unittest.expect(o.details, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stateStartTime, unittest.equals('foo')); |
| unittest.expect(o.substate, unittest.equals('foo')); |
| } |
| buildCounterJobStatus--; |
| } |
| |
| core.int buildCounterKerberosConfig = 0; |
| buildKerberosConfig() { |
| var o = new api.KerberosConfig(); |
| buildCounterKerberosConfig++; |
| if (buildCounterKerberosConfig < 3) { |
| o.crossRealmTrustAdminServer = "foo"; |
| o.crossRealmTrustKdc = "foo"; |
| o.crossRealmTrustRealm = "foo"; |
| o.crossRealmTrustSharedPasswordUri = "foo"; |
| o.enableKerberos = true; |
| o.kdcDbKeyUri = "foo"; |
| o.keyPasswordUri = "foo"; |
| o.keystorePasswordUri = "foo"; |
| o.keystoreUri = "foo"; |
| o.kmsKeyUri = "foo"; |
| o.realm = "foo"; |
| o.rootPrincipalPasswordUri = "foo"; |
| o.tgtLifetimeHours = 42; |
| o.truststorePasswordUri = "foo"; |
| o.truststoreUri = "foo"; |
| } |
| buildCounterKerberosConfig--; |
| return o; |
| } |
| |
| checkKerberosConfig(api.KerberosConfig o) { |
| buildCounterKerberosConfig++; |
| if (buildCounterKerberosConfig < 3) { |
| unittest.expect(o.crossRealmTrustAdminServer, unittest.equals('foo')); |
| unittest.expect(o.crossRealmTrustKdc, unittest.equals('foo')); |
| unittest.expect(o.crossRealmTrustRealm, unittest.equals('foo')); |
| unittest.expect(o.crossRealmTrustSharedPasswordUri, unittest.equals('foo')); |
| unittest.expect(o.enableKerberos, unittest.isTrue); |
| unittest.expect(o.kdcDbKeyUri, unittest.equals('foo')); |
| unittest.expect(o.keyPasswordUri, unittest.equals('foo')); |
| unittest.expect(o.keystorePasswordUri, unittest.equals('foo')); |
| unittest.expect(o.keystoreUri, unittest.equals('foo')); |
| unittest.expect(o.kmsKeyUri, unittest.equals('foo')); |
| unittest.expect(o.realm, unittest.equals('foo')); |
| unittest.expect(o.rootPrincipalPasswordUri, unittest.equals('foo')); |
| unittest.expect(o.tgtLifetimeHours, unittest.equals(42)); |
| unittest.expect(o.truststorePasswordUri, unittest.equals('foo')); |
| unittest.expect(o.truststoreUri, unittest.equals('foo')); |
| } |
| buildCounterKerberosConfig--; |
| } |
| |
| core.int buildCounterLifecycleConfig = 0; |
| buildLifecycleConfig() { |
| var o = new api.LifecycleConfig(); |
| buildCounterLifecycleConfig++; |
| if (buildCounterLifecycleConfig < 3) { |
| o.autoDeleteTime = "foo"; |
| o.autoDeleteTtl = "foo"; |
| o.idleDeleteTtl = "foo"; |
| o.idleStartTime = "foo"; |
| } |
| buildCounterLifecycleConfig--; |
| return o; |
| } |
| |
| checkLifecycleConfig(api.LifecycleConfig o) { |
| buildCounterLifecycleConfig++; |
| if (buildCounterLifecycleConfig < 3) { |
| unittest.expect(o.autoDeleteTime, unittest.equals('foo')); |
| unittest.expect(o.autoDeleteTtl, unittest.equals('foo')); |
| unittest.expect(o.idleDeleteTtl, unittest.equals('foo')); |
| unittest.expect(o.idleStartTime, unittest.equals('foo')); |
| } |
| buildCounterLifecycleConfig--; |
| } |
| |
| buildUnnamed640() { |
| var o = new core.List<api.AutoscalingPolicy>(); |
| o.add(buildAutoscalingPolicy()); |
| o.add(buildAutoscalingPolicy()); |
| return o; |
| } |
| |
| checkUnnamed640(core.List<api.AutoscalingPolicy> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkAutoscalingPolicy(o[0]); |
| checkAutoscalingPolicy(o[1]); |
| } |
| |
| core.int buildCounterListAutoscalingPoliciesResponse = 0; |
| buildListAutoscalingPoliciesResponse() { |
| var o = new api.ListAutoscalingPoliciesResponse(); |
| buildCounterListAutoscalingPoliciesResponse++; |
| if (buildCounterListAutoscalingPoliciesResponse < 3) { |
| o.nextPageToken = "foo"; |
| o.policies = buildUnnamed640(); |
| } |
| buildCounterListAutoscalingPoliciesResponse--; |
| return o; |
| } |
| |
| checkListAutoscalingPoliciesResponse(api.ListAutoscalingPoliciesResponse o) { |
| buildCounterListAutoscalingPoliciesResponse++; |
| if (buildCounterListAutoscalingPoliciesResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed640(o.policies); |
| } |
| buildCounterListAutoscalingPoliciesResponse--; |
| } |
| |
| buildUnnamed641() { |
| var o = new core.List<api.Cluster>(); |
| o.add(buildCluster()); |
| o.add(buildCluster()); |
| return o; |
| } |
| |
| checkUnnamed641(core.List<api.Cluster> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkCluster(o[0]); |
| checkCluster(o[1]); |
| } |
| |
| core.int buildCounterListClustersResponse = 0; |
| buildListClustersResponse() { |
| var o = new api.ListClustersResponse(); |
| buildCounterListClustersResponse++; |
| if (buildCounterListClustersResponse < 3) { |
| o.clusters = buildUnnamed641(); |
| o.nextPageToken = "foo"; |
| } |
| buildCounterListClustersResponse--; |
| return o; |
| } |
| |
| checkListClustersResponse(api.ListClustersResponse o) { |
| buildCounterListClustersResponse++; |
| if (buildCounterListClustersResponse < 3) { |
| checkUnnamed641(o.clusters); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListClustersResponse--; |
| } |
| |
| buildUnnamed642() { |
| var o = new core.List<api.Job>(); |
| o.add(buildJob()); |
| o.add(buildJob()); |
| return o; |
| } |
| |
| checkUnnamed642(core.List<api.Job> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkJob(o[0]); |
| checkJob(o[1]); |
| } |
| |
| core.int buildCounterListJobsResponse = 0; |
| buildListJobsResponse() { |
| var o = new api.ListJobsResponse(); |
| buildCounterListJobsResponse++; |
| if (buildCounterListJobsResponse < 3) { |
| o.jobs = buildUnnamed642(); |
| o.nextPageToken = "foo"; |
| } |
| buildCounterListJobsResponse--; |
| return o; |
| } |
| |
| checkListJobsResponse(api.ListJobsResponse o) { |
| buildCounterListJobsResponse++; |
| if (buildCounterListJobsResponse < 3) { |
| checkUnnamed642(o.jobs); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListJobsResponse--; |
| } |
| |
| buildUnnamed643() { |
| var o = new core.List<api.Operation>(); |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| checkUnnamed643(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| buildListOperationsResponse() { |
| var o = new api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = "foo"; |
| o.operations = buildUnnamed643(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed643(o.operations); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| buildUnnamed644() { |
| var o = new core.List<api.WorkflowTemplate>(); |
| o.add(buildWorkflowTemplate()); |
| o.add(buildWorkflowTemplate()); |
| return o; |
| } |
| |
| checkUnnamed644(core.List<api.WorkflowTemplate> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWorkflowTemplate(o[0]); |
| checkWorkflowTemplate(o[1]); |
| } |
| |
| core.int buildCounterListWorkflowTemplatesResponse = 0; |
| buildListWorkflowTemplatesResponse() { |
| var o = new api.ListWorkflowTemplatesResponse(); |
| buildCounterListWorkflowTemplatesResponse++; |
| if (buildCounterListWorkflowTemplatesResponse < 3) { |
| o.nextPageToken = "foo"; |
| o.templates = buildUnnamed644(); |
| } |
| buildCounterListWorkflowTemplatesResponse--; |
| return o; |
| } |
| |
| checkListWorkflowTemplatesResponse(api.ListWorkflowTemplatesResponse o) { |
| buildCounterListWorkflowTemplatesResponse++; |
| if (buildCounterListWorkflowTemplatesResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed644(o.templates); |
| } |
| buildCounterListWorkflowTemplatesResponse--; |
| } |
| |
| buildUnnamed645() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed645(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.int buildCounterLoggingConfig = 0; |
| buildLoggingConfig() { |
| var o = new api.LoggingConfig(); |
| buildCounterLoggingConfig++; |
| if (buildCounterLoggingConfig < 3) { |
| o.driverLogLevels = buildUnnamed645(); |
| } |
| buildCounterLoggingConfig--; |
| return o; |
| } |
| |
| checkLoggingConfig(api.LoggingConfig o) { |
| buildCounterLoggingConfig++; |
| if (buildCounterLoggingConfig < 3) { |
| checkUnnamed645(o.driverLogLevels); |
| } |
| buildCounterLoggingConfig--; |
| } |
| |
| buildUnnamed646() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed646(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.int buildCounterManagedCluster = 0; |
| buildManagedCluster() { |
| var o = new api.ManagedCluster(); |
| buildCounterManagedCluster++; |
| if (buildCounterManagedCluster < 3) { |
| o.clusterName = "foo"; |
| o.config = buildClusterConfig(); |
| o.labels = buildUnnamed646(); |
| } |
| buildCounterManagedCluster--; |
| return o; |
| } |
| |
| checkManagedCluster(api.ManagedCluster o) { |
| buildCounterManagedCluster++; |
| if (buildCounterManagedCluster < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| checkClusterConfig(o.config); |
| checkUnnamed646(o.labels); |
| } |
| buildCounterManagedCluster--; |
| } |
| |
| core.int buildCounterManagedGroupConfig = 0; |
| buildManagedGroupConfig() { |
| var o = new api.ManagedGroupConfig(); |
| buildCounterManagedGroupConfig++; |
| if (buildCounterManagedGroupConfig < 3) { |
| o.instanceGroupManagerName = "foo"; |
| o.instanceTemplateName = "foo"; |
| } |
| buildCounterManagedGroupConfig--; |
| return o; |
| } |
| |
| checkManagedGroupConfig(api.ManagedGroupConfig o) { |
| buildCounterManagedGroupConfig++; |
| if (buildCounterManagedGroupConfig < 3) { |
| unittest.expect(o.instanceGroupManagerName, unittest.equals('foo')); |
| unittest.expect(o.instanceTemplateName, unittest.equals('foo')); |
| } |
| buildCounterManagedGroupConfig--; |
| } |
| |
| core.int buildCounterNodeInitializationAction = 0; |
| buildNodeInitializationAction() { |
| var o = new api.NodeInitializationAction(); |
| buildCounterNodeInitializationAction++; |
| if (buildCounterNodeInitializationAction < 3) { |
| o.executableFile = "foo"; |
| o.executionTimeout = "foo"; |
| } |
| buildCounterNodeInitializationAction--; |
| return o; |
| } |
| |
| checkNodeInitializationAction(api.NodeInitializationAction o) { |
| buildCounterNodeInitializationAction++; |
| if (buildCounterNodeInitializationAction < 3) { |
| unittest.expect(o.executableFile, unittest.equals('foo')); |
| unittest.expect(o.executionTimeout, unittest.equals('foo')); |
| } |
| buildCounterNodeInitializationAction--; |
| } |
| |
| buildUnnamed647() { |
| var o = new core.Map<core.String, core.Object>(); |
| o["x"] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o["y"] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| checkUnnamed647(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')); |
| } |
| |
| buildUnnamed648() { |
| var o = new core.Map<core.String, core.Object>(); |
| o["x"] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o["y"] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| checkUnnamed648(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; |
| buildOperation() { |
| var o = new api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed647(); |
| o.name = "foo"; |
| o.response = buildUnnamed648(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| checkStatus(o.error); |
| checkUnnamed647(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed648(o.response); |
| } |
| buildCounterOperation--; |
| } |
| |
| buildUnnamed649() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed649(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')); |
| } |
| |
| buildUnnamed650() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed650(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 buildCounterOrderedJob = 0; |
| buildOrderedJob() { |
| var o = new api.OrderedJob(); |
| buildCounterOrderedJob++; |
| if (buildCounterOrderedJob < 3) { |
| o.hadoopJob = buildHadoopJob(); |
| o.hiveJob = buildHiveJob(); |
| o.labels = buildUnnamed649(); |
| o.pigJob = buildPigJob(); |
| o.prerequisiteStepIds = buildUnnamed650(); |
| o.prestoJob = buildPrestoJob(); |
| o.pysparkJob = buildPySparkJob(); |
| o.scheduling = buildJobScheduling(); |
| o.sparkJob = buildSparkJob(); |
| o.sparkRJob = buildSparkRJob(); |
| o.sparkSqlJob = buildSparkSqlJob(); |
| o.stepId = "foo"; |
| } |
| buildCounterOrderedJob--; |
| return o; |
| } |
| |
| checkOrderedJob(api.OrderedJob o) { |
| buildCounterOrderedJob++; |
| if (buildCounterOrderedJob < 3) { |
| checkHadoopJob(o.hadoopJob); |
| checkHiveJob(o.hiveJob); |
| checkUnnamed649(o.labels); |
| checkPigJob(o.pigJob); |
| checkUnnamed650(o.prerequisiteStepIds); |
| checkPrestoJob(o.prestoJob); |
| checkPySparkJob(o.pysparkJob); |
| checkJobScheduling(o.scheduling); |
| checkSparkJob(o.sparkJob); |
| checkSparkRJob(o.sparkRJob); |
| checkSparkSqlJob(o.sparkSqlJob); |
| unittest.expect(o.stepId, unittest.equals('foo')); |
| } |
| buildCounterOrderedJob--; |
| } |
| |
| core.int buildCounterParameterValidation = 0; |
| buildParameterValidation() { |
| var o = new api.ParameterValidation(); |
| buildCounterParameterValidation++; |
| if (buildCounterParameterValidation < 3) { |
| o.regex = buildRegexValidation(); |
| o.values = buildValueValidation(); |
| } |
| buildCounterParameterValidation--; |
| return o; |
| } |
| |
| checkParameterValidation(api.ParameterValidation o) { |
| buildCounterParameterValidation++; |
| if (buildCounterParameterValidation < 3) { |
| checkRegexValidation(o.regex); |
| checkValueValidation(o.values); |
| } |
| buildCounterParameterValidation--; |
| } |
| |
| buildUnnamed651() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed651(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')); |
| } |
| |
| buildUnnamed652() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed652(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')); |
| } |
| |
| buildUnnamed653() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed653(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.int buildCounterPigJob = 0; |
| buildPigJob() { |
| var o = new api.PigJob(); |
| buildCounterPigJob++; |
| if (buildCounterPigJob < 3) { |
| o.continueOnFailure = true; |
| o.jarFileUris = buildUnnamed651(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.properties = buildUnnamed652(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| o.scriptVariables = buildUnnamed653(); |
| } |
| buildCounterPigJob--; |
| return o; |
| } |
| |
| checkPigJob(api.PigJob o) { |
| buildCounterPigJob++; |
| if (buildCounterPigJob < 3) { |
| unittest.expect(o.continueOnFailure, unittest.isTrue); |
| checkUnnamed651(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| checkUnnamed652(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| checkUnnamed653(o.scriptVariables); |
| } |
| buildCounterPigJob--; |
| } |
| |
| buildUnnamed654() { |
| var o = new core.List<api.Binding>(); |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| checkUnnamed654(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0]); |
| checkBinding(o[1]); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| buildPolicy() { |
| var o = new api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.bindings = buildUnnamed654(); |
| o.etag = "foo"; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed654(o.bindings); |
| unittest.expect(o.etag, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterPolicy--; |
| } |
| |
| buildUnnamed655() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed655(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')); |
| } |
| |
| buildUnnamed656() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed656(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.int buildCounterPrestoJob = 0; |
| buildPrestoJob() { |
| var o = new api.PrestoJob(); |
| buildCounterPrestoJob++; |
| if (buildCounterPrestoJob < 3) { |
| o.clientTags = buildUnnamed655(); |
| o.continueOnFailure = true; |
| o.loggingConfig = buildLoggingConfig(); |
| o.outputFormat = "foo"; |
| o.properties = buildUnnamed656(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| } |
| buildCounterPrestoJob--; |
| return o; |
| } |
| |
| checkPrestoJob(api.PrestoJob o) { |
| buildCounterPrestoJob++; |
| if (buildCounterPrestoJob < 3) { |
| checkUnnamed655(o.clientTags); |
| unittest.expect(o.continueOnFailure, unittest.isTrue); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.outputFormat, unittest.equals('foo')); |
| checkUnnamed656(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| } |
| buildCounterPrestoJob--; |
| } |
| |
| buildUnnamed657() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed657(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')); |
| } |
| |
| buildUnnamed658() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed658(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')); |
| } |
| |
| buildUnnamed659() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed659(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')); |
| } |
| |
| buildUnnamed660() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed660(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')); |
| } |
| |
| buildUnnamed661() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed661(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')); |
| } |
| |
| buildUnnamed662() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed662(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 buildCounterPySparkJob = 0; |
| buildPySparkJob() { |
| var o = new api.PySparkJob(); |
| buildCounterPySparkJob++; |
| if (buildCounterPySparkJob < 3) { |
| o.archiveUris = buildUnnamed657(); |
| o.args = buildUnnamed658(); |
| o.fileUris = buildUnnamed659(); |
| o.jarFileUris = buildUnnamed660(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainPythonFileUri = "foo"; |
| o.properties = buildUnnamed661(); |
| o.pythonFileUris = buildUnnamed662(); |
| } |
| buildCounterPySparkJob--; |
| return o; |
| } |
| |
| checkPySparkJob(api.PySparkJob o) { |
| buildCounterPySparkJob++; |
| if (buildCounterPySparkJob < 3) { |
| checkUnnamed657(o.archiveUris); |
| checkUnnamed658(o.args); |
| checkUnnamed659(o.fileUris); |
| checkUnnamed660(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainPythonFileUri, unittest.equals('foo')); |
| checkUnnamed661(o.properties); |
| checkUnnamed662(o.pythonFileUris); |
| } |
| buildCounterPySparkJob--; |
| } |
| |
| buildUnnamed663() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed663(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 buildCounterQueryList = 0; |
| buildQueryList() { |
| var o = new api.QueryList(); |
| buildCounterQueryList++; |
| if (buildCounterQueryList < 3) { |
| o.queries = buildUnnamed663(); |
| } |
| buildCounterQueryList--; |
| return o; |
| } |
| |
| checkQueryList(api.QueryList o) { |
| buildCounterQueryList++; |
| if (buildCounterQueryList < 3) { |
| checkUnnamed663(o.queries); |
| } |
| buildCounterQueryList--; |
| } |
| |
| buildUnnamed664() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed664(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 buildCounterRegexValidation = 0; |
| buildRegexValidation() { |
| var o = new api.RegexValidation(); |
| buildCounterRegexValidation++; |
| if (buildCounterRegexValidation < 3) { |
| o.regexes = buildUnnamed664(); |
| } |
| buildCounterRegexValidation--; |
| return o; |
| } |
| |
| checkRegexValidation(api.RegexValidation o) { |
| buildCounterRegexValidation++; |
| if (buildCounterRegexValidation < 3) { |
| checkUnnamed664(o.regexes); |
| } |
| buildCounterRegexValidation--; |
| } |
| |
| buildUnnamed665() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed665(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 buildCounterReservationAffinity = 0; |
| buildReservationAffinity() { |
| var o = new api.ReservationAffinity(); |
| buildCounterReservationAffinity++; |
| if (buildCounterReservationAffinity < 3) { |
| o.consumeReservationType = "foo"; |
| o.key = "foo"; |
| o.values = buildUnnamed665(); |
| } |
| buildCounterReservationAffinity--; |
| return o; |
| } |
| |
| checkReservationAffinity(api.ReservationAffinity o) { |
| buildCounterReservationAffinity++; |
| if (buildCounterReservationAffinity < 3) { |
| unittest.expect(o.consumeReservationType, unittest.equals('foo')); |
| unittest.expect(o.key, unittest.equals('foo')); |
| checkUnnamed665(o.values); |
| } |
| buildCounterReservationAffinity--; |
| } |
| |
| core.int buildCounterSecurityConfig = 0; |
| buildSecurityConfig() { |
| var o = new api.SecurityConfig(); |
| buildCounterSecurityConfig++; |
| if (buildCounterSecurityConfig < 3) { |
| o.kerberosConfig = buildKerberosConfig(); |
| } |
| buildCounterSecurityConfig--; |
| return o; |
| } |
| |
| checkSecurityConfig(api.SecurityConfig o) { |
| buildCounterSecurityConfig++; |
| if (buildCounterSecurityConfig < 3) { |
| checkKerberosConfig(o.kerberosConfig); |
| } |
| buildCounterSecurityConfig--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| buildSetIamPolicyRequest() { |
| var o = new api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| buildUnnamed666() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed666(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')); |
| } |
| |
| buildUnnamed667() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed667(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.int buildCounterSoftwareConfig = 0; |
| buildSoftwareConfig() { |
| var o = new api.SoftwareConfig(); |
| buildCounterSoftwareConfig++; |
| if (buildCounterSoftwareConfig < 3) { |
| o.imageVersion = "foo"; |
| o.optionalComponents = buildUnnamed666(); |
| o.properties = buildUnnamed667(); |
| } |
| buildCounterSoftwareConfig--; |
| return o; |
| } |
| |
| checkSoftwareConfig(api.SoftwareConfig o) { |
| buildCounterSoftwareConfig++; |
| if (buildCounterSoftwareConfig < 3) { |
| unittest.expect(o.imageVersion, unittest.equals('foo')); |
| checkUnnamed666(o.optionalComponents); |
| checkUnnamed667(o.properties); |
| } |
| buildCounterSoftwareConfig--; |
| } |
| |
| buildUnnamed668() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed668(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')); |
| } |
| |
| buildUnnamed669() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed669(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')); |
| } |
| |
| buildUnnamed670() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed670(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')); |
| } |
| |
| buildUnnamed671() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed671(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')); |
| } |
| |
| buildUnnamed672() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed672(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.int buildCounterSparkJob = 0; |
| buildSparkJob() { |
| var o = new api.SparkJob(); |
| buildCounterSparkJob++; |
| if (buildCounterSparkJob < 3) { |
| o.archiveUris = buildUnnamed668(); |
| o.args = buildUnnamed669(); |
| o.fileUris = buildUnnamed670(); |
| o.jarFileUris = buildUnnamed671(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainClass = "foo"; |
| o.mainJarFileUri = "foo"; |
| o.properties = buildUnnamed672(); |
| } |
| buildCounterSparkJob--; |
| return o; |
| } |
| |
| checkSparkJob(api.SparkJob o) { |
| buildCounterSparkJob++; |
| if (buildCounterSparkJob < 3) { |
| checkUnnamed668(o.archiveUris); |
| checkUnnamed669(o.args); |
| checkUnnamed670(o.fileUris); |
| checkUnnamed671(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainClass, unittest.equals('foo')); |
| unittest.expect(o.mainJarFileUri, unittest.equals('foo')); |
| checkUnnamed672(o.properties); |
| } |
| buildCounterSparkJob--; |
| } |
| |
| buildUnnamed673() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed673(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')); |
| } |
| |
| buildUnnamed674() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed674(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')); |
| } |
| |
| buildUnnamed675() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed675(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')); |
| } |
| |
| buildUnnamed676() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed676(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.int buildCounterSparkRJob = 0; |
| buildSparkRJob() { |
| var o = new api.SparkRJob(); |
| buildCounterSparkRJob++; |
| if (buildCounterSparkRJob < 3) { |
| o.archiveUris = buildUnnamed673(); |
| o.args = buildUnnamed674(); |
| o.fileUris = buildUnnamed675(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.mainRFileUri = "foo"; |
| o.properties = buildUnnamed676(); |
| } |
| buildCounterSparkRJob--; |
| return o; |
| } |
| |
| checkSparkRJob(api.SparkRJob o) { |
| buildCounterSparkRJob++; |
| if (buildCounterSparkRJob < 3) { |
| checkUnnamed673(o.archiveUris); |
| checkUnnamed674(o.args); |
| checkUnnamed675(o.fileUris); |
| checkLoggingConfig(o.loggingConfig); |
| unittest.expect(o.mainRFileUri, unittest.equals('foo')); |
| checkUnnamed676(o.properties); |
| } |
| buildCounterSparkRJob--; |
| } |
| |
| buildUnnamed677() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed677(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')); |
| } |
| |
| buildUnnamed678() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed678(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')); |
| } |
| |
| buildUnnamed679() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed679(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.int buildCounterSparkSqlJob = 0; |
| buildSparkSqlJob() { |
| var o = new api.SparkSqlJob(); |
| buildCounterSparkSqlJob++; |
| if (buildCounterSparkSqlJob < 3) { |
| o.jarFileUris = buildUnnamed677(); |
| o.loggingConfig = buildLoggingConfig(); |
| o.properties = buildUnnamed678(); |
| o.queryFileUri = "foo"; |
| o.queryList = buildQueryList(); |
| o.scriptVariables = buildUnnamed679(); |
| } |
| buildCounterSparkSqlJob--; |
| return o; |
| } |
| |
| checkSparkSqlJob(api.SparkSqlJob o) { |
| buildCounterSparkSqlJob++; |
| if (buildCounterSparkSqlJob < 3) { |
| checkUnnamed677(o.jarFileUris); |
| checkLoggingConfig(o.loggingConfig); |
| checkUnnamed678(o.properties); |
| unittest.expect(o.queryFileUri, unittest.equals('foo')); |
| checkQueryList(o.queryList); |
| checkUnnamed679(o.scriptVariables); |
| } |
| buildCounterSparkSqlJob--; |
| } |
| |
| buildUnnamed680() { |
| var o = new core.Map<core.String, core.Object>(); |
| o["x"] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o["y"] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| checkUnnamed680(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')); |
| } |
| |
| buildUnnamed681() { |
| var o = new core.List<core.Map<core.String, core.Object>>(); |
| o.add(buildUnnamed680()); |
| o.add(buildUnnamed680()); |
| return o; |
| } |
| |
| checkUnnamed681(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed680(o[0]); |
| checkUnnamed680(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| buildStatus() { |
| var o = new api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed681(); |
| o.message = "foo"; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed681(o.details); |
| unittest.expect(o.message, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.int buildCounterSubmitJobRequest = 0; |
| buildSubmitJobRequest() { |
| var o = new api.SubmitJobRequest(); |
| buildCounterSubmitJobRequest++; |
| if (buildCounterSubmitJobRequest < 3) { |
| o.job = buildJob(); |
| o.requestId = "foo"; |
| } |
| buildCounterSubmitJobRequest--; |
| return o; |
| } |
| |
| checkSubmitJobRequest(api.SubmitJobRequest o) { |
| buildCounterSubmitJobRequest++; |
| if (buildCounterSubmitJobRequest < 3) { |
| checkJob(o.job); |
| unittest.expect(o.requestId, unittest.equals('foo')); |
| } |
| buildCounterSubmitJobRequest--; |
| } |
| |
| buildUnnamed682() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed682(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 buildCounterTemplateParameter = 0; |
| buildTemplateParameter() { |
| var o = new api.TemplateParameter(); |
| buildCounterTemplateParameter++; |
| if (buildCounterTemplateParameter < 3) { |
| o.description = "foo"; |
| o.fields = buildUnnamed682(); |
| o.name = "foo"; |
| o.validation = buildParameterValidation(); |
| } |
| buildCounterTemplateParameter--; |
| return o; |
| } |
| |
| checkTemplateParameter(api.TemplateParameter o) { |
| buildCounterTemplateParameter++; |
| if (buildCounterTemplateParameter < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| checkUnnamed682(o.fields); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkParameterValidation(o.validation); |
| } |
| buildCounterTemplateParameter--; |
| } |
| |
| buildUnnamed683() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed683(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 buildCounterTestIamPermissionsRequest = 0; |
| buildTestIamPermissionsRequest() { |
| var o = new api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed683(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed683(o.permissions); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| buildUnnamed684() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed684(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 buildCounterTestIamPermissionsResponse = 0; |
| buildTestIamPermissionsResponse() { |
| var o = new api.TestIamPermissionsResponse(); |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| o.permissions = buildUnnamed684(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed684(o.permissions); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| buildUnnamed685() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed685(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 buildCounterValueValidation = 0; |
| buildValueValidation() { |
| var o = new api.ValueValidation(); |
| buildCounterValueValidation++; |
| if (buildCounterValueValidation < 3) { |
| o.values = buildUnnamed685(); |
| } |
| buildCounterValueValidation--; |
| return o; |
| } |
| |
| checkValueValidation(api.ValueValidation o) { |
| buildCounterValueValidation++; |
| if (buildCounterValueValidation < 3) { |
| checkUnnamed685(o.values); |
| } |
| buildCounterValueValidation--; |
| } |
| |
| buildUnnamed686() { |
| var o = new core.List<api.WorkflowNode>(); |
| o.add(buildWorkflowNode()); |
| o.add(buildWorkflowNode()); |
| return o; |
| } |
| |
| checkUnnamed686(core.List<api.WorkflowNode> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkWorkflowNode(o[0]); |
| checkWorkflowNode(o[1]); |
| } |
| |
| core.int buildCounterWorkflowGraph = 0; |
| buildWorkflowGraph() { |
| var o = new api.WorkflowGraph(); |
| buildCounterWorkflowGraph++; |
| if (buildCounterWorkflowGraph < 3) { |
| o.nodes = buildUnnamed686(); |
| } |
| buildCounterWorkflowGraph--; |
| return o; |
| } |
| |
| checkWorkflowGraph(api.WorkflowGraph o) { |
| buildCounterWorkflowGraph++; |
| if (buildCounterWorkflowGraph < 3) { |
| checkUnnamed686(o.nodes); |
| } |
| buildCounterWorkflowGraph--; |
| } |
| |
| buildUnnamed687() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed687(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.int buildCounterWorkflowMetadata = 0; |
| buildWorkflowMetadata() { |
| var o = new api.WorkflowMetadata(); |
| buildCounterWorkflowMetadata++; |
| if (buildCounterWorkflowMetadata < 3) { |
| o.clusterName = "foo"; |
| o.clusterUuid = "foo"; |
| o.createCluster = buildClusterOperation(); |
| o.deleteCluster = buildClusterOperation(); |
| o.endTime = "foo"; |
| o.graph = buildWorkflowGraph(); |
| o.parameters = buildUnnamed687(); |
| o.startTime = "foo"; |
| o.state = "foo"; |
| o.template = "foo"; |
| o.version = 42; |
| } |
| buildCounterWorkflowMetadata--; |
| return o; |
| } |
| |
| checkWorkflowMetadata(api.WorkflowMetadata o) { |
| buildCounterWorkflowMetadata++; |
| if (buildCounterWorkflowMetadata < 3) { |
| unittest.expect(o.clusterName, unittest.equals('foo')); |
| unittest.expect(o.clusterUuid, unittest.equals('foo')); |
| checkClusterOperation(o.createCluster); |
| checkClusterOperation(o.deleteCluster); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| checkWorkflowGraph(o.graph); |
| checkUnnamed687(o.parameters); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.template, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterWorkflowMetadata--; |
| } |
| |
| buildUnnamed688() { |
| var o = new core.List<core.String>(); |
| o.add("foo"); |
| o.add("foo"); |
| return o; |
| } |
| |
| checkUnnamed688(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 buildCounterWorkflowNode = 0; |
| buildWorkflowNode() { |
| var o = new api.WorkflowNode(); |
| buildCounterWorkflowNode++; |
| if (buildCounterWorkflowNode < 3) { |
| o.error = "foo"; |
| o.jobId = "foo"; |
| o.prerequisiteStepIds = buildUnnamed688(); |
| o.state = "foo"; |
| o.stepId = "foo"; |
| } |
| buildCounterWorkflowNode--; |
| return o; |
| } |
| |
| checkWorkflowNode(api.WorkflowNode o) { |
| buildCounterWorkflowNode++; |
| if (buildCounterWorkflowNode < 3) { |
| unittest.expect(o.error, unittest.equals('foo')); |
| unittest.expect(o.jobId, unittest.equals('foo')); |
| checkUnnamed688(o.prerequisiteStepIds); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.stepId, unittest.equals('foo')); |
| } |
| buildCounterWorkflowNode--; |
| } |
| |
| buildUnnamed689() { |
| var o = new core.List<api.OrderedJob>(); |
| o.add(buildOrderedJob()); |
| o.add(buildOrderedJob()); |
| return o; |
| } |
| |
| checkUnnamed689(core.List<api.OrderedJob> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOrderedJob(o[0]); |
| checkOrderedJob(o[1]); |
| } |
| |
| buildUnnamed690() { |
| var o = new core.Map<core.String, core.String>(); |
| o["x"] = "foo"; |
| o["y"] = "foo"; |
| return o; |
| } |
| |
| checkUnnamed690(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')); |
| } |
| |
| buildUnnamed691() { |
| var o = new core.List<api.TemplateParameter>(); |
| o.add(buildTemplateParameter()); |
| o.add(buildTemplateParameter()); |
| return o; |
| } |
| |
| checkUnnamed691(core.List<api.TemplateParameter> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkTemplateParameter(o[0]); |
| checkTemplateParameter(o[1]); |
| } |
| |
| core.int buildCounterWorkflowTemplate = 0; |
| buildWorkflowTemplate() { |
| var o = new api.WorkflowTemplate(); |
| buildCounterWorkflowTemplate++; |
| if (buildCounterWorkflowTemplate < 3) { |
| o.createTime = "foo"; |
| o.id = "foo"; |
| o.jobs = buildUnnamed689(); |
| o.labels = buildUnnamed690(); |
| o.name = "foo"; |
| o.parameters = buildUnnamed691(); |
| o.placement = buildWorkflowTemplatePlacement(); |
| o.updateTime = "foo"; |
| o.version = 42; |
| } |
| buildCounterWorkflowTemplate--; |
| return o; |
| } |
| |
| checkWorkflowTemplate(api.WorkflowTemplate o) { |
| buildCounterWorkflowTemplate++; |
| if (buildCounterWorkflowTemplate < 3) { |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.id, unittest.equals('foo')); |
| checkUnnamed689(o.jobs); |
| checkUnnamed690(o.labels); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed691(o.parameters); |
| checkWorkflowTemplatePlacement(o.placement); |
| unittest.expect(o.updateTime, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterWorkflowTemplate--; |
| } |
| |
| core.int buildCounterWorkflowTemplatePlacement = 0; |
| buildWorkflowTemplatePlacement() { |
| var o = new api.WorkflowTemplatePlacement(); |
| buildCounterWorkflowTemplatePlacement++; |
| if (buildCounterWorkflowTemplatePlacement < 3) { |
| o.clusterSelector = buildClusterSelector(); |
| o.managedCluster = buildManagedCluster(); |
| } |
| buildCounterWorkflowTemplatePlacement--; |
| return o; |
| } |
| |
| checkWorkflowTemplatePlacement(api.WorkflowTemplatePlacement o) { |
| buildCounterWorkflowTemplatePlacement++; |
| if (buildCounterWorkflowTemplatePlacement < 3) { |
| checkClusterSelector(o.clusterSelector); |
| checkManagedCluster(o.managedCluster); |
| } |
| buildCounterWorkflowTemplatePlacement--; |
| } |
| |
| core.int buildCounterYarnApplication = 0; |
| buildYarnApplication() { |
| var o = new api.YarnApplication(); |
| buildCounterYarnApplication++; |
| if (buildCounterYarnApplication < 3) { |
| o.name = "foo"; |
| o.progress = 42.0; |
| o.state = "foo"; |
| o.trackingUrl = "foo"; |
| } |
| buildCounterYarnApplication--; |
| return o; |
| } |
| |
| checkYarnApplication(api.YarnApplication o) { |
| buildCounterYarnApplication++; |
| if (buildCounterYarnApplication < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.progress, unittest.equals(42.0)); |
| unittest.expect(o.state, unittest.equals('foo')); |
| unittest.expect(o.trackingUrl, unittest.equals('foo')); |
| } |
| buildCounterYarnApplication--; |
| } |
| |
| main() { |
| unittest.group("obj-schema-AcceleratorConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAcceleratorConfig(); |
| var od = new api.AcceleratorConfig.fromJson(o.toJson()); |
| checkAcceleratorConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-AutoscalingConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAutoscalingConfig(); |
| var od = new api.AutoscalingConfig.fromJson(o.toJson()); |
| checkAutoscalingConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-AutoscalingPolicy", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildAutoscalingPolicy(); |
| var od = new api.AutoscalingPolicy.fromJson(o.toJson()); |
| checkAutoscalingPolicy(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-BasicAutoscalingAlgorithm", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBasicAutoscalingAlgorithm(); |
| var od = new api.BasicAutoscalingAlgorithm.fromJson(o.toJson()); |
| checkBasicAutoscalingAlgorithm(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-BasicYarnAutoscalingConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBasicYarnAutoscalingConfig(); |
| var od = new api.BasicYarnAutoscalingConfig.fromJson(o.toJson()); |
| checkBasicYarnAutoscalingConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Binding", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildBinding(); |
| var od = new api.Binding.fromJson(o.toJson()); |
| checkBinding(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-CancelJobRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCancelJobRequest(); |
| var od = new api.CancelJobRequest.fromJson(o.toJson()); |
| checkCancelJobRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Cluster", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildCluster(); |
| var od = new api.Cluster.fromJson(o.toJson()); |
| checkCluster(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterConfig(); |
| var od = new api.ClusterConfig.fromJson(o.toJson()); |
| checkClusterConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterMetrics", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterMetrics(); |
| var od = new api.ClusterMetrics.fromJson(o.toJson()); |
| checkClusterMetrics(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterOperation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterOperation(); |
| var od = new api.ClusterOperation.fromJson(o.toJson()); |
| checkClusterOperation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterOperationMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterOperationMetadata(); |
| var od = new api.ClusterOperationMetadata.fromJson(o.toJson()); |
| checkClusterOperationMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterOperationStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterOperationStatus(); |
| var od = new api.ClusterOperationStatus.fromJson(o.toJson()); |
| checkClusterOperationStatus(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterSelector", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterSelector(); |
| var od = new api.ClusterSelector.fromJson(o.toJson()); |
| checkClusterSelector(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ClusterStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildClusterStatus(); |
| var od = new api.ClusterStatus.fromJson(o.toJson()); |
| checkClusterStatus(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-DiagnoseClusterRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiagnoseClusterRequest(); |
| var od = new api.DiagnoseClusterRequest.fromJson(o.toJson()); |
| checkDiagnoseClusterRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-DiagnoseClusterResults", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiagnoseClusterResults(); |
| var od = new api.DiagnoseClusterResults.fromJson(o.toJson()); |
| checkDiagnoseClusterResults(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-DiskConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildDiskConfig(); |
| var od = new api.DiskConfig.fromJson(o.toJson()); |
| checkDiskConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Empty", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildEmpty(); |
| var od = new api.Empty.fromJson(o.toJson()); |
| checkEmpty(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-EncryptionConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildEncryptionConfig(); |
| var od = new api.EncryptionConfig.fromJson(o.toJson()); |
| checkEncryptionConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Expr", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildExpr(); |
| var od = new api.Expr.fromJson(o.toJson()); |
| checkExpr(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-GceClusterConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGceClusterConfig(); |
| var od = new api.GceClusterConfig.fromJson(o.toJson()); |
| checkGceClusterConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-GetIamPolicyRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGetIamPolicyRequest(); |
| var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); |
| checkGetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-GetPolicyOptions", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildGetPolicyOptions(); |
| var od = new api.GetPolicyOptions.fromJson(o.toJson()); |
| checkGetPolicyOptions(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-HadoopJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildHadoopJob(); |
| var od = new api.HadoopJob.fromJson(o.toJson()); |
| checkHadoopJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-HiveJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildHiveJob(); |
| var od = new api.HiveJob.fromJson(o.toJson()); |
| checkHiveJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-InstanceGroupAutoscalingPolicyConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildInstanceGroupAutoscalingPolicyConfig(); |
| var od = |
| new api.InstanceGroupAutoscalingPolicyConfig.fromJson(o.toJson()); |
| checkInstanceGroupAutoscalingPolicyConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-InstanceGroupConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildInstanceGroupConfig(); |
| var od = new api.InstanceGroupConfig.fromJson(o.toJson()); |
| checkInstanceGroupConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-InstantiateWorkflowTemplateRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildInstantiateWorkflowTemplateRequest(); |
| var od = new api.InstantiateWorkflowTemplateRequest.fromJson(o.toJson()); |
| checkInstantiateWorkflowTemplateRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Job", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJob(); |
| var od = new api.Job.fromJson(o.toJson()); |
| checkJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-JobMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobMetadata(); |
| var od = new api.JobMetadata.fromJson(o.toJson()); |
| checkJobMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-JobPlacement", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobPlacement(); |
| var od = new api.JobPlacement.fromJson(o.toJson()); |
| checkJobPlacement(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-JobReference", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobReference(); |
| var od = new api.JobReference.fromJson(o.toJson()); |
| checkJobReference(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-JobScheduling", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobScheduling(); |
| var od = new api.JobScheduling.fromJson(o.toJson()); |
| checkJobScheduling(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-JobStatus", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildJobStatus(); |
| var od = new api.JobStatus.fromJson(o.toJson()); |
| checkJobStatus(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-KerberosConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildKerberosConfig(); |
| var od = new api.KerberosConfig.fromJson(o.toJson()); |
| checkKerberosConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-LifecycleConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildLifecycleConfig(); |
| var od = new api.LifecycleConfig.fromJson(o.toJson()); |
| checkLifecycleConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListAutoscalingPoliciesResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListAutoscalingPoliciesResponse(); |
| var od = new api.ListAutoscalingPoliciesResponse.fromJson(o.toJson()); |
| checkListAutoscalingPoliciesResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListClustersResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListClustersResponse(); |
| var od = new api.ListClustersResponse.fromJson(o.toJson()); |
| checkListClustersResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListJobsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListJobsResponse(); |
| var od = new api.ListJobsResponse.fromJson(o.toJson()); |
| checkListJobsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListOperationsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListOperationsResponse(); |
| var od = new api.ListOperationsResponse.fromJson(o.toJson()); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ListWorkflowTemplatesResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildListWorkflowTemplatesResponse(); |
| var od = new api.ListWorkflowTemplatesResponse.fromJson(o.toJson()); |
| checkListWorkflowTemplatesResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-LoggingConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildLoggingConfig(); |
| var od = new api.LoggingConfig.fromJson(o.toJson()); |
| checkLoggingConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ManagedCluster", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildManagedCluster(); |
| var od = new api.ManagedCluster.fromJson(o.toJson()); |
| checkManagedCluster(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ManagedGroupConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildManagedGroupConfig(); |
| var od = new api.ManagedGroupConfig.fromJson(o.toJson()); |
| checkManagedGroupConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-NodeInitializationAction", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildNodeInitializationAction(); |
| var od = new api.NodeInitializationAction.fromJson(o.toJson()); |
| checkNodeInitializationAction(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Operation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOperation(); |
| var od = new api.Operation.fromJson(o.toJson()); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-OrderedJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildOrderedJob(); |
| var od = new api.OrderedJob.fromJson(o.toJson()); |
| checkOrderedJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ParameterValidation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildParameterValidation(); |
| var od = new api.ParameterValidation.fromJson(o.toJson()); |
| checkParameterValidation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-PigJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPigJob(); |
| var od = new api.PigJob.fromJson(o.toJson()); |
| checkPigJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Policy", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPolicy(); |
| var od = new api.Policy.fromJson(o.toJson()); |
| checkPolicy(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-PrestoJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPrestoJob(); |
| var od = new api.PrestoJob.fromJson(o.toJson()); |
| checkPrestoJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-PySparkJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildPySparkJob(); |
| var od = new api.PySparkJob.fromJson(o.toJson()); |
| checkPySparkJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-QueryList", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildQueryList(); |
| var od = new api.QueryList.fromJson(o.toJson()); |
| checkQueryList(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-RegexValidation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildRegexValidation(); |
| var od = new api.RegexValidation.fromJson(o.toJson()); |
| checkRegexValidation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ReservationAffinity", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildReservationAffinity(); |
| var od = new api.ReservationAffinity.fromJson(o.toJson()); |
| checkReservationAffinity(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SecurityConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSecurityConfig(); |
| var od = new api.SecurityConfig.fromJson(o.toJson()); |
| checkSecurityConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SetIamPolicyRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSetIamPolicyRequest(); |
| var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); |
| checkSetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SoftwareConfig", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSoftwareConfig(); |
| var od = new api.SoftwareConfig.fromJson(o.toJson()); |
| checkSoftwareConfig(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SparkJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSparkJob(); |
| var od = new api.SparkJob.fromJson(o.toJson()); |
| checkSparkJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SparkRJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSparkRJob(); |
| var od = new api.SparkRJob.fromJson(o.toJson()); |
| checkSparkRJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SparkSqlJob", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSparkSqlJob(); |
| var od = new api.SparkSqlJob.fromJson(o.toJson()); |
| checkSparkSqlJob(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-Status", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildStatus(); |
| var od = new api.Status.fromJson(o.toJson()); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-SubmitJobRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildSubmitJobRequest(); |
| var od = new api.SubmitJobRequest.fromJson(o.toJson()); |
| checkSubmitJobRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TemplateParameter", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTemplateParameter(); |
| var od = new api.TemplateParameter.fromJson(o.toJson()); |
| checkTemplateParameter(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestIamPermissionsRequest", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestIamPermissionsRequest(); |
| var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| checkTestIamPermissionsRequest(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-TestIamPermissionsResponse", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildTestIamPermissionsResponse(); |
| var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| checkTestIamPermissionsResponse(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-ValueValidation", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildValueValidation(); |
| var od = new api.ValueValidation.fromJson(o.toJson()); |
| checkValueValidation(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-WorkflowGraph", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildWorkflowGraph(); |
| var od = new api.WorkflowGraph.fromJson(o.toJson()); |
| checkWorkflowGraph(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-WorkflowMetadata", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildWorkflowMetadata(); |
| var od = new api.WorkflowMetadata.fromJson(o.toJson()); |
| checkWorkflowMetadata(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-WorkflowNode", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildWorkflowNode(); |
| var od = new api.WorkflowNode.fromJson(o.toJson()); |
| checkWorkflowNode(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-WorkflowTemplate", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildWorkflowTemplate(); |
| var od = new api.WorkflowTemplate.fromJson(o.toJson()); |
| checkWorkflowTemplate(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-WorkflowTemplatePlacement", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildWorkflowTemplatePlacement(); |
| var od = new api.WorkflowTemplatePlacement.fromJson(o.toJson()); |
| checkWorkflowTemplatePlacement(od); |
| }); |
| }); |
| |
| unittest.group("obj-schema-YarnApplication", () { |
| unittest.test("to-json--from-json", () { |
| var o = buildYarnApplication(); |
| var od = new api.YarnApplication.fromJson(o.toJson()); |
| checkYarnApplication(od); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsLocationsAutoscalingPoliciesResourceApi", |
| () { |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_request = buildAutoscalingPolicy(); |
| var arg_parent = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.AutoscalingPolicy.fromJson(json); |
| checkAutoscalingPolicy(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildAutoscalingPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkAutoscalingPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildAutoscalingPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkAutoscalingPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListAutoscalingPoliciesResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListAutoscalingPoliciesResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--update", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.autoscalingPolicies; |
| var arg_request = buildAutoscalingPolicy(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.AutoscalingPolicy.fromJson(json); |
| checkAutoscalingPolicy(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildAutoscalingPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .update(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkAutoscalingPolicy(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsLocationsWorkflowTemplatesResourceApi", () { |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildWorkflowTemplate(); |
| var arg_parent = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.WorkflowTemplate.fromJson(json); |
| checkWorkflowTemplate(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildWorkflowTemplate()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkWorkflowTemplate(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_name = "foo"; |
| var arg_version = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["version"].first), |
| unittest.equals(arg_version)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, version: arg_version, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_name = "foo"; |
| var arg_version = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["version"].first), |
| unittest.equals(arg_version)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildWorkflowTemplate()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, version: arg_version, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkWorkflowTemplate(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--instantiate", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildInstantiateWorkflowTemplateRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.InstantiateWorkflowTemplateRequest.fromJson(json); |
| checkInstantiateWorkflowTemplateRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .instantiate(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--instantiateInline", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildWorkflowTemplate(); |
| var arg_parent = "foo"; |
| var arg_requestId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.WorkflowTemplate.fromJson(json); |
| checkWorkflowTemplate(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["requestId"].first, unittest.equals(arg_requestId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .instantiateInline(arg_request, arg_parent, |
| requestId: arg_requestId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListWorkflowTemplatesResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListWorkflowTemplatesResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--update", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsLocationsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.locations.workflowTemplates; |
| var arg_request = buildWorkflowTemplate(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.WorkflowTemplate.fromJson(json); |
| checkWorkflowTemplate(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildWorkflowTemplate()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .update(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkWorkflowTemplate(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsRegionsAutoscalingPoliciesResourceApi", () { |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_request = buildAutoscalingPolicy(); |
| var arg_parent = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.AutoscalingPolicy.fromJson(json); |
| checkAutoscalingPolicy(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildAutoscalingPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkAutoscalingPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildAutoscalingPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkAutoscalingPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListAutoscalingPoliciesResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListAutoscalingPoliciesResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--update", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsAutoscalingPoliciesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.autoscalingPolicies; |
| var arg_request = buildAutoscalingPolicy(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.AutoscalingPolicy.fromJson(json); |
| checkAutoscalingPolicy(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildAutoscalingPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .update(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkAutoscalingPolicy(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsRegionsClustersResourceApi", () { |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildCluster(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_requestId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.Cluster.fromJson(json); |
| checkCluster(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/clusters")); |
| pathOffset += 9; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["requestId"].first, unittest.equals(arg_requestId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_projectId, arg_region, |
| requestId: arg_requestId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| var arg_clusterUuid = "foo"; |
| var arg_requestId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| unittest.equals("/clusters/")); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["clusterUuid"].first, unittest.equals(arg_clusterUuid)); |
| unittest.expect( |
| queryMap["requestId"].first, unittest.equals(arg_requestId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_projectId, arg_region, arg_clusterName, |
| clusterUuid: arg_clusterUuid, |
| requestId: arg_requestId, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--diagnose", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildDiagnoseClusterRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.DiagnoseClusterRequest.fromJson(json); |
| checkDiagnoseClusterRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| unittest.equals("/clusters/")); |
| pathOffset += 10; |
| index = path.indexOf(":diagnose", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals(":diagnose")); |
| pathOffset += 9; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .diagnose(arg_request, arg_projectId, arg_region, arg_clusterName, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| unittest.equals("/clusters/")); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildCluster()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_projectId, arg_region, arg_clusterName, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkCluster(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_filter = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/clusters")); |
| pathOffset += 9; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var 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( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListClustersResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_projectId, arg_region, |
| filter: arg_filter, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListClustersResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--patch", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildCluster(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_clusterName = "foo"; |
| var arg_requestId = "foo"; |
| var arg_updateMask = "foo"; |
| var arg_gracefulDecommissionTimeout = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.Cluster.fromJson(json); |
| checkCluster(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/clusters/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| unittest.equals("/clusters/")); |
| pathOffset += 10; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_clusterName")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["requestId"].first, unittest.equals(arg_requestId)); |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["gracefulDecommissionTimeout"].first, |
| unittest.equals(arg_gracefulDecommissionTimeout)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_projectId, arg_region, arg_clusterName, |
| requestId: arg_requestId, |
| updateMask: arg_updateMask, |
| gracefulDecommissionTimeout: arg_gracefulDecommissionTimeout, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsClustersResourceApi res = |
| new api.DataprocApi(mock).projects.regions.clusters; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsRegionsJobsResourceApi", () { |
| unittest.test("method--cancel", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildCancelJobRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.CancelJobRequest.fromJson(json); |
| checkCancelJobRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| unittest.equals("/jobs/")); |
| pathOffset += 6; |
| index = path.indexOf(":cancel", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| unittest.equals(":cancel")); |
| pathOffset += 7; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_request, arg_projectId, arg_region, arg_jobId, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| unittest.equals("/jobs/")); |
| pathOffset += 6; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_projectId, arg_region, arg_jobId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| unittest.equals("/jobs/")); |
| pathOffset += 6; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_projectId, arg_region, arg_jobId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_pageSize = 42; |
| var arg_clusterName = "foo"; |
| var arg_filter = "foo"; |
| var arg_jobStateMatcher = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 5), |
| unittest.equals("/jobs")); |
| pathOffset += 5; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var 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["clusterName"].first, unittest.equals(arg_clusterName)); |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(queryMap["jobStateMatcher"].first, |
| unittest.equals(arg_jobStateMatcher)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListJobsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_projectId, arg_region, |
| pageSize: arg_pageSize, |
| clusterName: arg_clusterName, |
| filter: arg_filter, |
| jobStateMatcher: arg_jobStateMatcher, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListJobsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--patch", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildJob(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_jobId = "foo"; |
| var arg_updateMask = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.Job.fromJson(json); |
| checkJob(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| unittest.equals("/jobs/")); |
| pathOffset += 6; |
| subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| pathOffset = path.length; |
| unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var 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)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_projectId, arg_region, arg_jobId, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--submit", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildSubmitJobRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SubmitJobRequest.fromJson(json); |
| checkSubmitJobRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs:submit", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("/jobs:submit")); |
| pathOffset += 12; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildJob()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .submit(arg_request, arg_projectId, arg_region, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkJob(response); |
| }))); |
| }); |
| |
| unittest.test("method--submitAsOperation", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildSubmitJobRequest(); |
| var arg_projectId = "foo"; |
| var arg_region = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SubmitJobRequest.fromJson(json); |
| checkSubmitJobRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| unittest.equals("v1/projects/")); |
| pathOffset += 12; |
| index = path.indexOf("/regions/", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| unittest.equals("/regions/")); |
| pathOffset += 9; |
| index = path.indexOf("/jobs:submitAsOperation", pathOffset); |
| unittest.expect(index >= 0, unittest.isTrue); |
| subPart = |
| core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| pathOffset = index; |
| unittest.expect(subPart, unittest.equals("$arg_region")); |
| unittest.expect(path.substring(pathOffset, pathOffset + 23), |
| unittest.equals("/jobs:submitAsOperation")); |
| pathOffset += 23; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .submitAsOperation(arg_request, arg_projectId, arg_region, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsJobsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.jobs; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsRegionsOperationsResourceApi", () { |
| unittest.test("method--cancel", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_name = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_filter = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| filter: arg_filter, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsOperationsResourceApi res = |
| new api.DataprocApi(mock).projects.regions.operations; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group("resource-ProjectsRegionsWorkflowTemplatesResourceApi", () { |
| unittest.test("method--create", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildWorkflowTemplate(); |
| var arg_parent = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.WorkflowTemplate.fromJson(json); |
| checkWorkflowTemplate(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildWorkflowTemplate()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkWorkflowTemplate(response); |
| }))); |
| }); |
| |
| unittest.test("method--delete", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_name = "foo"; |
| var arg_version = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["version"].first), |
| unittest.equals(arg_version)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, version: arg_version, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test("method--get", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_name = "foo"; |
| var arg_version = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["version"].first), |
| unittest.equals(arg_version)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildWorkflowTemplate()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, version: arg_version, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkWorkflowTemplate(response); |
| }))); |
| }); |
| |
| unittest.test("method--getIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--instantiate", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildInstantiateWorkflowTemplateRequest(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.InstantiateWorkflowTemplateRequest.fromJson(json); |
| checkInstantiateWorkflowTemplateRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .instantiate(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--instantiateInline", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildWorkflowTemplate(); |
| var arg_parent = "foo"; |
| var arg_requestId = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.WorkflowTemplate.fromJson(json); |
| checkWorkflowTemplate(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["requestId"].first, unittest.equals(arg_requestId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .instantiateInline(arg_request, arg_parent, |
| requestId: arg_requestId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test("method--list", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_parent = "foo"; |
| var arg_pageToken = "foo"; |
| var arg_pageSize = 42; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildListWorkflowTemplatesResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageToken: arg_pageToken, |
| pageSize: arg_pageSize, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListWorkflowTemplatesResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--setIamPolicy", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test("method--testIamPermissions", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test("method--update", () { |
| var mock = new HttpServerMock(); |
| api.ProjectsRegionsWorkflowTemplatesResourceApi res = |
| new api.DataprocApi(mock).projects.regions.workflowTemplates; |
| var arg_request = buildWorkflowTemplate(); |
| var arg_name = "foo"; |
| var arg_$fields = "foo"; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = new api.WorkflowTemplate.fromJson(json); |
| checkWorkflowTemplate(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| var index; |
| var 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; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| parseBool(n) { |
| if (n == "true") return true; |
| if (n == "false") return false; |
| if (n == null) return null; |
| throw new core.ArgumentError("Invalid boolean: $n"); |
| } |
| |
| if (query.length > 0) { |
| for (var part in query.split("&")) { |
| var keyvalue = part.split("="); |
| addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| core.Uri.decodeQueryComponent(keyvalue[1])); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| "content-type": "application/json; charset=utf-8", |
| }; |
| var resp = convert.json.encode(buildWorkflowTemplate()); |
| return new async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .update(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkWorkflowTemplate(response); |
| }))); |
| }); |
| }); |
| } |