Index: generated/googleapis/test/container/v1_test.dart |
diff --git a/generated/googleapis_beta/test/container/v1beta1_test.dart b/generated/googleapis/test/container/v1_test.dart |
similarity index 61% |
copy from generated/googleapis_beta/test/container/v1beta1_test.dart |
copy to generated/googleapis/test/container/v1_test.dart |
index 1bf055a0a585184c6b0aea2e4846a571e909598b..5c8af7e05dfe51845652812d15aa93763a65105c 100644 |
--- a/generated/googleapis_beta/test/container/v1beta1_test.dart |
+++ b/generated/googleapis/test/container/v1_test.dart |
@@ -1,4 +1,4 @@ |
-library googleapis_beta.container.v1beta1.test; |
+library googleapis.container.v1.test; |
import "dart:core" as core; |
import "dart:collection" as collection; |
@@ -9,7 +9,7 @@ import 'package:http/http.dart' as http; |
import 'package:http/testing.dart' as http_testing; |
import 'package:unittest/unittest.dart' as unittest; |
-import 'package:googleapis_beta/container/v1beta1.dart' as api; |
+import 'package:googleapis/container/v1.dart' as api; |
class HttpServerMock extends http.BaseClient { |
core.Function _callback; |
@@ -51,14 +51,14 @@ http.StreamedResponse stringResponse( |
return new http.StreamedResponse(stream, status, headers: headers); |
} |
-buildUnnamed1587() { |
+buildUnnamed649() { |
var o = new core.List<core.String>(); |
o.add("foo"); |
o.add("foo"); |
return o; |
} |
-checkUnnamed1587(core.List<core.String> o) { |
+checkUnnamed649(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')); |
@@ -69,20 +69,22 @@ buildCluster() { |
var o = new api.Cluster(); |
buildCounterCluster++; |
if (buildCounterCluster < 3) { |
- o.clusterApiVersion = "foo"; |
- o.containerIpv4Cidr = "foo"; |
- o.creationTimestamp = "foo"; |
+ o.clusterIpv4Cidr = "foo"; |
+ o.createTime = "foo"; |
+ o.currentMasterVersion = "foo"; |
+ o.currentNodeVersion = "foo"; |
o.description = "foo"; |
- o.enableCloudLogging = true; |
- o.enableCloudMonitoring = true; |
o.endpoint = "foo"; |
- o.instanceGroupUrls = buildUnnamed1587(); |
+ o.initialClusterVersion = "foo"; |
+ o.initialNodeCount = 42; |
+ o.instanceGroupUrls = buildUnnamed649(); |
+ o.loggingService = "foo"; |
o.masterAuth = buildMasterAuth(); |
+ o.monitoringService = "foo"; |
o.name = "foo"; |
o.network = "foo"; |
o.nodeConfig = buildNodeConfig(); |
- o.nodeRoutingPrefixSize = 42; |
- o.numNodes = 42; |
+ o.nodeIpv4CidrSize = 42; |
o.selfLink = "foo"; |
o.servicesIpv4Cidr = "foo"; |
o.status = "foo"; |
@@ -96,20 +98,22 @@ buildCluster() { |
checkCluster(api.Cluster o) { |
buildCounterCluster++; |
if (buildCounterCluster < 3) { |
- unittest.expect(o.clusterApiVersion, unittest.equals('foo')); |
- unittest.expect(o.containerIpv4Cidr, unittest.equals('foo')); |
- unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
+ unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); |
+ unittest.expect(o.createTime, unittest.equals('foo')); |
+ unittest.expect(o.currentMasterVersion, unittest.equals('foo')); |
+ unittest.expect(o.currentNodeVersion, unittest.equals('foo')); |
unittest.expect(o.description, unittest.equals('foo')); |
- unittest.expect(o.enableCloudLogging, unittest.isTrue); |
- unittest.expect(o.enableCloudMonitoring, unittest.isTrue); |
unittest.expect(o.endpoint, unittest.equals('foo')); |
- checkUnnamed1587(o.instanceGroupUrls); |
+ unittest.expect(o.initialClusterVersion, unittest.equals('foo')); |
+ unittest.expect(o.initialNodeCount, unittest.equals(42)); |
+ checkUnnamed649(o.instanceGroupUrls); |
+ unittest.expect(o.loggingService, unittest.equals('foo')); |
checkMasterAuth(o.masterAuth); |
+ unittest.expect(o.monitoringService, unittest.equals('foo')); |
unittest.expect(o.name, unittest.equals('foo')); |
unittest.expect(o.network, unittest.equals('foo')); |
checkNodeConfig(o.nodeConfig); |
- unittest.expect(o.nodeRoutingPrefixSize, unittest.equals(42)); |
- unittest.expect(o.numNodes, unittest.equals(42)); |
+ unittest.expect(o.nodeIpv4CidrSize, unittest.equals(42)); |
unittest.expect(o.selfLink, unittest.equals('foo')); |
unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); |
unittest.expect(o.status, unittest.equals('foo')); |
@@ -119,6 +123,25 @@ checkCluster(api.Cluster o) { |
buildCounterCluster--; |
} |
+core.int buildCounterClusterUpdate = 0; |
+buildClusterUpdate() { |
+ var o = new api.ClusterUpdate(); |
+ buildCounterClusterUpdate++; |
+ if (buildCounterClusterUpdate < 3) { |
+ o.desiredNodeVersion = "foo"; |
+ } |
+ buildCounterClusterUpdate--; |
+ return o; |
+} |
+ |
+checkClusterUpdate(api.ClusterUpdate o) { |
+ buildCounterClusterUpdate++; |
+ if (buildCounterClusterUpdate < 3) { |
+ unittest.expect(o.desiredNodeVersion, unittest.equals('foo')); |
+ } |
+ buildCounterClusterUpdate--; |
+} |
+ |
core.int buildCounterCreateClusterRequest = 0; |
buildCreateClusterRequest() { |
var o = new api.CreateClusterRequest(); |
@@ -138,78 +161,14 @@ checkCreateClusterRequest(api.CreateClusterRequest o) { |
buildCounterCreateClusterRequest--; |
} |
-buildUnnamed1588() { |
+buildUnnamed650() { |
var o = new core.List<api.Cluster>(); |
o.add(buildCluster()); |
o.add(buildCluster()); |
return o; |
} |
-checkUnnamed1588(core.List<api.Cluster> o) { |
- unittest.expect(o, unittest.hasLength(2)); |
- checkCluster(o[0]); |
- checkCluster(o[1]); |
-} |
- |
-core.int buildCounterListAggregatedClustersResponse = 0; |
-buildListAggregatedClustersResponse() { |
- var o = new api.ListAggregatedClustersResponse(); |
- buildCounterListAggregatedClustersResponse++; |
- if (buildCounterListAggregatedClustersResponse < 3) { |
- o.clusters = buildUnnamed1588(); |
- } |
- buildCounterListAggregatedClustersResponse--; |
- return o; |
-} |
- |
-checkListAggregatedClustersResponse(api.ListAggregatedClustersResponse o) { |
- buildCounterListAggregatedClustersResponse++; |
- if (buildCounterListAggregatedClustersResponse < 3) { |
- checkUnnamed1588(o.clusters); |
- } |
- buildCounterListAggregatedClustersResponse--; |
-} |
- |
-buildUnnamed1589() { |
- var o = new core.List<api.Operation>(); |
- o.add(buildOperation()); |
- o.add(buildOperation()); |
- return o; |
-} |
- |
-checkUnnamed1589(core.List<api.Operation> o) { |
- unittest.expect(o, unittest.hasLength(2)); |
- checkOperation(o[0]); |
- checkOperation(o[1]); |
-} |
- |
-core.int buildCounterListAggregatedOperationsResponse = 0; |
-buildListAggregatedOperationsResponse() { |
- var o = new api.ListAggregatedOperationsResponse(); |
- buildCounterListAggregatedOperationsResponse++; |
- if (buildCounterListAggregatedOperationsResponse < 3) { |
- o.operations = buildUnnamed1589(); |
- } |
- buildCounterListAggregatedOperationsResponse--; |
- return o; |
-} |
- |
-checkListAggregatedOperationsResponse(api.ListAggregatedOperationsResponse o) { |
- buildCounterListAggregatedOperationsResponse++; |
- if (buildCounterListAggregatedOperationsResponse < 3) { |
- checkUnnamed1589(o.operations); |
- } |
- buildCounterListAggregatedOperationsResponse--; |
-} |
- |
-buildUnnamed1590() { |
- var o = new core.List<api.Cluster>(); |
- o.add(buildCluster()); |
- o.add(buildCluster()); |
- return o; |
-} |
- |
-checkUnnamed1590(core.List<api.Cluster> o) { |
+checkUnnamed650(core.List<api.Cluster> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkCluster(o[0]); |
checkCluster(o[1]); |
@@ -220,7 +179,7 @@ buildListClustersResponse() { |
var o = new api.ListClustersResponse(); |
buildCounterListClustersResponse++; |
if (buildCounterListClustersResponse < 3) { |
- o.clusters = buildUnnamed1590(); |
+ o.clusters = buildUnnamed650(); |
} |
buildCounterListClustersResponse--; |
return o; |
@@ -229,19 +188,19 @@ buildListClustersResponse() { |
checkListClustersResponse(api.ListClustersResponse o) { |
buildCounterListClustersResponse++; |
if (buildCounterListClustersResponse < 3) { |
- checkUnnamed1590(o.clusters); |
+ checkUnnamed650(o.clusters); |
} |
buildCounterListClustersResponse--; |
} |
-buildUnnamed1591() { |
+buildUnnamed651() { |
var o = new core.List<api.Operation>(); |
o.add(buildOperation()); |
o.add(buildOperation()); |
return o; |
} |
-checkUnnamed1591(core.List<api.Operation> o) { |
+checkUnnamed651(core.List<api.Operation> o) { |
unittest.expect(o, unittest.hasLength(2)); |
checkOperation(o[0]); |
checkOperation(o[1]); |
@@ -252,7 +211,7 @@ buildListOperationsResponse() { |
var o = new api.ListOperationsResponse(); |
buildCounterListOperationsResponse++; |
if (buildCounterListOperationsResponse < 3) { |
- o.operations = buildUnnamed1591(); |
+ o.operations = buildUnnamed651(); |
} |
buildCounterListOperationsResponse--; |
return o; |
@@ -261,7 +220,7 @@ buildListOperationsResponse() { |
checkListOperationsResponse(api.ListOperationsResponse o) { |
buildCounterListOperationsResponse++; |
if (buildCounterListOperationsResponse < 3) { |
- checkUnnamed1591(o.operations); |
+ checkUnnamed651(o.operations); |
} |
buildCounterListOperationsResponse--; |
} |
@@ -271,12 +230,11 @@ buildMasterAuth() { |
var o = new api.MasterAuth(); |
buildCounterMasterAuth++; |
if (buildCounterMasterAuth < 3) { |
- o.bearerToken = "foo"; |
o.clientCertificate = "foo"; |
o.clientKey = "foo"; |
o.clusterCaCertificate = "foo"; |
o.password = "foo"; |
- o.user = "foo"; |
+ o.username = "foo"; |
} |
buildCounterMasterAuth--; |
return o; |
@@ -285,27 +243,26 @@ buildMasterAuth() { |
checkMasterAuth(api.MasterAuth o) { |
buildCounterMasterAuth++; |
if (buildCounterMasterAuth < 3) { |
- unittest.expect(o.bearerToken, unittest.equals('foo')); |
unittest.expect(o.clientCertificate, unittest.equals('foo')); |
unittest.expect(o.clientKey, unittest.equals('foo')); |
unittest.expect(o.clusterCaCertificate, unittest.equals('foo')); |
unittest.expect(o.password, unittest.equals('foo')); |
- unittest.expect(o.user, unittest.equals('foo')); |
+ unittest.expect(o.username, unittest.equals('foo')); |
} |
buildCounterMasterAuth--; |
} |
-buildUnnamed1592() { |
- var o = new core.List<api.ServiceAccount>(); |
- o.add(buildServiceAccount()); |
- o.add(buildServiceAccount()); |
+buildUnnamed652() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
return o; |
} |
-checkUnnamed1592(core.List<api.ServiceAccount> o) { |
+checkUnnamed652(core.List<core.String> o) { |
unittest.expect(o, unittest.hasLength(2)); |
- checkServiceAccount(o[0]); |
- checkServiceAccount(o[1]); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
} |
core.int buildCounterNodeConfig = 0; |
@@ -313,9 +270,9 @@ buildNodeConfig() { |
var o = new api.NodeConfig(); |
buildCounterNodeConfig++; |
if (buildCounterNodeConfig < 3) { |
+ o.diskSizeGb = 42; |
o.machineType = "foo"; |
- o.serviceAccounts = buildUnnamed1592(); |
- o.sourceImage = "foo"; |
+ o.oauthScopes = buildUnnamed652(); |
} |
buildCounterNodeConfig--; |
return o; |
@@ -324,9 +281,9 @@ buildNodeConfig() { |
checkNodeConfig(api.NodeConfig o) { |
buildCounterNodeConfig++; |
if (buildCounterNodeConfig < 3) { |
+ unittest.expect(o.diskSizeGb, unittest.equals(42)); |
unittest.expect(o.machineType, unittest.equals('foo')); |
- checkUnnamed1592(o.serviceAccounts); |
- unittest.expect(o.sourceImage, unittest.equals('foo')); |
+ checkUnnamed652(o.oauthScopes); |
} |
buildCounterNodeConfig--; |
} |
@@ -336,12 +293,11 @@ buildOperation() { |
var o = new api.Operation(); |
buildCounterOperation++; |
if (buildCounterOperation < 3) { |
- o.errorMessage = "foo"; |
o.name = "foo"; |
o.operationType = "foo"; |
o.selfLink = "foo"; |
o.status = "foo"; |
- o.target = "foo"; |
+ o.statusMessage = "foo"; |
o.targetLink = "foo"; |
o.zone = "foo"; |
} |
@@ -352,50 +308,34 @@ buildOperation() { |
checkOperation(api.Operation o) { |
buildCounterOperation++; |
if (buildCounterOperation < 3) { |
- unittest.expect(o.errorMessage, unittest.equals('foo')); |
unittest.expect(o.name, unittest.equals('foo')); |
unittest.expect(o.operationType, unittest.equals('foo')); |
unittest.expect(o.selfLink, unittest.equals('foo')); |
unittest.expect(o.status, unittest.equals('foo')); |
- unittest.expect(o.target, unittest.equals('foo')); |
+ unittest.expect(o.statusMessage, unittest.equals('foo')); |
unittest.expect(o.targetLink, unittest.equals('foo')); |
unittest.expect(o.zone, unittest.equals('foo')); |
} |
buildCounterOperation--; |
} |
-buildUnnamed1593() { |
- var o = new core.List<core.String>(); |
- o.add("foo"); |
- o.add("foo"); |
- return o; |
-} |
- |
-checkUnnamed1593(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 buildCounterServiceAccount = 0; |
-buildServiceAccount() { |
- var o = new api.ServiceAccount(); |
- buildCounterServiceAccount++; |
- if (buildCounterServiceAccount < 3) { |
- o.email = "foo"; |
- o.scopes = buildUnnamed1593(); |
+core.int buildCounterUpdateClusterRequest = 0; |
+buildUpdateClusterRequest() { |
+ var o = new api.UpdateClusterRequest(); |
+ buildCounterUpdateClusterRequest++; |
+ if (buildCounterUpdateClusterRequest < 3) { |
+ o.update = buildClusterUpdate(); |
} |
- buildCounterServiceAccount--; |
+ buildCounterUpdateClusterRequest--; |
return o; |
} |
-checkServiceAccount(api.ServiceAccount o) { |
- buildCounterServiceAccount++; |
- if (buildCounterServiceAccount < 3) { |
- unittest.expect(o.email, unittest.equals('foo')); |
- checkUnnamed1593(o.scopes); |
+checkUpdateClusterRequest(api.UpdateClusterRequest o) { |
+ buildCounterUpdateClusterRequest++; |
+ if (buildCounterUpdateClusterRequest < 3) { |
+ checkClusterUpdate(o.update); |
} |
- buildCounterServiceAccount--; |
+ buildCounterUpdateClusterRequest--; |
} |
@@ -409,29 +349,20 @@ main() { |
}); |
- unittest.group("obj-schema-CreateClusterRequest", () { |
+ unittest.group("obj-schema-ClusterUpdate", () { |
unittest.test("to-json--from-json", () { |
- var o = buildCreateClusterRequest(); |
- var od = new api.CreateClusterRequest.fromJson(o.toJson()); |
- checkCreateClusterRequest(od); |
+ var o = buildClusterUpdate(); |
+ var od = new api.ClusterUpdate.fromJson(o.toJson()); |
+ checkClusterUpdate(od); |
}); |
}); |
- unittest.group("obj-schema-ListAggregatedClustersResponse", () { |
- unittest.test("to-json--from-json", () { |
- var o = buildListAggregatedClustersResponse(); |
- var od = new api.ListAggregatedClustersResponse.fromJson(o.toJson()); |
- checkListAggregatedClustersResponse(od); |
- }); |
- }); |
- |
- |
- unittest.group("obj-schema-ListAggregatedOperationsResponse", () { |
+ unittest.group("obj-schema-CreateClusterRequest", () { |
unittest.test("to-json--from-json", () { |
- var o = buildListAggregatedOperationsResponse(); |
- var od = new api.ListAggregatedOperationsResponse.fromJson(o.toJson()); |
- checkListAggregatedOperationsResponse(od); |
+ var o = buildCreateClusterRequest(); |
+ var od = new api.CreateClusterRequest.fromJson(o.toJson()); |
+ checkCreateClusterRequest(od); |
}); |
}); |
@@ -481,74 +412,49 @@ main() { |
}); |
- unittest.group("obj-schema-ServiceAccount", () { |
+ unittest.group("obj-schema-UpdateClusterRequest", () { |
unittest.test("to-json--from-json", () { |
- var o = buildServiceAccount(); |
- var od = new api.ServiceAccount.fromJson(o.toJson()); |
- checkServiceAccount(od); |
+ var o = buildUpdateClusterRequest(); |
+ var od = new api.UpdateClusterRequest.fromJson(o.toJson()); |
+ checkUpdateClusterRequest(od); |
}); |
}); |
- unittest.group("resource-ProjectsClustersResourceApi", () { |
- unittest.test("method--list", () { |
+ unittest.group("resource-ProjectsZonesClustersResourceApi", () { |
+ unittest.test("method--create", () { |
var mock = new HttpServerMock(); |
- api.ProjectsClustersResourceApi res = new api.ContainerApi(mock).projects.clusters; |
+ api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).projects.zones.clusters; |
+ var arg_request = buildCreateClusterRequest(); |
var arg_projectId = "foo"; |
+ var arg_zone = "foo"; |
mock.register(unittest.expectAsync((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; |
- |
- 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(buildListAggregatedClustersResponse()); |
- return new async.Future.value(stringResponse(200, h, resp)); |
- }), true); |
- res.list(arg_projectId).then(unittest.expectAsync(((api.ListAggregatedClustersResponse response) { |
- checkListAggregatedClustersResponse(response); |
- }))); |
- }); |
- |
- }); |
- |
- |
- unittest.group("resource-ProjectsOperationsResourceApi", () { |
- unittest.test("method--list", () { |
+ var obj = new api.CreateClusterRequest.fromJson(json); |
+ checkCreateClusterRequest(obj); |
- var mock = new HttpServerMock(); |
- api.ProjectsOperationsResourceApi res = new api.ContainerApi(mock).projects.operations; |
- var arg_projectId = "foo"; |
- mock.register(unittest.expectAsync((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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ 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_zone")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/clusters")); |
+ pathOffset += 9; |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -571,35 +477,47 @@ main() { |
var h = { |
"content-type" : "application/json; charset=utf-8", |
}; |
- var resp = convert.JSON.encode(buildListAggregatedOperationsResponse()); |
+ var resp = convert.JSON.encode(buildOperation()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.list(arg_projectId).then(unittest.expectAsync(((api.ListAggregatedOperationsResponse response) { |
- checkListAggregatedOperationsResponse(response); |
+ res.create(arg_request, arg_projectId, arg_zone).then(unittest.expectAsync(((api.Operation response) { |
+ checkOperation(response); |
}))); |
}); |
- }); |
- |
- |
- unittest.group("resource-ProjectsZonesClustersResourceApi", () { |
- unittest.test("method--create", () { |
+ unittest.test("method--delete", () { |
var mock = new HttpServerMock(); |
api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).projects.zones.clusters; |
- var arg_request = buildCreateClusterRequest(); |
var arg_projectId = "foo"; |
- var arg_zoneId = "foo"; |
+ var arg_zone = "foo"; |
+ var arg_clusterId = "foo"; |
mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
- var obj = new api.CreateClusterRequest.fromJson(json); |
- checkCreateClusterRequest(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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ 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_zone")); |
+ 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_clusterId")); |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -625,17 +543,17 @@ main() { |
var resp = convert.JSON.encode(buildOperation()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.create(arg_request, arg_projectId, arg_zoneId).then(unittest.expectAsync(((api.Operation response) { |
+ res.delete(arg_projectId, arg_zone, arg_clusterId).then(unittest.expectAsync(((api.Operation response) { |
checkOperation(response); |
}))); |
}); |
- unittest.test("method--delete", () { |
+ unittest.test("method--get", () { |
var mock = new HttpServerMock(); |
api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).projects.zones.clusters; |
var arg_projectId = "foo"; |
- var arg_zoneId = "foo"; |
+ var arg_zone = "foo"; |
var arg_clusterId = "foo"; |
mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
var path = (req.url).path; |
@@ -644,6 +562,25 @@ main() { |
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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ 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_zone")); |
+ 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_clusterId")); |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -666,21 +603,20 @@ main() { |
var h = { |
"content-type" : "application/json; charset=utf-8", |
}; |
- var resp = convert.JSON.encode(buildOperation()); |
+ var resp = convert.JSON.encode(buildCluster()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.delete(arg_projectId, arg_zoneId, arg_clusterId).then(unittest.expectAsync(((api.Operation response) { |
- checkOperation(response); |
+ res.get(arg_projectId, arg_zone, arg_clusterId).then(unittest.expectAsync(((api.Cluster response) { |
+ checkCluster(response); |
}))); |
}); |
- unittest.test("method--get", () { |
+ unittest.test("method--list", () { |
var mock = new HttpServerMock(); |
api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).projects.zones.clusters; |
var arg_projectId = "foo"; |
- var arg_zoneId = "foo"; |
- var arg_clusterId = "foo"; |
+ var arg_zone = "foo"; |
mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
var path = (req.url).path; |
var pathOffset = 0; |
@@ -688,6 +624,22 @@ main() { |
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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ 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_zone")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("/clusters")); |
+ pathOffset += 9; |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -710,27 +662,51 @@ main() { |
var h = { |
"content-type" : "application/json; charset=utf-8", |
}; |
- var resp = convert.JSON.encode(buildCluster()); |
+ var resp = convert.JSON.encode(buildListClustersResponse()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.get(arg_projectId, arg_zoneId, arg_clusterId).then(unittest.expectAsync(((api.Cluster response) { |
- checkCluster(response); |
+ res.list(arg_projectId, arg_zone).then(unittest.expectAsync(((api.ListClustersResponse response) { |
+ checkListClustersResponse(response); |
}))); |
}); |
- unittest.test("method--list", () { |
+ unittest.test("method--update", () { |
var mock = new HttpServerMock(); |
api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).projects.zones.clusters; |
+ var arg_request = buildUpdateClusterRequest(); |
var arg_projectId = "foo"; |
- var arg_zoneId = "foo"; |
+ var arg_zone = "foo"; |
+ var arg_clusterId = "foo"; |
mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.UpdateClusterRequest.fromJson(json); |
+ checkUpdateClusterRequest(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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ 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_zone")); |
+ 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_clusterId")); |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -753,11 +729,11 @@ main() { |
var h = { |
"content-type" : "application/json; charset=utf-8", |
}; |
- var resp = convert.JSON.encode(buildListClustersResponse()); |
+ var resp = convert.JSON.encode(buildOperation()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.list(arg_projectId, arg_zoneId).then(unittest.expectAsync(((api.ListClustersResponse response) { |
- checkListClustersResponse(response); |
+ res.update(arg_request, arg_projectId, arg_zone, arg_clusterId).then(unittest.expectAsync(((api.Operation response) { |
+ checkOperation(response); |
}))); |
}); |
@@ -770,7 +746,7 @@ main() { |
var mock = new HttpServerMock(); |
api.ProjectsZonesOperationsResourceApi res = new api.ContainerApi(mock).projects.zones.operations; |
var arg_projectId = "foo"; |
- var arg_zoneId = "foo"; |
+ var arg_zone = "foo"; |
var arg_operationId = "foo"; |
mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
var path = (req.url).path; |
@@ -779,6 +755,25 @@ main() { |
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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ index = path.indexOf("/operations/", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_zone")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("/operations/")); |
+ pathOffset += 12; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_operationId")); |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -804,7 +799,7 @@ main() { |
var resp = convert.JSON.encode(buildOperation()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.get(arg_projectId, arg_zoneId, arg_operationId).then(unittest.expectAsync(((api.Operation response) { |
+ res.get(arg_projectId, arg_zone, arg_operationId).then(unittest.expectAsync(((api.Operation response) { |
checkOperation(response); |
}))); |
}); |
@@ -814,7 +809,7 @@ main() { |
var mock = new HttpServerMock(); |
api.ProjectsZonesOperationsResourceApi res = new api.ContainerApi(mock).projects.zones.operations; |
var arg_projectId = "foo"; |
- var arg_zoneId = "foo"; |
+ var arg_zone = "foo"; |
mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
var path = (req.url).path; |
var pathOffset = 0; |
@@ -822,6 +817,22 @@ main() { |
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("/zones/", 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 + 7), unittest.equals("/zones/")); |
+ pathOffset += 7; |
+ index = path.indexOf("/operations", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_zone")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("/operations")); |
+ pathOffset += 11; |
var query = (req.url).query; |
var queryOffset = 0; |
@@ -847,7 +858,7 @@ main() { |
var resp = convert.JSON.encode(buildListOperationsResponse()); |
return new async.Future.value(stringResponse(200, h, resp)); |
}), true); |
- res.list(arg_projectId, arg_zoneId).then(unittest.expectAsync(((api.ListOperationsResponse response) { |
+ res.list(arg_projectId, arg_zone).then(unittest.expectAsync(((api.ListOperationsResponse response) { |
checkListOperationsResponse(response); |
}))); |
}); |