Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: generated/googleapis/test/dataproc/v1beta2_test.dart

Issue 2987103002: Api-Roll 52: 2017-07-31 (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « generated/googleapis/test/dataproc/v1_test.dart ('k') | generated/googleapis/test/datastore/v1_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: generated/googleapis/test/dataproc/v1beta2_test.dart
diff --git a/generated/googleapis/test/dataproc/v1beta2_test.dart b/generated/googleapis/test/dataproc/v1beta2_test.dart
deleted file mode 100644
index 4be09ee6b5586eb88c4fd6ced93d497f9b631136..0000000000000000000000000000000000000000
--- a/generated/googleapis/test/dataproc/v1beta2_test.dart
+++ /dev/null
@@ -1,2940 +0,0 @@
-library googleapis.dataproc.v1beta2.test;
-
-import "dart:core" as core;
-import "dart:collection" as collection;
-import "dart:async" as async;
-import "dart:convert" as convert;
-
-import 'package:http/http.dart' as http;
-import 'package:http/testing.dart' as http_testing;
-import 'package:test/test.dart' as unittest;
-
-import 'package:googleapis/dataproc/v1beta2.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 buildCounterCancelJobRequest = 0;
-buildCancelJobRequest() {
- var o = new api.CancelJobRequest();
- buildCounterCancelJobRequest++;
- if (buildCounterCancelJobRequest < 3) {
- }
- buildCounterCancelJobRequest--;
- return o;
-}
-
-checkCancelJobRequest(api.CancelJobRequest o) {
- buildCounterCancelJobRequest++;
- if (buildCounterCancelJobRequest < 3) {
- }
- buildCounterCancelJobRequest--;
-}
-
-buildUnnamed54() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed54(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'));
-}
-
-buildUnnamed55() {
- var o = new core.List<api.ClusterStatus>();
- o.add(buildClusterStatus());
- o.add(buildClusterStatus());
- return o;
-}
-
-checkUnnamed55(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 = buildUnnamed54();
- o.metrics = buildClusterMetrics();
- o.projectId = "foo";
- o.status = buildClusterStatus();
- o.statusHistory = buildUnnamed55();
- }
- 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);
- checkUnnamed54(o.labels);
- checkClusterMetrics(o.metrics);
- unittest.expect(o.projectId, unittest.equals('foo'));
- checkClusterStatus(o.status);
- checkUnnamed55(o.statusHistory);
- }
- buildCounterCluster--;
-}
-
-buildUnnamed56() {
- var o = new core.List<api.NodeInitializationAction>();
- o.add(buildNodeInitializationAction());
- o.add(buildNodeInitializationAction());
- return o;
-}
-
-checkUnnamed56(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.configBucket = "foo";
- o.gceClusterConfig = buildGceClusterConfig();
- o.initializationActions = buildUnnamed56();
- o.masterConfig = buildInstanceGroupConfig();
- o.secondaryWorkerConfig = buildInstanceGroupConfig();
- o.softwareConfig = buildSoftwareConfig();
- o.workerConfig = buildInstanceGroupConfig();
- }
- buildCounterClusterConfig--;
- return o;
-}
-
-checkClusterConfig(api.ClusterConfig o) {
- buildCounterClusterConfig++;
- if (buildCounterClusterConfig < 3) {
- unittest.expect(o.configBucket, unittest.equals('foo'));
- checkGceClusterConfig(o.gceClusterConfig);
- checkUnnamed56(o.initializationActions);
- checkInstanceGroupConfig(o.masterConfig);
- checkInstanceGroupConfig(o.secondaryWorkerConfig);
- checkSoftwareConfig(o.softwareConfig);
- checkInstanceGroupConfig(o.workerConfig);
- }
- buildCounterClusterConfig--;
-}
-
-buildUnnamed57() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed57(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'));
-}
-
-buildUnnamed58() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed58(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 = buildUnnamed57();
- o.yarnMetrics = buildUnnamed58();
- }
- buildCounterClusterMetrics--;
- return o;
-}
-
-checkClusterMetrics(api.ClusterMetrics o) {
- buildCounterClusterMetrics++;
- if (buildCounterClusterMetrics < 3) {
- checkUnnamed57(o.hdfsMetrics);
- checkUnnamed58(o.yarnMetrics);
- }
- buildCounterClusterMetrics--;
-}
-
-buildUnnamed59() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed59(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'));
-}
-
-buildUnnamed60() {
- var o = new core.List<api.ClusterOperationStatus>();
- o.add(buildClusterOperationStatus());
- o.add(buildClusterOperationStatus());
- return o;
-}
-
-checkUnnamed60(core.List<api.ClusterOperationStatus> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkClusterOperationStatus(o[0]);
- checkClusterOperationStatus(o[1]);
-}
-
-buildUnnamed61() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed61(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 = buildUnnamed59();
- o.operationType = "foo";
- o.status = buildClusterOperationStatus();
- o.statusHistory = buildUnnamed60();
- o.warnings = buildUnnamed61();
- }
- 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'));
- checkUnnamed59(o.labels);
- unittest.expect(o.operationType, unittest.equals('foo'));
- checkClusterOperationStatus(o.status);
- checkUnnamed60(o.statusHistory);
- checkUnnamed61(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--;
-}
-
-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 buildCounterDiskConfig = 0;
-buildDiskConfig() {
- var o = new api.DiskConfig();
- buildCounterDiskConfig++;
- if (buildCounterDiskConfig < 3) {
- o.bootDiskSizeGb = 42;
- o.numLocalSsds = 42;
- }
- buildCounterDiskConfig--;
- return o;
-}
-
-checkDiskConfig(api.DiskConfig o) {
- buildCounterDiskConfig++;
- if (buildCounterDiskConfig < 3) {
- unittest.expect(o.bootDiskSizeGb, unittest.equals(42));
- 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--;
-}
-
-buildUnnamed62() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed62(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'));
-}
-
-buildUnnamed63() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed63(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'));
-}
-
-buildUnnamed64() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed64(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 = buildUnnamed62();
- o.networkUri = "foo";
- o.serviceAccount = "foo";
- o.serviceAccountScopes = buildUnnamed63();
- o.subnetworkUri = "foo";
- o.tags = buildUnnamed64();
- o.zoneUri = "foo";
- }
- buildCounterGceClusterConfig--;
- return o;
-}
-
-checkGceClusterConfig(api.GceClusterConfig o) {
- buildCounterGceClusterConfig++;
- if (buildCounterGceClusterConfig < 3) {
- unittest.expect(o.internalIpOnly, unittest.isTrue);
- checkUnnamed62(o.metadata);
- unittest.expect(o.networkUri, unittest.equals('foo'));
- unittest.expect(o.serviceAccount, unittest.equals('foo'));
- checkUnnamed63(o.serviceAccountScopes);
- unittest.expect(o.subnetworkUri, unittest.equals('foo'));
- checkUnnamed64(o.tags);
- unittest.expect(o.zoneUri, unittest.equals('foo'));
- }
- buildCounterGceClusterConfig--;
-}
-
-buildUnnamed65() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed65(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'));
-}
-
-buildUnnamed66() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed66(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'));
-}
-
-buildUnnamed67() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed67(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'));
-}
-
-buildUnnamed68() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed68(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'));
-}
-
-buildUnnamed69() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed69(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 = buildUnnamed65();
- o.args = buildUnnamed66();
- o.fileUris = buildUnnamed67();
- o.jarFileUris = buildUnnamed68();
- o.loggingConfig = buildLoggingConfig();
- o.mainClass = "foo";
- o.mainJarFileUri = "foo";
- o.properties = buildUnnamed69();
- }
- buildCounterHadoopJob--;
- return o;
-}
-
-checkHadoopJob(api.HadoopJob o) {
- buildCounterHadoopJob++;
- if (buildCounterHadoopJob < 3) {
- checkUnnamed65(o.archiveUris);
- checkUnnamed66(o.args);
- checkUnnamed67(o.fileUris);
- checkUnnamed68(o.jarFileUris);
- checkLoggingConfig(o.loggingConfig);
- unittest.expect(o.mainClass, unittest.equals('foo'));
- unittest.expect(o.mainJarFileUri, unittest.equals('foo'));
- checkUnnamed69(o.properties);
- }
- buildCounterHadoopJob--;
-}
-
-buildUnnamed70() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed70(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'));
-}
-
-buildUnnamed71() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed71(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'));
-}
-
-buildUnnamed72() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed72(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 = buildUnnamed70();
- o.properties = buildUnnamed71();
- o.queryFileUri = "foo";
- o.queryList = buildQueryList();
- o.scriptVariables = buildUnnamed72();
- }
- buildCounterHiveJob--;
- return o;
-}
-
-checkHiveJob(api.HiveJob o) {
- buildCounterHiveJob++;
- if (buildCounterHiveJob < 3) {
- unittest.expect(o.continueOnFailure, unittest.isTrue);
- checkUnnamed70(o.jarFileUris);
- checkUnnamed71(o.properties);
- unittest.expect(o.queryFileUri, unittest.equals('foo'));
- checkQueryList(o.queryList);
- checkUnnamed72(o.scriptVariables);
- }
- buildCounterHiveJob--;
-}
-
-buildUnnamed73() {
- var o = new core.List<api.AcceleratorConfig>();
- o.add(buildAcceleratorConfig());
- o.add(buildAcceleratorConfig());
- return o;
-}
-
-checkUnnamed73(core.List<api.AcceleratorConfig> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkAcceleratorConfig(o[0]);
- checkAcceleratorConfig(o[1]);
-}
-
-buildUnnamed74() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed74(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 = buildUnnamed73();
- o.diskConfig = buildDiskConfig();
- o.imageUri = "foo";
- o.instanceNames = buildUnnamed74();
- o.isPreemptible = true;
- o.machineTypeUri = "foo";
- o.managedGroupConfig = buildManagedGroupConfig();
- o.numInstances = 42;
- }
- buildCounterInstanceGroupConfig--;
- return o;
-}
-
-checkInstanceGroupConfig(api.InstanceGroupConfig o) {
- buildCounterInstanceGroupConfig++;
- if (buildCounterInstanceGroupConfig < 3) {
- checkUnnamed73(o.accelerators);
- checkDiskConfig(o.diskConfig);
- unittest.expect(o.imageUri, unittest.equals('foo'));
- checkUnnamed74(o.instanceNames);
- unittest.expect(o.isPreemptible, unittest.isTrue);
- unittest.expect(o.machineTypeUri, unittest.equals('foo'));
- checkManagedGroupConfig(o.managedGroupConfig);
- unittest.expect(o.numInstances, unittest.equals(42));
- }
- buildCounterInstanceGroupConfig--;
-}
-
-buildUnnamed75() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed75(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'));
-}
-
-buildUnnamed76() {
- var o = new core.List<api.JobStatus>();
- o.add(buildJobStatus());
- o.add(buildJobStatus());
- return o;
-}
-
-checkUnnamed76(core.List<api.JobStatus> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkJobStatus(o[0]);
- checkJobStatus(o[1]);
-}
-
-buildUnnamed77() {
- var o = new core.List<api.YarnApplication>();
- o.add(buildYarnApplication());
- o.add(buildYarnApplication());
- return o;
-}
-
-checkUnnamed77(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.driverControlFilesUri = "foo";
- o.driverOutputResourceUri = "foo";
- o.hadoopJob = buildHadoopJob();
- o.hiveJob = buildHiveJob();
- o.labels = buildUnnamed75();
- o.pigJob = buildPigJob();
- o.placement = buildJobPlacement();
- o.pysparkJob = buildPySparkJob();
- o.reference = buildJobReference();
- o.scheduling = buildJobScheduling();
- o.sparkJob = buildSparkJob();
- o.sparkSqlJob = buildSparkSqlJob();
- o.status = buildJobStatus();
- o.statusHistory = buildUnnamed76();
- o.yarnApplications = buildUnnamed77();
- }
- buildCounterJob--;
- return o;
-}
-
-checkJob(api.Job o) {
- buildCounterJob++;
- if (buildCounterJob < 3) {
- unittest.expect(o.driverControlFilesUri, unittest.equals('foo'));
- unittest.expect(o.driverOutputResourceUri, unittest.equals('foo'));
- checkHadoopJob(o.hadoopJob);
- checkHiveJob(o.hiveJob);
- checkUnnamed75(o.labels);
- checkPigJob(o.pigJob);
- checkJobPlacement(o.placement);
- checkPySparkJob(o.pysparkJob);
- checkJobReference(o.reference);
- checkJobScheduling(o.scheduling);
- checkSparkJob(o.sparkJob);
- checkSparkSqlJob(o.sparkSqlJob);
- checkJobStatus(o.status);
- checkUnnamed76(o.statusHistory);
- checkUnnamed77(o.yarnApplications);
- }
- buildCounterJob--;
-}
-
-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--;
-}
-
-buildUnnamed78() {
- var o = new core.List<api.Cluster>();
- o.add(buildCluster());
- o.add(buildCluster());
- return o;
-}
-
-checkUnnamed78(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 = buildUnnamed78();
- o.nextPageToken = "foo";
- }
- buildCounterListClustersResponse--;
- return o;
-}
-
-checkListClustersResponse(api.ListClustersResponse o) {
- buildCounterListClustersResponse++;
- if (buildCounterListClustersResponse < 3) {
- checkUnnamed78(o.clusters);
- unittest.expect(o.nextPageToken, unittest.equals('foo'));
- }
- buildCounterListClustersResponse--;
-}
-
-buildUnnamed79() {
- var o = new core.List<api.Job>();
- o.add(buildJob());
- o.add(buildJob());
- return o;
-}
-
-checkUnnamed79(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 = buildUnnamed79();
- o.nextPageToken = "foo";
- }
- buildCounterListJobsResponse--;
- return o;
-}
-
-checkListJobsResponse(api.ListJobsResponse o) {
- buildCounterListJobsResponse++;
- if (buildCounterListJobsResponse < 3) {
- checkUnnamed79(o.jobs);
- unittest.expect(o.nextPageToken, unittest.equals('foo'));
- }
- buildCounterListJobsResponse--;
-}
-
-buildUnnamed80() {
- var o = new core.List<api.Operation>();
- o.add(buildOperation());
- o.add(buildOperation());
- return o;
-}
-
-checkUnnamed80(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 = buildUnnamed80();
- }
- buildCounterListOperationsResponse--;
- return o;
-}
-
-checkListOperationsResponse(api.ListOperationsResponse o) {
- buildCounterListOperationsResponse++;
- if (buildCounterListOperationsResponse < 3) {
- unittest.expect(o.nextPageToken, unittest.equals('foo'));
- checkUnnamed80(o.operations);
- }
- buildCounterListOperationsResponse--;
-}
-
-buildUnnamed81() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed81(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 = buildUnnamed81();
- }
- buildCounterLoggingConfig--;
- return o;
-}
-
-checkLoggingConfig(api.LoggingConfig o) {
- buildCounterLoggingConfig++;
- if (buildCounterLoggingConfig < 3) {
- checkUnnamed81(o.driverLogLevels);
- }
- buildCounterLoggingConfig--;
-}
-
-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--;
-}
-
-buildUnnamed82() {
- 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;
-}
-
-checkUnnamed82(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'));
-}
-
-buildUnnamed83() {
- 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;
-}
-
-checkUnnamed83(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 = buildUnnamed82();
- o.name = "foo";
- o.response = buildUnnamed83();
- }
- buildCounterOperation--;
- return o;
-}
-
-checkOperation(api.Operation o) {
- buildCounterOperation++;
- if (buildCounterOperation < 3) {
- unittest.expect(o.done, unittest.isTrue);
- checkStatus(o.error);
- checkUnnamed82(o.metadata);
- unittest.expect(o.name, unittest.equals('foo'));
- checkUnnamed83(o.response);
- }
- buildCounterOperation--;
-}
-
-buildUnnamed84() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed84(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'));
-}
-
-buildUnnamed85() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed85(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'));
-}
-
-buildUnnamed86() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed86(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 = buildUnnamed84();
- o.loggingConfig = buildLoggingConfig();
- o.properties = buildUnnamed85();
- o.queryFileUri = "foo";
- o.queryList = buildQueryList();
- o.scriptVariables = buildUnnamed86();
- }
- buildCounterPigJob--;
- return o;
-}
-
-checkPigJob(api.PigJob o) {
- buildCounterPigJob++;
- if (buildCounterPigJob < 3) {
- unittest.expect(o.continueOnFailure, unittest.isTrue);
- checkUnnamed84(o.jarFileUris);
- checkLoggingConfig(o.loggingConfig);
- checkUnnamed85(o.properties);
- unittest.expect(o.queryFileUri, unittest.equals('foo'));
- checkQueryList(o.queryList);
- checkUnnamed86(o.scriptVariables);
- }
- buildCounterPigJob--;
-}
-
-buildUnnamed87() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed87(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'));
-}
-
-buildUnnamed88() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed88(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'));
-}
-
-buildUnnamed89() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed89(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'));
-}
-
-buildUnnamed90() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed90(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'));
-}
-
-buildUnnamed91() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed91(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'));
-}
-
-buildUnnamed92() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed92(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 = buildUnnamed87();
- o.args = buildUnnamed88();
- o.fileUris = buildUnnamed89();
- o.jarFileUris = buildUnnamed90();
- o.loggingConfig = buildLoggingConfig();
- o.mainPythonFileUri = "foo";
- o.properties = buildUnnamed91();
- o.pythonFileUris = buildUnnamed92();
- }
- buildCounterPySparkJob--;
- return o;
-}
-
-checkPySparkJob(api.PySparkJob o) {
- buildCounterPySparkJob++;
- if (buildCounterPySparkJob < 3) {
- checkUnnamed87(o.archiveUris);
- checkUnnamed88(o.args);
- checkUnnamed89(o.fileUris);
- checkUnnamed90(o.jarFileUris);
- checkLoggingConfig(o.loggingConfig);
- unittest.expect(o.mainPythonFileUri, unittest.equals('foo'));
- checkUnnamed91(o.properties);
- checkUnnamed92(o.pythonFileUris);
- }
- buildCounterPySparkJob--;
-}
-
-buildUnnamed93() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed93(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 = buildUnnamed93();
- }
- buildCounterQueryList--;
- return o;
-}
-
-checkQueryList(api.QueryList o) {
- buildCounterQueryList++;
- if (buildCounterQueryList < 3) {
- checkUnnamed93(o.queries);
- }
- buildCounterQueryList--;
-}
-
-buildUnnamed94() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed94(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.properties = buildUnnamed94();
- }
- buildCounterSoftwareConfig--;
- return o;
-}
-
-checkSoftwareConfig(api.SoftwareConfig o) {
- buildCounterSoftwareConfig++;
- if (buildCounterSoftwareConfig < 3) {
- unittest.expect(o.imageVersion, unittest.equals('foo'));
- checkUnnamed94(o.properties);
- }
- buildCounterSoftwareConfig--;
-}
-
-buildUnnamed95() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed95(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'));
-}
-
-buildUnnamed96() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed96(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'));
-}
-
-buildUnnamed97() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed97(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'));
-}
-
-buildUnnamed98() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed98(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'));
-}
-
-buildUnnamed99() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed99(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 = buildUnnamed95();
- o.args = buildUnnamed96();
- o.fileUris = buildUnnamed97();
- o.jarFileUris = buildUnnamed98();
- o.loggingConfig = buildLoggingConfig();
- o.mainClass = "foo";
- o.mainJarFileUri = "foo";
- o.properties = buildUnnamed99();
- }
- buildCounterSparkJob--;
- return o;
-}
-
-checkSparkJob(api.SparkJob o) {
- buildCounterSparkJob++;
- if (buildCounterSparkJob < 3) {
- checkUnnamed95(o.archiveUris);
- checkUnnamed96(o.args);
- checkUnnamed97(o.fileUris);
- checkUnnamed98(o.jarFileUris);
- checkLoggingConfig(o.loggingConfig);
- unittest.expect(o.mainClass, unittest.equals('foo'));
- unittest.expect(o.mainJarFileUri, unittest.equals('foo'));
- checkUnnamed99(o.properties);
- }
- buildCounterSparkJob--;
-}
-
-buildUnnamed100() {
- var o = new core.List<core.String>();
- o.add("foo");
- o.add("foo");
- return o;
-}
-
-checkUnnamed100(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'));
-}
-
-buildUnnamed101() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed101(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'));
-}
-
-buildUnnamed102() {
- var o = new core.Map<core.String, core.String>();
- o["x"] = "foo";
- o["y"] = "foo";
- return o;
-}
-
-checkUnnamed102(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 = buildUnnamed100();
- o.loggingConfig = buildLoggingConfig();
- o.properties = buildUnnamed101();
- o.queryFileUri = "foo";
- o.queryList = buildQueryList();
- o.scriptVariables = buildUnnamed102();
- }
- buildCounterSparkSqlJob--;
- return o;
-}
-
-checkSparkSqlJob(api.SparkSqlJob o) {
- buildCounterSparkSqlJob++;
- if (buildCounterSparkSqlJob < 3) {
- checkUnnamed100(o.jarFileUris);
- checkLoggingConfig(o.loggingConfig);
- checkUnnamed101(o.properties);
- unittest.expect(o.queryFileUri, unittest.equals('foo'));
- checkQueryList(o.queryList);
- checkUnnamed102(o.scriptVariables);
- }
- buildCounterSparkSqlJob--;
-}
-
-buildUnnamed103() {
- 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;
-}
-
-checkUnnamed103(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'));
-}
-
-buildUnnamed104() {
- var o = new core.List<core.Map<core.String, core.Object>>();
- o.add(buildUnnamed103());
- o.add(buildUnnamed103());
- return o;
-}
-
-checkUnnamed104(core.List<core.Map<core.String, core.Object>> o) {
- unittest.expect(o, unittest.hasLength(2));
- checkUnnamed103(o[0]);
- checkUnnamed103(o[1]);
-}
-
-core.int buildCounterStatus = 0;
-buildStatus() {
- var o = new api.Status();
- buildCounterStatus++;
- if (buildCounterStatus < 3) {
- o.code = 42;
- o.details = buildUnnamed104();
- o.message = "foo";
- }
- buildCounterStatus--;
- return o;
-}
-
-checkStatus(api.Status o) {
- buildCounterStatus++;
- if (buildCounterStatus < 3) {
- unittest.expect(o.code, unittest.equals(42));
- checkUnnamed104(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();
- }
- buildCounterSubmitJobRequest--;
- return o;
-}
-
-checkSubmitJobRequest(api.SubmitJobRequest o) {
- buildCounterSubmitJobRequest++;
- if (buildCounterSubmitJobRequest < 3) {
- checkJob(o.job);
- }
- buildCounterSubmitJobRequest--;
-}
-
-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-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-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-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-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-GceClusterConfig", () {
- unittest.test("to-json--from-json", () {
- var o = buildGceClusterConfig();
- var od = new api.GceClusterConfig.fromJson(o.toJson());
- checkGceClusterConfig(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-InstanceGroupConfig", () {
- unittest.test("to-json--from-json", () {
- var o = buildInstanceGroupConfig();
- var od = new api.InstanceGroupConfig.fromJson(o.toJson());
- checkInstanceGroupConfig(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-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-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-LoggingConfig", () {
- unittest.test("to-json--from-json", () {
- var o = buildLoggingConfig();
- var od = new api.LoggingConfig.fromJson(o.toJson());
- checkLoggingConfig(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-PigJob", () {
- unittest.test("to-json--from-json", () {
- var o = buildPigJob();
- var od = new api.PigJob.fromJson(o.toJson());
- checkPigJob(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-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-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-YarnApplication", () {
- unittest.test("to-json--from-json", () {
- var o = buildYarnApplication();
- var od = new api.YarnApplication.fromJson(o.toJson());
- checkYarnApplication(od);
- });
- });
-
-
- 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Operation 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Operation 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Operation 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Cluster response) {
- checkCluster(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;
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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));
-
-
- 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).then(unittest.expectAsync1(((api.ListClustersResponse 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_updateMask = "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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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));
-
-
- 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, updateMask: arg_updateMask).then(unittest.expectAsync1(((api.Operation response) {
- checkOperation(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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Job 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Empty 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Job response) {
- checkJob(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_filter = "foo";
- var arg_jobStateMatcher = "foo";
- var arg_pageToken = "foo";
- var arg_pageSize = 42;
- var arg_clusterName = "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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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["jobStateMatcher"].first, unittest.equals(arg_jobStateMatcher));
- unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken));
- unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equals(arg_pageSize));
- unittest.expect(queryMap["clusterName"].first, unittest.equals(arg_clusterName));
-
-
- 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, filter: arg_filter, jobStateMatcher: arg_jobStateMatcher, pageToken: arg_pageToken, pageSize: arg_pageSize, clusterName: arg_clusterName).then(unittest.expectAsync1(((api.ListJobsResponse 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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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));
-
-
- 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).then(unittest.expectAsync1(((api.Job response) {
- checkJob(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";
- 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 + 17), unittest.equals("v1beta2/projects/"));
- pathOffset += 17;
- 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 = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Job response) {
- checkJob(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";
- 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 + 8), unittest.equals("v1beta2/"));
- pathOffset += 8;
- // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Empty 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";
- 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 + 8), unittest.equals("v1beta2/"));
- pathOffset += 8;
- // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Empty 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";
- 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 + 8), unittest.equals("v1beta2/"));
- pathOffset += 8;
- // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- 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]));
- }
- }
-
-
- 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).then(unittest.expectAsync1(((api.Operation response) {
- checkOperation(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_pageSize = 42;
- var arg_filter = "foo";
- var arg_pageToken = "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 + 8), unittest.equals("v1beta2/"));
- pathOffset += 8;
- // NOTE: We cannot test reserved expansions due to the inability to reverse the operation;
-
- var query = (req.url).query;
- var queryOffset = 0;
- var queryMap = {};
- 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["filter"].first, unittest.equals(arg_filter));
- unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken));
-
-
- 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, pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageToken).then(unittest.expectAsync1(((api.ListOperationsResponse response) {
- checkListOperationsResponse(response);
- })));
- });
-
- });
-
-
-}
-
« no previous file with comments | « generated/googleapis/test/dataproc/v1_test.dart ('k') | generated/googleapis/test/datastore/v1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698