| OLD | NEW |
| 1 library googleapis.container.v1.test; | 1 library googleapis.container.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | 4 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
| 7 | 6 |
| 8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
| 11 | 9 |
| 12 import 'package:googleapis/container/v1.dart' as api; | 10 import 'package:googleapis/container/v1.dart' as api; |
| 13 | 11 |
| 14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 13 core.Function _callback; |
| 16 core.bool _expectJson; | 14 core.bool _expectJson; |
| 17 | 15 |
| 18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 17 _callback = callback; |
| 20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
| 21 } | 19 } |
| 22 | 20 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { | 22 if (_expectJson) { |
| 25 return request.finalize() | 23 return request |
| 24 .finalize() |
| 26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
| 27 .join('') | 26 .join('') |
| 28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); | 29 return _callback(request, null); |
| 31 } else { | 30 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } | 32 } |
| 34 }); | 33 }); |
| 35 } else { | 34 } else { |
| 36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
| 37 if (stream == null) { | 36 if (stream == null) { |
| 38 return _callback(request, []); | 37 return _callback(request, []); |
| 39 } else { | 38 } else { |
| 40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 40 return _callback(request, data); |
| 42 }); | 41 }); |
| 43 } | 42 } |
| 44 } | 43 } |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 | 46 |
| 48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
| 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 51 } |
| 53 | 52 |
| 54 core.int buildCounterAcceleratorConfig = 0; | 53 core.int buildCounterAcceleratorConfig = 0; |
| 55 buildAcceleratorConfig() { | 54 buildAcceleratorConfig() { |
| 56 var o = new api.AcceleratorConfig(); | 55 var o = new api.AcceleratorConfig(); |
| 57 buildCounterAcceleratorConfig++; | 56 buildCounterAcceleratorConfig++; |
| 58 if (buildCounterAcceleratorConfig < 3) { | 57 if (buildCounterAcceleratorConfig < 3) { |
| 59 o.acceleratorCount = "foo"; | 58 o.acceleratorCount = "foo"; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 unittest.expect(o.autoUpgradeStartTime, unittest.equals('foo')); | 112 unittest.expect(o.autoUpgradeStartTime, unittest.equals('foo')); |
| 114 unittest.expect(o.description, unittest.equals('foo')); | 113 unittest.expect(o.description, unittest.equals('foo')); |
| 115 } | 114 } |
| 116 buildCounterAutoUpgradeOptions--; | 115 buildCounterAutoUpgradeOptions--; |
| 117 } | 116 } |
| 118 | 117 |
| 119 core.int buildCounterCancelOperationRequest = 0; | 118 core.int buildCounterCancelOperationRequest = 0; |
| 120 buildCancelOperationRequest() { | 119 buildCancelOperationRequest() { |
| 121 var o = new api.CancelOperationRequest(); | 120 var o = new api.CancelOperationRequest(); |
| 122 buildCounterCancelOperationRequest++; | 121 buildCounterCancelOperationRequest++; |
| 123 if (buildCounterCancelOperationRequest < 3) { | 122 if (buildCounterCancelOperationRequest < 3) {} |
| 124 } | |
| 125 buildCounterCancelOperationRequest--; | 123 buildCounterCancelOperationRequest--; |
| 126 return o; | 124 return o; |
| 127 } | 125 } |
| 128 | 126 |
| 129 checkCancelOperationRequest(api.CancelOperationRequest o) { | 127 checkCancelOperationRequest(api.CancelOperationRequest o) { |
| 130 buildCounterCancelOperationRequest++; | 128 buildCounterCancelOperationRequest++; |
| 131 if (buildCounterCancelOperationRequest < 3) { | 129 if (buildCounterCancelOperationRequest < 3) {} |
| 132 } | |
| 133 buildCounterCancelOperationRequest--; | 130 buildCounterCancelOperationRequest--; |
| 134 } | 131 } |
| 135 | 132 |
| 136 core.int buildCounterCidrBlock = 0; | 133 core.int buildCounterCidrBlock = 0; |
| 137 buildCidrBlock() { | 134 buildCidrBlock() { |
| 138 var o = new api.CidrBlock(); | 135 var o = new api.CidrBlock(); |
| 139 buildCounterCidrBlock++; | 136 buildCounterCidrBlock++; |
| 140 if (buildCounterCidrBlock < 3) { | 137 if (buildCounterCidrBlock < 3) { |
| 141 o.cidrBlock = "foo"; | 138 o.cidrBlock = "foo"; |
| 142 o.displayName = "foo"; | 139 o.displayName = "foo"; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 166 } | 163 } |
| 167 | 164 |
| 168 checkClientCertificateConfig(api.ClientCertificateConfig o) { | 165 checkClientCertificateConfig(api.ClientCertificateConfig o) { |
| 169 buildCounterClientCertificateConfig++; | 166 buildCounterClientCertificateConfig++; |
| 170 if (buildCounterClientCertificateConfig < 3) { | 167 if (buildCounterClientCertificateConfig < 3) { |
| 171 unittest.expect(o.issueClientCertificate, unittest.isTrue); | 168 unittest.expect(o.issueClientCertificate, unittest.isTrue); |
| 172 } | 169 } |
| 173 buildCounterClientCertificateConfig--; | 170 buildCounterClientCertificateConfig--; |
| 174 } | 171 } |
| 175 | 172 |
| 176 buildUnnamed1864() { | 173 buildUnnamed1862() { |
| 177 var o = new core.List<core.String>(); | 174 var o = new core.List<core.String>(); |
| 178 o.add("foo"); | 175 o.add("foo"); |
| 179 o.add("foo"); | 176 o.add("foo"); |
| 180 return o; | 177 return o; |
| 181 } | 178 } |
| 182 | 179 |
| 183 checkUnnamed1864(core.List<core.String> o) { | 180 checkUnnamed1862(core.List<core.String> o) { |
| 184 unittest.expect(o, unittest.hasLength(2)); | 181 unittest.expect(o, unittest.hasLength(2)); |
| 185 unittest.expect(o[0], unittest.equals('foo')); | 182 unittest.expect(o[0], unittest.equals('foo')); |
| 186 unittest.expect(o[1], unittest.equals('foo')); | 183 unittest.expect(o[1], unittest.equals('foo')); |
| 187 } | 184 } |
| 188 | 185 |
| 189 buildUnnamed1865() { | 186 buildUnnamed1863() { |
| 190 var o = new core.List<core.String>(); | 187 var o = new core.List<core.String>(); |
| 191 o.add("foo"); | 188 o.add("foo"); |
| 192 o.add("foo"); | 189 o.add("foo"); |
| 193 return o; | 190 return o; |
| 194 } | 191 } |
| 195 | 192 |
| 196 checkUnnamed1865(core.List<core.String> o) { | 193 checkUnnamed1863(core.List<core.String> o) { |
| 197 unittest.expect(o, unittest.hasLength(2)); | 194 unittest.expect(o, unittest.hasLength(2)); |
| 198 unittest.expect(o[0], unittest.equals('foo')); | 195 unittest.expect(o[0], unittest.equals('foo')); |
| 199 unittest.expect(o[1], unittest.equals('foo')); | 196 unittest.expect(o[1], unittest.equals('foo')); |
| 200 } | 197 } |
| 201 | 198 |
| 202 buildUnnamed1866() { | 199 buildUnnamed1864() { |
| 203 var o = new core.List<api.NodePool>(); | 200 var o = new core.List<api.NodePool>(); |
| 204 o.add(buildNodePool()); | 201 o.add(buildNodePool()); |
| 205 o.add(buildNodePool()); | 202 o.add(buildNodePool()); |
| 206 return o; | 203 return o; |
| 207 } | 204 } |
| 208 | 205 |
| 209 checkUnnamed1866(core.List<api.NodePool> o) { | 206 checkUnnamed1864(core.List<api.NodePool> o) { |
| 210 unittest.expect(o, unittest.hasLength(2)); | 207 unittest.expect(o, unittest.hasLength(2)); |
| 211 checkNodePool(o[0]); | 208 checkNodePool(o[0]); |
| 212 checkNodePool(o[1]); | 209 checkNodePool(o[1]); |
| 213 } | 210 } |
| 214 | 211 |
| 215 buildUnnamed1867() { | 212 buildUnnamed1865() { |
| 216 var o = new core.Map<core.String, core.String>(); | 213 var o = new core.Map<core.String, core.String>(); |
| 217 o["x"] = "foo"; | 214 o["x"] = "foo"; |
| 218 o["y"] = "foo"; | 215 o["y"] = "foo"; |
| 219 return o; | 216 return o; |
| 220 } | 217 } |
| 221 | 218 |
| 222 checkUnnamed1867(core.Map<core.String, core.String> o) { | 219 checkUnnamed1865(core.Map<core.String, core.String> o) { |
| 223 unittest.expect(o, unittest.hasLength(2)); | 220 unittest.expect(o, unittest.hasLength(2)); |
| 224 unittest.expect(o["x"], unittest.equals('foo')); | 221 unittest.expect(o["x"], unittest.equals('foo')); |
| 225 unittest.expect(o["y"], unittest.equals('foo')); | 222 unittest.expect(o["y"], unittest.equals('foo')); |
| 226 } | 223 } |
| 227 | 224 |
| 228 core.int buildCounterCluster = 0; | 225 core.int buildCounterCluster = 0; |
| 229 buildCluster() { | 226 buildCluster() { |
| 230 var o = new api.Cluster(); | 227 var o = new api.Cluster(); |
| 231 buildCounterCluster++; | 228 buildCounterCluster++; |
| 232 if (buildCounterCluster < 3) { | 229 if (buildCounterCluster < 3) { |
| 233 o.addonsConfig = buildAddonsConfig(); | 230 o.addonsConfig = buildAddonsConfig(); |
| 234 o.clusterIpv4Cidr = "foo"; | 231 o.clusterIpv4Cidr = "foo"; |
| 235 o.createTime = "foo"; | 232 o.createTime = "foo"; |
| 236 o.currentMasterVersion = "foo"; | 233 o.currentMasterVersion = "foo"; |
| 237 o.currentNodeCount = 42; | 234 o.currentNodeCount = 42; |
| 238 o.currentNodeVersion = "foo"; | 235 o.currentNodeVersion = "foo"; |
| 239 o.description = "foo"; | 236 o.description = "foo"; |
| 240 o.enableKubernetesAlpha = true; | 237 o.enableKubernetesAlpha = true; |
| 241 o.endpoint = "foo"; | 238 o.endpoint = "foo"; |
| 242 o.expireTime = "foo"; | 239 o.expireTime = "foo"; |
| 243 o.initialClusterVersion = "foo"; | 240 o.initialClusterVersion = "foo"; |
| 244 o.initialNodeCount = 42; | 241 o.initialNodeCount = 42; |
| 245 o.instanceGroupUrls = buildUnnamed1864(); | 242 o.instanceGroupUrls = buildUnnamed1862(); |
| 246 o.ipAllocationPolicy = buildIPAllocationPolicy(); | 243 o.ipAllocationPolicy = buildIPAllocationPolicy(); |
| 247 o.labelFingerprint = "foo"; | 244 o.labelFingerprint = "foo"; |
| 248 o.legacyAbac = buildLegacyAbac(); | 245 o.legacyAbac = buildLegacyAbac(); |
| 249 o.locations = buildUnnamed1865(); | 246 o.locations = buildUnnamed1863(); |
| 250 o.loggingService = "foo"; | 247 o.loggingService = "foo"; |
| 251 o.masterAuth = buildMasterAuth(); | 248 o.masterAuth = buildMasterAuth(); |
| 252 o.masterAuthorizedNetworksConfig = buildMasterAuthorizedNetworksConfig(); | 249 o.masterAuthorizedNetworksConfig = buildMasterAuthorizedNetworksConfig(); |
| 253 o.monitoringService = "foo"; | 250 o.monitoringService = "foo"; |
| 254 o.name = "foo"; | 251 o.name = "foo"; |
| 255 o.network = "foo"; | 252 o.network = "foo"; |
| 256 o.networkPolicy = buildNetworkPolicy(); | 253 o.networkPolicy = buildNetworkPolicy(); |
| 257 o.nodeConfig = buildNodeConfig(); | 254 o.nodeConfig = buildNodeConfig(); |
| 258 o.nodeIpv4CidrSize = 42; | 255 o.nodeIpv4CidrSize = 42; |
| 259 o.nodePools = buildUnnamed1866(); | 256 o.nodePools = buildUnnamed1864(); |
| 260 o.resourceLabels = buildUnnamed1867(); | 257 o.resourceLabels = buildUnnamed1865(); |
| 261 o.selfLink = "foo"; | 258 o.selfLink = "foo"; |
| 262 o.servicesIpv4Cidr = "foo"; | 259 o.servicesIpv4Cidr = "foo"; |
| 263 o.status = "foo"; | 260 o.status = "foo"; |
| 264 o.statusMessage = "foo"; | 261 o.statusMessage = "foo"; |
| 265 o.subnetwork = "foo"; | 262 o.subnetwork = "foo"; |
| 266 o.zone = "foo"; | 263 o.zone = "foo"; |
| 267 } | 264 } |
| 268 buildCounterCluster--; | 265 buildCounterCluster--; |
| 269 return o; | 266 return o; |
| 270 } | 267 } |
| 271 | 268 |
| 272 checkCluster(api.Cluster o) { | 269 checkCluster(api.Cluster o) { |
| 273 buildCounterCluster++; | 270 buildCounterCluster++; |
| 274 if (buildCounterCluster < 3) { | 271 if (buildCounterCluster < 3) { |
| 275 checkAddonsConfig(o.addonsConfig); | 272 checkAddonsConfig(o.addonsConfig); |
| 276 unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); | 273 unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); |
| 277 unittest.expect(o.createTime, unittest.equals('foo')); | 274 unittest.expect(o.createTime, unittest.equals('foo')); |
| 278 unittest.expect(o.currentMasterVersion, unittest.equals('foo')); | 275 unittest.expect(o.currentMasterVersion, unittest.equals('foo')); |
| 279 unittest.expect(o.currentNodeCount, unittest.equals(42)); | 276 unittest.expect(o.currentNodeCount, unittest.equals(42)); |
| 280 unittest.expect(o.currentNodeVersion, unittest.equals('foo')); | 277 unittest.expect(o.currentNodeVersion, unittest.equals('foo')); |
| 281 unittest.expect(o.description, unittest.equals('foo')); | 278 unittest.expect(o.description, unittest.equals('foo')); |
| 282 unittest.expect(o.enableKubernetesAlpha, unittest.isTrue); | 279 unittest.expect(o.enableKubernetesAlpha, unittest.isTrue); |
| 283 unittest.expect(o.endpoint, unittest.equals('foo')); | 280 unittest.expect(o.endpoint, unittest.equals('foo')); |
| 284 unittest.expect(o.expireTime, unittest.equals('foo')); | 281 unittest.expect(o.expireTime, unittest.equals('foo')); |
| 285 unittest.expect(o.initialClusterVersion, unittest.equals('foo')); | 282 unittest.expect(o.initialClusterVersion, unittest.equals('foo')); |
| 286 unittest.expect(o.initialNodeCount, unittest.equals(42)); | 283 unittest.expect(o.initialNodeCount, unittest.equals(42)); |
| 287 checkUnnamed1864(o.instanceGroupUrls); | 284 checkUnnamed1862(o.instanceGroupUrls); |
| 288 checkIPAllocationPolicy(o.ipAllocationPolicy); | 285 checkIPAllocationPolicy(o.ipAllocationPolicy); |
| 289 unittest.expect(o.labelFingerprint, unittest.equals('foo')); | 286 unittest.expect(o.labelFingerprint, unittest.equals('foo')); |
| 290 checkLegacyAbac(o.legacyAbac); | 287 checkLegacyAbac(o.legacyAbac); |
| 291 checkUnnamed1865(o.locations); | 288 checkUnnamed1863(o.locations); |
| 292 unittest.expect(o.loggingService, unittest.equals('foo')); | 289 unittest.expect(o.loggingService, unittest.equals('foo')); |
| 293 checkMasterAuth(o.masterAuth); | 290 checkMasterAuth(o.masterAuth); |
| 294 checkMasterAuthorizedNetworksConfig(o.masterAuthorizedNetworksConfig); | 291 checkMasterAuthorizedNetworksConfig(o.masterAuthorizedNetworksConfig); |
| 295 unittest.expect(o.monitoringService, unittest.equals('foo')); | 292 unittest.expect(o.monitoringService, unittest.equals('foo')); |
| 296 unittest.expect(o.name, unittest.equals('foo')); | 293 unittest.expect(o.name, unittest.equals('foo')); |
| 297 unittest.expect(o.network, unittest.equals('foo')); | 294 unittest.expect(o.network, unittest.equals('foo')); |
| 298 checkNetworkPolicy(o.networkPolicy); | 295 checkNetworkPolicy(o.networkPolicy); |
| 299 checkNodeConfig(o.nodeConfig); | 296 checkNodeConfig(o.nodeConfig); |
| 300 unittest.expect(o.nodeIpv4CidrSize, unittest.equals(42)); | 297 unittest.expect(o.nodeIpv4CidrSize, unittest.equals(42)); |
| 301 checkUnnamed1866(o.nodePools); | 298 checkUnnamed1864(o.nodePools); |
| 302 checkUnnamed1867(o.resourceLabels); | 299 checkUnnamed1865(o.resourceLabels); |
| 303 unittest.expect(o.selfLink, unittest.equals('foo')); | 300 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 304 unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); | 301 unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); |
| 305 unittest.expect(o.status, unittest.equals('foo')); | 302 unittest.expect(o.status, unittest.equals('foo')); |
| 306 unittest.expect(o.statusMessage, unittest.equals('foo')); | 303 unittest.expect(o.statusMessage, unittest.equals('foo')); |
| 307 unittest.expect(o.subnetwork, unittest.equals('foo')); | 304 unittest.expect(o.subnetwork, unittest.equals('foo')); |
| 308 unittest.expect(o.zone, unittest.equals('foo')); | 305 unittest.expect(o.zone, unittest.equals('foo')); |
| 309 } | 306 } |
| 310 buildCounterCluster--; | 307 buildCounterCluster--; |
| 311 } | 308 } |
| 312 | 309 |
| 313 buildUnnamed1868() { | 310 buildUnnamed1866() { |
| 314 var o = new core.List<core.String>(); | 311 var o = new core.List<core.String>(); |
| 315 o.add("foo"); | 312 o.add("foo"); |
| 316 o.add("foo"); | 313 o.add("foo"); |
| 317 return o; | 314 return o; |
| 318 } | 315 } |
| 319 | 316 |
| 320 checkUnnamed1868(core.List<core.String> o) { | 317 checkUnnamed1866(core.List<core.String> o) { |
| 321 unittest.expect(o, unittest.hasLength(2)); | 318 unittest.expect(o, unittest.hasLength(2)); |
| 322 unittest.expect(o[0], unittest.equals('foo')); | 319 unittest.expect(o[0], unittest.equals('foo')); |
| 323 unittest.expect(o[1], unittest.equals('foo')); | 320 unittest.expect(o[1], unittest.equals('foo')); |
| 324 } | 321 } |
| 325 | 322 |
| 326 core.int buildCounterClusterUpdate = 0; | 323 core.int buildCounterClusterUpdate = 0; |
| 327 buildClusterUpdate() { | 324 buildClusterUpdate() { |
| 328 var o = new api.ClusterUpdate(); | 325 var o = new api.ClusterUpdate(); |
| 329 buildCounterClusterUpdate++; | 326 buildCounterClusterUpdate++; |
| 330 if (buildCounterClusterUpdate < 3) { | 327 if (buildCounterClusterUpdate < 3) { |
| 331 o.desiredAddonsConfig = buildAddonsConfig(); | 328 o.desiredAddonsConfig = buildAddonsConfig(); |
| 332 o.desiredImageType = "foo"; | 329 o.desiredImageType = "foo"; |
| 333 o.desiredLocations = buildUnnamed1868(); | 330 o.desiredLocations = buildUnnamed1866(); |
| 334 o.desiredMasterAuthorizedNetworksConfig = buildMasterAuthorizedNetworksConfi
g(); | 331 o.desiredMasterAuthorizedNetworksConfig = |
| 332 buildMasterAuthorizedNetworksConfig(); |
| 335 o.desiredMasterVersion = "foo"; | 333 o.desiredMasterVersion = "foo"; |
| 336 o.desiredMonitoringService = "foo"; | 334 o.desiredMonitoringService = "foo"; |
| 337 o.desiredNodePoolAutoscaling = buildNodePoolAutoscaling(); | 335 o.desiredNodePoolAutoscaling = buildNodePoolAutoscaling(); |
| 338 o.desiredNodePoolId = "foo"; | 336 o.desiredNodePoolId = "foo"; |
| 339 o.desiredNodeVersion = "foo"; | 337 o.desiredNodeVersion = "foo"; |
| 340 } | 338 } |
| 341 buildCounterClusterUpdate--; | 339 buildCounterClusterUpdate--; |
| 342 return o; | 340 return o; |
| 343 } | 341 } |
| 344 | 342 |
| 345 checkClusterUpdate(api.ClusterUpdate o) { | 343 checkClusterUpdate(api.ClusterUpdate o) { |
| 346 buildCounterClusterUpdate++; | 344 buildCounterClusterUpdate++; |
| 347 if (buildCounterClusterUpdate < 3) { | 345 if (buildCounterClusterUpdate < 3) { |
| 348 checkAddonsConfig(o.desiredAddonsConfig); | 346 checkAddonsConfig(o.desiredAddonsConfig); |
| 349 unittest.expect(o.desiredImageType, unittest.equals('foo')); | 347 unittest.expect(o.desiredImageType, unittest.equals('foo')); |
| 350 checkUnnamed1868(o.desiredLocations); | 348 checkUnnamed1866(o.desiredLocations); |
| 351 checkMasterAuthorizedNetworksConfig(o.desiredMasterAuthorizedNetworksConfig)
; | 349 checkMasterAuthorizedNetworksConfig( |
| 350 o.desiredMasterAuthorizedNetworksConfig); |
| 352 unittest.expect(o.desiredMasterVersion, unittest.equals('foo')); | 351 unittest.expect(o.desiredMasterVersion, unittest.equals('foo')); |
| 353 unittest.expect(o.desiredMonitoringService, unittest.equals('foo')); | 352 unittest.expect(o.desiredMonitoringService, unittest.equals('foo')); |
| 354 checkNodePoolAutoscaling(o.desiredNodePoolAutoscaling); | 353 checkNodePoolAutoscaling(o.desiredNodePoolAutoscaling); |
| 355 unittest.expect(o.desiredNodePoolId, unittest.equals('foo')); | 354 unittest.expect(o.desiredNodePoolId, unittest.equals('foo')); |
| 356 unittest.expect(o.desiredNodeVersion, unittest.equals('foo')); | 355 unittest.expect(o.desiredNodeVersion, unittest.equals('foo')); |
| 357 } | 356 } |
| 358 buildCounterClusterUpdate--; | 357 buildCounterClusterUpdate--; |
| 359 } | 358 } |
| 360 | 359 |
| 361 core.int buildCounterCompleteIPRotationRequest = 0; | 360 core.int buildCounterCompleteIPRotationRequest = 0; |
| 362 buildCompleteIPRotationRequest() { | 361 buildCompleteIPRotationRequest() { |
| 363 var o = new api.CompleteIPRotationRequest(); | 362 var o = new api.CompleteIPRotationRequest(); |
| 364 buildCounterCompleteIPRotationRequest++; | 363 buildCounterCompleteIPRotationRequest++; |
| 365 if (buildCounterCompleteIPRotationRequest < 3) { | 364 if (buildCounterCompleteIPRotationRequest < 3) {} |
| 366 } | |
| 367 buildCounterCompleteIPRotationRequest--; | 365 buildCounterCompleteIPRotationRequest--; |
| 368 return o; | 366 return o; |
| 369 } | 367 } |
| 370 | 368 |
| 371 checkCompleteIPRotationRequest(api.CompleteIPRotationRequest o) { | 369 checkCompleteIPRotationRequest(api.CompleteIPRotationRequest o) { |
| 372 buildCounterCompleteIPRotationRequest++; | 370 buildCounterCompleteIPRotationRequest++; |
| 373 if (buildCounterCompleteIPRotationRequest < 3) { | 371 if (buildCounterCompleteIPRotationRequest < 3) {} |
| 374 } | |
| 375 buildCounterCompleteIPRotationRequest--; | 372 buildCounterCompleteIPRotationRequest--; |
| 376 } | 373 } |
| 377 | 374 |
| 378 core.int buildCounterCreateClusterRequest = 0; | 375 core.int buildCounterCreateClusterRequest = 0; |
| 379 buildCreateClusterRequest() { | 376 buildCreateClusterRequest() { |
| 380 var o = new api.CreateClusterRequest(); | 377 var o = new api.CreateClusterRequest(); |
| 381 buildCounterCreateClusterRequest++; | 378 buildCounterCreateClusterRequest++; |
| 382 if (buildCounterCreateClusterRequest < 3) { | 379 if (buildCounterCreateClusterRequest < 3) { |
| 383 o.cluster = buildCluster(); | 380 o.cluster = buildCluster(); |
| 384 } | 381 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 410 if (buildCounterCreateNodePoolRequest < 3) { | 407 if (buildCounterCreateNodePoolRequest < 3) { |
| 411 checkNodePool(o.nodePool); | 408 checkNodePool(o.nodePool); |
| 412 } | 409 } |
| 413 buildCounterCreateNodePoolRequest--; | 410 buildCounterCreateNodePoolRequest--; |
| 414 } | 411 } |
| 415 | 412 |
| 416 core.int buildCounterEmpty = 0; | 413 core.int buildCounterEmpty = 0; |
| 417 buildEmpty() { | 414 buildEmpty() { |
| 418 var o = new api.Empty(); | 415 var o = new api.Empty(); |
| 419 buildCounterEmpty++; | 416 buildCounterEmpty++; |
| 420 if (buildCounterEmpty < 3) { | 417 if (buildCounterEmpty < 3) {} |
| 421 } | |
| 422 buildCounterEmpty--; | 418 buildCounterEmpty--; |
| 423 return o; | 419 return o; |
| 424 } | 420 } |
| 425 | 421 |
| 426 checkEmpty(api.Empty o) { | 422 checkEmpty(api.Empty o) { |
| 427 buildCounterEmpty++; | 423 buildCounterEmpty++; |
| 428 if (buildCounterEmpty < 3) { | 424 if (buildCounterEmpty < 3) {} |
| 429 } | |
| 430 buildCounterEmpty--; | 425 buildCounterEmpty--; |
| 431 } | 426 } |
| 432 | 427 |
| 433 core.int buildCounterHorizontalPodAutoscaling = 0; | 428 core.int buildCounterHorizontalPodAutoscaling = 0; |
| 434 buildHorizontalPodAutoscaling() { | 429 buildHorizontalPodAutoscaling() { |
| 435 var o = new api.HorizontalPodAutoscaling(); | 430 var o = new api.HorizontalPodAutoscaling(); |
| 436 buildCounterHorizontalPodAutoscaling++; | 431 buildCounterHorizontalPodAutoscaling++; |
| 437 if (buildCounterHorizontalPodAutoscaling < 3) { | 432 if (buildCounterHorizontalPodAutoscaling < 3) { |
| 438 o.disabled = true; | 433 o.disabled = true; |
| 439 } | 434 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 467 } | 462 } |
| 468 buildCounterHttpLoadBalancing--; | 463 buildCounterHttpLoadBalancing--; |
| 469 } | 464 } |
| 470 | 465 |
| 471 core.int buildCounterIPAllocationPolicy = 0; | 466 core.int buildCounterIPAllocationPolicy = 0; |
| 472 buildIPAllocationPolicy() { | 467 buildIPAllocationPolicy() { |
| 473 var o = new api.IPAllocationPolicy(); | 468 var o = new api.IPAllocationPolicy(); |
| 474 buildCounterIPAllocationPolicy++; | 469 buildCounterIPAllocationPolicy++; |
| 475 if (buildCounterIPAllocationPolicy < 3) { | 470 if (buildCounterIPAllocationPolicy < 3) { |
| 476 o.clusterIpv4Cidr = "foo"; | 471 o.clusterIpv4Cidr = "foo"; |
| 472 o.clusterIpv4CidrBlock = "foo"; |
| 473 o.clusterSecondaryRangeName = "foo"; |
| 477 o.createSubnetwork = true; | 474 o.createSubnetwork = true; |
| 478 o.nodeIpv4Cidr = "foo"; | 475 o.nodeIpv4Cidr = "foo"; |
| 476 o.nodeIpv4CidrBlock = "foo"; |
| 479 o.servicesIpv4Cidr = "foo"; | 477 o.servicesIpv4Cidr = "foo"; |
| 478 o.servicesIpv4CidrBlock = "foo"; |
| 479 o.servicesSecondaryRangeName = "foo"; |
| 480 o.subnetworkName = "foo"; | 480 o.subnetworkName = "foo"; |
| 481 o.useIpAliases = true; | 481 o.useIpAliases = true; |
| 482 } | 482 } |
| 483 buildCounterIPAllocationPolicy--; | 483 buildCounterIPAllocationPolicy--; |
| 484 return o; | 484 return o; |
| 485 } | 485 } |
| 486 | 486 |
| 487 checkIPAllocationPolicy(api.IPAllocationPolicy o) { | 487 checkIPAllocationPolicy(api.IPAllocationPolicy o) { |
| 488 buildCounterIPAllocationPolicy++; | 488 buildCounterIPAllocationPolicy++; |
| 489 if (buildCounterIPAllocationPolicy < 3) { | 489 if (buildCounterIPAllocationPolicy < 3) { |
| 490 unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); | 490 unittest.expect(o.clusterIpv4Cidr, unittest.equals('foo')); |
| 491 unittest.expect(o.clusterIpv4CidrBlock, unittest.equals('foo')); |
| 492 unittest.expect(o.clusterSecondaryRangeName, unittest.equals('foo')); |
| 491 unittest.expect(o.createSubnetwork, unittest.isTrue); | 493 unittest.expect(o.createSubnetwork, unittest.isTrue); |
| 492 unittest.expect(o.nodeIpv4Cidr, unittest.equals('foo')); | 494 unittest.expect(o.nodeIpv4Cidr, unittest.equals('foo')); |
| 495 unittest.expect(o.nodeIpv4CidrBlock, unittest.equals('foo')); |
| 493 unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); | 496 unittest.expect(o.servicesIpv4Cidr, unittest.equals('foo')); |
| 497 unittest.expect(o.servicesIpv4CidrBlock, unittest.equals('foo')); |
| 498 unittest.expect(o.servicesSecondaryRangeName, unittest.equals('foo')); |
| 494 unittest.expect(o.subnetworkName, unittest.equals('foo')); | 499 unittest.expect(o.subnetworkName, unittest.equals('foo')); |
| 495 unittest.expect(o.useIpAliases, unittest.isTrue); | 500 unittest.expect(o.useIpAliases, unittest.isTrue); |
| 496 } | 501 } |
| 497 buildCounterIPAllocationPolicy--; | 502 buildCounterIPAllocationPolicy--; |
| 498 } | 503 } |
| 499 | 504 |
| 500 core.int buildCounterKubernetesDashboard = 0; | 505 core.int buildCounterKubernetesDashboard = 0; |
| 501 buildKubernetesDashboard() { | 506 buildKubernetesDashboard() { |
| 502 var o = new api.KubernetesDashboard(); | 507 var o = new api.KubernetesDashboard(); |
| 503 buildCounterKubernetesDashboard++; | 508 buildCounterKubernetesDashboard++; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 528 } | 533 } |
| 529 | 534 |
| 530 checkLegacyAbac(api.LegacyAbac o) { | 535 checkLegacyAbac(api.LegacyAbac o) { |
| 531 buildCounterLegacyAbac++; | 536 buildCounterLegacyAbac++; |
| 532 if (buildCounterLegacyAbac < 3) { | 537 if (buildCounterLegacyAbac < 3) { |
| 533 unittest.expect(o.enabled, unittest.isTrue); | 538 unittest.expect(o.enabled, unittest.isTrue); |
| 534 } | 539 } |
| 535 buildCounterLegacyAbac--; | 540 buildCounterLegacyAbac--; |
| 536 } | 541 } |
| 537 | 542 |
| 538 buildUnnamed1869() { | 543 buildUnnamed1867() { |
| 539 var o = new core.List<api.Cluster>(); | 544 var o = new core.List<api.Cluster>(); |
| 540 o.add(buildCluster()); | 545 o.add(buildCluster()); |
| 541 o.add(buildCluster()); | 546 o.add(buildCluster()); |
| 542 return o; | 547 return o; |
| 543 } | 548 } |
| 544 | 549 |
| 545 checkUnnamed1869(core.List<api.Cluster> o) { | 550 checkUnnamed1867(core.List<api.Cluster> o) { |
| 546 unittest.expect(o, unittest.hasLength(2)); | 551 unittest.expect(o, unittest.hasLength(2)); |
| 547 checkCluster(o[0]); | 552 checkCluster(o[0]); |
| 548 checkCluster(o[1]); | 553 checkCluster(o[1]); |
| 549 } | 554 } |
| 550 | 555 |
| 551 buildUnnamed1870() { | 556 buildUnnamed1868() { |
| 552 var o = new core.List<core.String>(); | 557 var o = new core.List<core.String>(); |
| 553 o.add("foo"); | 558 o.add("foo"); |
| 554 o.add("foo"); | 559 o.add("foo"); |
| 555 return o; | 560 return o; |
| 556 } | 561 } |
| 557 | 562 |
| 558 checkUnnamed1870(core.List<core.String> o) { | 563 checkUnnamed1868(core.List<core.String> o) { |
| 559 unittest.expect(o, unittest.hasLength(2)); | 564 unittest.expect(o, unittest.hasLength(2)); |
| 560 unittest.expect(o[0], unittest.equals('foo')); | 565 unittest.expect(o[0], unittest.equals('foo')); |
| 561 unittest.expect(o[1], unittest.equals('foo')); | 566 unittest.expect(o[1], unittest.equals('foo')); |
| 562 } | 567 } |
| 563 | 568 |
| 564 core.int buildCounterListClustersResponse = 0; | 569 core.int buildCounterListClustersResponse = 0; |
| 565 buildListClustersResponse() { | 570 buildListClustersResponse() { |
| 566 var o = new api.ListClustersResponse(); | 571 var o = new api.ListClustersResponse(); |
| 567 buildCounterListClustersResponse++; | 572 buildCounterListClustersResponse++; |
| 568 if (buildCounterListClustersResponse < 3) { | 573 if (buildCounterListClustersResponse < 3) { |
| 569 o.clusters = buildUnnamed1869(); | 574 o.clusters = buildUnnamed1867(); |
| 570 o.missingZones = buildUnnamed1870(); | 575 o.missingZones = buildUnnamed1868(); |
| 571 } | 576 } |
| 572 buildCounterListClustersResponse--; | 577 buildCounterListClustersResponse--; |
| 573 return o; | 578 return o; |
| 574 } | 579 } |
| 575 | 580 |
| 576 checkListClustersResponse(api.ListClustersResponse o) { | 581 checkListClustersResponse(api.ListClustersResponse o) { |
| 577 buildCounterListClustersResponse++; | 582 buildCounterListClustersResponse++; |
| 578 if (buildCounterListClustersResponse < 3) { | 583 if (buildCounterListClustersResponse < 3) { |
| 579 checkUnnamed1869(o.clusters); | 584 checkUnnamed1867(o.clusters); |
| 580 checkUnnamed1870(o.missingZones); | 585 checkUnnamed1868(o.missingZones); |
| 581 } | 586 } |
| 582 buildCounterListClustersResponse--; | 587 buildCounterListClustersResponse--; |
| 583 } | 588 } |
| 584 | 589 |
| 585 buildUnnamed1871() { | 590 buildUnnamed1869() { |
| 586 var o = new core.List<api.NodePool>(); | 591 var o = new core.List<api.NodePool>(); |
| 587 o.add(buildNodePool()); | 592 o.add(buildNodePool()); |
| 588 o.add(buildNodePool()); | 593 o.add(buildNodePool()); |
| 589 return o; | 594 return o; |
| 590 } | 595 } |
| 591 | 596 |
| 592 checkUnnamed1871(core.List<api.NodePool> o) { | 597 checkUnnamed1869(core.List<api.NodePool> o) { |
| 593 unittest.expect(o, unittest.hasLength(2)); | 598 unittest.expect(o, unittest.hasLength(2)); |
| 594 checkNodePool(o[0]); | 599 checkNodePool(o[0]); |
| 595 checkNodePool(o[1]); | 600 checkNodePool(o[1]); |
| 596 } | 601 } |
| 597 | 602 |
| 598 core.int buildCounterListNodePoolsResponse = 0; | 603 core.int buildCounterListNodePoolsResponse = 0; |
| 599 buildListNodePoolsResponse() { | 604 buildListNodePoolsResponse() { |
| 600 var o = new api.ListNodePoolsResponse(); | 605 var o = new api.ListNodePoolsResponse(); |
| 601 buildCounterListNodePoolsResponse++; | 606 buildCounterListNodePoolsResponse++; |
| 602 if (buildCounterListNodePoolsResponse < 3) { | 607 if (buildCounterListNodePoolsResponse < 3) { |
| 603 o.nodePools = buildUnnamed1871(); | 608 o.nodePools = buildUnnamed1869(); |
| 604 } | 609 } |
| 605 buildCounterListNodePoolsResponse--; | 610 buildCounterListNodePoolsResponse--; |
| 606 return o; | 611 return o; |
| 607 } | 612 } |
| 608 | 613 |
| 609 checkListNodePoolsResponse(api.ListNodePoolsResponse o) { | 614 checkListNodePoolsResponse(api.ListNodePoolsResponse o) { |
| 610 buildCounterListNodePoolsResponse++; | 615 buildCounterListNodePoolsResponse++; |
| 611 if (buildCounterListNodePoolsResponse < 3) { | 616 if (buildCounterListNodePoolsResponse < 3) { |
| 612 checkUnnamed1871(o.nodePools); | 617 checkUnnamed1869(o.nodePools); |
| 613 } | 618 } |
| 614 buildCounterListNodePoolsResponse--; | 619 buildCounterListNodePoolsResponse--; |
| 615 } | 620 } |
| 616 | 621 |
| 617 buildUnnamed1872() { | 622 buildUnnamed1870() { |
| 618 var o = new core.List<core.String>(); | 623 var o = new core.List<core.String>(); |
| 619 o.add("foo"); | 624 o.add("foo"); |
| 620 o.add("foo"); | 625 o.add("foo"); |
| 621 return o; | 626 return o; |
| 622 } | 627 } |
| 623 | 628 |
| 624 checkUnnamed1872(core.List<core.String> o) { | 629 checkUnnamed1870(core.List<core.String> o) { |
| 625 unittest.expect(o, unittest.hasLength(2)); | 630 unittest.expect(o, unittest.hasLength(2)); |
| 626 unittest.expect(o[0], unittest.equals('foo')); | 631 unittest.expect(o[0], unittest.equals('foo')); |
| 627 unittest.expect(o[1], unittest.equals('foo')); | 632 unittest.expect(o[1], unittest.equals('foo')); |
| 628 } | 633 } |
| 629 | 634 |
| 630 buildUnnamed1873() { | 635 buildUnnamed1871() { |
| 631 var o = new core.List<api.Operation>(); | 636 var o = new core.List<api.Operation>(); |
| 632 o.add(buildOperation()); | 637 o.add(buildOperation()); |
| 633 o.add(buildOperation()); | 638 o.add(buildOperation()); |
| 634 return o; | 639 return o; |
| 635 } | 640 } |
| 636 | 641 |
| 637 checkUnnamed1873(core.List<api.Operation> o) { | 642 checkUnnamed1871(core.List<api.Operation> o) { |
| 638 unittest.expect(o, unittest.hasLength(2)); | 643 unittest.expect(o, unittest.hasLength(2)); |
| 639 checkOperation(o[0]); | 644 checkOperation(o[0]); |
| 640 checkOperation(o[1]); | 645 checkOperation(o[1]); |
| 641 } | 646 } |
| 642 | 647 |
| 643 core.int buildCounterListOperationsResponse = 0; | 648 core.int buildCounterListOperationsResponse = 0; |
| 644 buildListOperationsResponse() { | 649 buildListOperationsResponse() { |
| 645 var o = new api.ListOperationsResponse(); | 650 var o = new api.ListOperationsResponse(); |
| 646 buildCounterListOperationsResponse++; | 651 buildCounterListOperationsResponse++; |
| 647 if (buildCounterListOperationsResponse < 3) { | 652 if (buildCounterListOperationsResponse < 3) { |
| 648 o.missingZones = buildUnnamed1872(); | 653 o.missingZones = buildUnnamed1870(); |
| 649 o.operations = buildUnnamed1873(); | 654 o.operations = buildUnnamed1871(); |
| 650 } | 655 } |
| 651 buildCounterListOperationsResponse--; | 656 buildCounterListOperationsResponse--; |
| 652 return o; | 657 return o; |
| 653 } | 658 } |
| 654 | 659 |
| 655 checkListOperationsResponse(api.ListOperationsResponse o) { | 660 checkListOperationsResponse(api.ListOperationsResponse o) { |
| 656 buildCounterListOperationsResponse++; | 661 buildCounterListOperationsResponse++; |
| 657 if (buildCounterListOperationsResponse < 3) { | 662 if (buildCounterListOperationsResponse < 3) { |
| 658 checkUnnamed1872(o.missingZones); | 663 checkUnnamed1870(o.missingZones); |
| 659 checkUnnamed1873(o.operations); | 664 checkUnnamed1871(o.operations); |
| 660 } | 665 } |
| 661 buildCounterListOperationsResponse--; | 666 buildCounterListOperationsResponse--; |
| 662 } | 667 } |
| 663 | 668 |
| 664 core.int buildCounterMasterAuth = 0; | 669 core.int buildCounterMasterAuth = 0; |
| 665 buildMasterAuth() { | 670 buildMasterAuth() { |
| 666 var o = new api.MasterAuth(); | 671 var o = new api.MasterAuth(); |
| 667 buildCounterMasterAuth++; | 672 buildCounterMasterAuth++; |
| 668 if (buildCounterMasterAuth < 3) { | 673 if (buildCounterMasterAuth < 3) { |
| 669 o.clientCertificate = "foo"; | 674 o.clientCertificate = "foo"; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 683 unittest.expect(o.clientCertificate, unittest.equals('foo')); | 688 unittest.expect(o.clientCertificate, unittest.equals('foo')); |
| 684 checkClientCertificateConfig(o.clientCertificateConfig); | 689 checkClientCertificateConfig(o.clientCertificateConfig); |
| 685 unittest.expect(o.clientKey, unittest.equals('foo')); | 690 unittest.expect(o.clientKey, unittest.equals('foo')); |
| 686 unittest.expect(o.clusterCaCertificate, unittest.equals('foo')); | 691 unittest.expect(o.clusterCaCertificate, unittest.equals('foo')); |
| 687 unittest.expect(o.password, unittest.equals('foo')); | 692 unittest.expect(o.password, unittest.equals('foo')); |
| 688 unittest.expect(o.username, unittest.equals('foo')); | 693 unittest.expect(o.username, unittest.equals('foo')); |
| 689 } | 694 } |
| 690 buildCounterMasterAuth--; | 695 buildCounterMasterAuth--; |
| 691 } | 696 } |
| 692 | 697 |
| 693 buildUnnamed1874() { | 698 buildUnnamed1872() { |
| 694 var o = new core.List<api.CidrBlock>(); | 699 var o = new core.List<api.CidrBlock>(); |
| 695 o.add(buildCidrBlock()); | 700 o.add(buildCidrBlock()); |
| 696 o.add(buildCidrBlock()); | 701 o.add(buildCidrBlock()); |
| 697 return o; | 702 return o; |
| 698 } | 703 } |
| 699 | 704 |
| 700 checkUnnamed1874(core.List<api.CidrBlock> o) { | 705 checkUnnamed1872(core.List<api.CidrBlock> o) { |
| 701 unittest.expect(o, unittest.hasLength(2)); | 706 unittest.expect(o, unittest.hasLength(2)); |
| 702 checkCidrBlock(o[0]); | 707 checkCidrBlock(o[0]); |
| 703 checkCidrBlock(o[1]); | 708 checkCidrBlock(o[1]); |
| 704 } | 709 } |
| 705 | 710 |
| 706 core.int buildCounterMasterAuthorizedNetworksConfig = 0; | 711 core.int buildCounterMasterAuthorizedNetworksConfig = 0; |
| 707 buildMasterAuthorizedNetworksConfig() { | 712 buildMasterAuthorizedNetworksConfig() { |
| 708 var o = new api.MasterAuthorizedNetworksConfig(); | 713 var o = new api.MasterAuthorizedNetworksConfig(); |
| 709 buildCounterMasterAuthorizedNetworksConfig++; | 714 buildCounterMasterAuthorizedNetworksConfig++; |
| 710 if (buildCounterMasterAuthorizedNetworksConfig < 3) { | 715 if (buildCounterMasterAuthorizedNetworksConfig < 3) { |
| 711 o.cidrBlocks = buildUnnamed1874(); | 716 o.cidrBlocks = buildUnnamed1872(); |
| 712 o.enabled = true; | 717 o.enabled = true; |
| 713 } | 718 } |
| 714 buildCounterMasterAuthorizedNetworksConfig--; | 719 buildCounterMasterAuthorizedNetworksConfig--; |
| 715 return o; | 720 return o; |
| 716 } | 721 } |
| 717 | 722 |
| 718 checkMasterAuthorizedNetworksConfig(api.MasterAuthorizedNetworksConfig o) { | 723 checkMasterAuthorizedNetworksConfig(api.MasterAuthorizedNetworksConfig o) { |
| 719 buildCounterMasterAuthorizedNetworksConfig++; | 724 buildCounterMasterAuthorizedNetworksConfig++; |
| 720 if (buildCounterMasterAuthorizedNetworksConfig < 3) { | 725 if (buildCounterMasterAuthorizedNetworksConfig < 3) { |
| 721 checkUnnamed1874(o.cidrBlocks); | 726 checkUnnamed1872(o.cidrBlocks); |
| 722 unittest.expect(o.enabled, unittest.isTrue); | 727 unittest.expect(o.enabled, unittest.isTrue); |
| 723 } | 728 } |
| 724 buildCounterMasterAuthorizedNetworksConfig--; | 729 buildCounterMasterAuthorizedNetworksConfig--; |
| 725 } | 730 } |
| 726 | 731 |
| 727 core.int buildCounterNetworkPolicy = 0; | 732 core.int buildCounterNetworkPolicy = 0; |
| 728 buildNetworkPolicy() { | 733 buildNetworkPolicy() { |
| 729 var o = new api.NetworkPolicy(); | 734 var o = new api.NetworkPolicy(); |
| 730 buildCounterNetworkPolicy++; | 735 buildCounterNetworkPolicy++; |
| 731 if (buildCounterNetworkPolicy < 3) { | 736 if (buildCounterNetworkPolicy < 3) { |
| 732 o.enabled = true; | 737 o.enabled = true; |
| 733 o.provider = "foo"; | 738 o.provider = "foo"; |
| 734 } | 739 } |
| 735 buildCounterNetworkPolicy--; | 740 buildCounterNetworkPolicy--; |
| 736 return o; | 741 return o; |
| 737 } | 742 } |
| 738 | 743 |
| 739 checkNetworkPolicy(api.NetworkPolicy o) { | 744 checkNetworkPolicy(api.NetworkPolicy o) { |
| 740 buildCounterNetworkPolicy++; | 745 buildCounterNetworkPolicy++; |
| 741 if (buildCounterNetworkPolicy < 3) { | 746 if (buildCounterNetworkPolicy < 3) { |
| 742 unittest.expect(o.enabled, unittest.isTrue); | 747 unittest.expect(o.enabled, unittest.isTrue); |
| 743 unittest.expect(o.provider, unittest.equals('foo')); | 748 unittest.expect(o.provider, unittest.equals('foo')); |
| 744 } | 749 } |
| 745 buildCounterNetworkPolicy--; | 750 buildCounterNetworkPolicy--; |
| 746 } | 751 } |
| 747 | 752 |
| 748 buildUnnamed1875() { | 753 buildUnnamed1873() { |
| 749 var o = new core.List<api.AcceleratorConfig>(); | 754 var o = new core.List<api.AcceleratorConfig>(); |
| 750 o.add(buildAcceleratorConfig()); | 755 o.add(buildAcceleratorConfig()); |
| 751 o.add(buildAcceleratorConfig()); | 756 o.add(buildAcceleratorConfig()); |
| 752 return o; | 757 return o; |
| 753 } | 758 } |
| 754 | 759 |
| 755 checkUnnamed1875(core.List<api.AcceleratorConfig> o) { | 760 checkUnnamed1873(core.List<api.AcceleratorConfig> o) { |
| 756 unittest.expect(o, unittest.hasLength(2)); | 761 unittest.expect(o, unittest.hasLength(2)); |
| 757 checkAcceleratorConfig(o[0]); | 762 checkAcceleratorConfig(o[0]); |
| 758 checkAcceleratorConfig(o[1]); | 763 checkAcceleratorConfig(o[1]); |
| 759 } | 764 } |
| 760 | 765 |
| 761 buildUnnamed1876() { | 766 buildUnnamed1874() { |
| 762 var o = new core.Map<core.String, core.String>(); | 767 var o = new core.Map<core.String, core.String>(); |
| 763 o["x"] = "foo"; | 768 o["x"] = "foo"; |
| 764 o["y"] = "foo"; | 769 o["y"] = "foo"; |
| 765 return o; | 770 return o; |
| 766 } | 771 } |
| 767 | 772 |
| 768 checkUnnamed1876(core.Map<core.String, core.String> o) { | 773 checkUnnamed1874(core.Map<core.String, core.String> o) { |
| 769 unittest.expect(o, unittest.hasLength(2)); | 774 unittest.expect(o, unittest.hasLength(2)); |
| 770 unittest.expect(o["x"], unittest.equals('foo')); | 775 unittest.expect(o["x"], unittest.equals('foo')); |
| 771 unittest.expect(o["y"], unittest.equals('foo')); | 776 unittest.expect(o["y"], unittest.equals('foo')); |
| 772 } | 777 } |
| 773 | 778 |
| 774 buildUnnamed1877() { | 779 buildUnnamed1875() { |
| 775 var o = new core.Map<core.String, core.String>(); | 780 var o = new core.Map<core.String, core.String>(); |
| 776 o["x"] = "foo"; | 781 o["x"] = "foo"; |
| 777 o["y"] = "foo"; | 782 o["y"] = "foo"; |
| 778 return o; | 783 return o; |
| 779 } | 784 } |
| 780 | 785 |
| 781 checkUnnamed1877(core.Map<core.String, core.String> o) { | 786 checkUnnamed1875(core.Map<core.String, core.String> o) { |
| 782 unittest.expect(o, unittest.hasLength(2)); | 787 unittest.expect(o, unittest.hasLength(2)); |
| 783 unittest.expect(o["x"], unittest.equals('foo')); | 788 unittest.expect(o["x"], unittest.equals('foo')); |
| 784 unittest.expect(o["y"], unittest.equals('foo')); | 789 unittest.expect(o["y"], unittest.equals('foo')); |
| 785 } | 790 } |
| 786 | 791 |
| 787 buildUnnamed1878() { | 792 buildUnnamed1876() { |
| 788 var o = new core.List<core.String>(); | 793 var o = new core.List<core.String>(); |
| 789 o.add("foo"); | 794 o.add("foo"); |
| 790 o.add("foo"); | 795 o.add("foo"); |
| 791 return o; | 796 return o; |
| 792 } | 797 } |
| 793 | 798 |
| 794 checkUnnamed1878(core.List<core.String> o) { | 799 checkUnnamed1876(core.List<core.String> o) { |
| 795 unittest.expect(o, unittest.hasLength(2)); | 800 unittest.expect(o, unittest.hasLength(2)); |
| 796 unittest.expect(o[0], unittest.equals('foo')); | 801 unittest.expect(o[0], unittest.equals('foo')); |
| 797 unittest.expect(o[1], unittest.equals('foo')); | 802 unittest.expect(o[1], unittest.equals('foo')); |
| 798 } | 803 } |
| 799 | 804 |
| 800 buildUnnamed1879() { | 805 buildUnnamed1877() { |
| 801 var o = new core.List<core.String>(); | 806 var o = new core.List<core.String>(); |
| 802 o.add("foo"); | 807 o.add("foo"); |
| 803 o.add("foo"); | 808 o.add("foo"); |
| 804 return o; | 809 return o; |
| 805 } | 810 } |
| 806 | 811 |
| 807 checkUnnamed1879(core.List<core.String> o) { | 812 checkUnnamed1877(core.List<core.String> o) { |
| 808 unittest.expect(o, unittest.hasLength(2)); | 813 unittest.expect(o, unittest.hasLength(2)); |
| 809 unittest.expect(o[0], unittest.equals('foo')); | 814 unittest.expect(o[0], unittest.equals('foo')); |
| 810 unittest.expect(o[1], unittest.equals('foo')); | 815 unittest.expect(o[1], unittest.equals('foo')); |
| 811 } | 816 } |
| 812 | 817 |
| 813 core.int buildCounterNodeConfig = 0; | 818 core.int buildCounterNodeConfig = 0; |
| 814 buildNodeConfig() { | 819 buildNodeConfig() { |
| 815 var o = new api.NodeConfig(); | 820 var o = new api.NodeConfig(); |
| 816 buildCounterNodeConfig++; | 821 buildCounterNodeConfig++; |
| 817 if (buildCounterNodeConfig < 3) { | 822 if (buildCounterNodeConfig < 3) { |
| 818 o.accelerators = buildUnnamed1875(); | 823 o.accelerators = buildUnnamed1873(); |
| 819 o.diskSizeGb = 42; | 824 o.diskSizeGb = 42; |
| 820 o.imageType = "foo"; | 825 o.imageType = "foo"; |
| 821 o.labels = buildUnnamed1876(); | 826 o.labels = buildUnnamed1874(); |
| 822 o.localSsdCount = 42; | 827 o.localSsdCount = 42; |
| 823 o.machineType = "foo"; | 828 o.machineType = "foo"; |
| 824 o.metadata = buildUnnamed1877(); | 829 o.metadata = buildUnnamed1875(); |
| 825 o.oauthScopes = buildUnnamed1878(); | 830 o.oauthScopes = buildUnnamed1876(); |
| 826 o.preemptible = true; | 831 o.preemptible = true; |
| 827 o.serviceAccount = "foo"; | 832 o.serviceAccount = "foo"; |
| 828 o.tags = buildUnnamed1879(); | 833 o.tags = buildUnnamed1877(); |
| 829 } | 834 } |
| 830 buildCounterNodeConfig--; | 835 buildCounterNodeConfig--; |
| 831 return o; | 836 return o; |
| 832 } | 837 } |
| 833 | 838 |
| 834 checkNodeConfig(api.NodeConfig o) { | 839 checkNodeConfig(api.NodeConfig o) { |
| 835 buildCounterNodeConfig++; | 840 buildCounterNodeConfig++; |
| 836 if (buildCounterNodeConfig < 3) { | 841 if (buildCounterNodeConfig < 3) { |
| 837 checkUnnamed1875(o.accelerators); | 842 checkUnnamed1873(o.accelerators); |
| 838 unittest.expect(o.diskSizeGb, unittest.equals(42)); | 843 unittest.expect(o.diskSizeGb, unittest.equals(42)); |
| 839 unittest.expect(o.imageType, unittest.equals('foo')); | 844 unittest.expect(o.imageType, unittest.equals('foo')); |
| 840 checkUnnamed1876(o.labels); | 845 checkUnnamed1874(o.labels); |
| 841 unittest.expect(o.localSsdCount, unittest.equals(42)); | 846 unittest.expect(o.localSsdCount, unittest.equals(42)); |
| 842 unittest.expect(o.machineType, unittest.equals('foo')); | 847 unittest.expect(o.machineType, unittest.equals('foo')); |
| 843 checkUnnamed1877(o.metadata); | 848 checkUnnamed1875(o.metadata); |
| 844 checkUnnamed1878(o.oauthScopes); | 849 checkUnnamed1876(o.oauthScopes); |
| 845 unittest.expect(o.preemptible, unittest.isTrue); | 850 unittest.expect(o.preemptible, unittest.isTrue); |
| 846 unittest.expect(o.serviceAccount, unittest.equals('foo')); | 851 unittest.expect(o.serviceAccount, unittest.equals('foo')); |
| 847 checkUnnamed1879(o.tags); | 852 checkUnnamed1877(o.tags); |
| 848 } | 853 } |
| 849 buildCounterNodeConfig--; | 854 buildCounterNodeConfig--; |
| 850 } | 855 } |
| 851 | 856 |
| 852 core.int buildCounterNodeManagement = 0; | 857 core.int buildCounterNodeManagement = 0; |
| 853 buildNodeManagement() { | 858 buildNodeManagement() { |
| 854 var o = new api.NodeManagement(); | 859 var o = new api.NodeManagement(); |
| 855 buildCounterNodeManagement++; | 860 buildCounterNodeManagement++; |
| 856 if (buildCounterNodeManagement < 3) { | 861 if (buildCounterNodeManagement < 3) { |
| 857 o.autoRepair = true; | 862 o.autoRepair = true; |
| 858 o.autoUpgrade = true; | 863 o.autoUpgrade = true; |
| 859 o.upgradeOptions = buildAutoUpgradeOptions(); | 864 o.upgradeOptions = buildAutoUpgradeOptions(); |
| 860 } | 865 } |
| 861 buildCounterNodeManagement--; | 866 buildCounterNodeManagement--; |
| 862 return o; | 867 return o; |
| 863 } | 868 } |
| 864 | 869 |
| 865 checkNodeManagement(api.NodeManagement o) { | 870 checkNodeManagement(api.NodeManagement o) { |
| 866 buildCounterNodeManagement++; | 871 buildCounterNodeManagement++; |
| 867 if (buildCounterNodeManagement < 3) { | 872 if (buildCounterNodeManagement < 3) { |
| 868 unittest.expect(o.autoRepair, unittest.isTrue); | 873 unittest.expect(o.autoRepair, unittest.isTrue); |
| 869 unittest.expect(o.autoUpgrade, unittest.isTrue); | 874 unittest.expect(o.autoUpgrade, unittest.isTrue); |
| 870 checkAutoUpgradeOptions(o.upgradeOptions); | 875 checkAutoUpgradeOptions(o.upgradeOptions); |
| 871 } | 876 } |
| 872 buildCounterNodeManagement--; | 877 buildCounterNodeManagement--; |
| 873 } | 878 } |
| 874 | 879 |
| 875 buildUnnamed1880() { | 880 buildUnnamed1878() { |
| 876 var o = new core.List<core.String>(); | 881 var o = new core.List<core.String>(); |
| 877 o.add("foo"); | 882 o.add("foo"); |
| 878 o.add("foo"); | 883 o.add("foo"); |
| 879 return o; | 884 return o; |
| 880 } | 885 } |
| 881 | 886 |
| 882 checkUnnamed1880(core.List<core.String> o) { | 887 checkUnnamed1878(core.List<core.String> o) { |
| 883 unittest.expect(o, unittest.hasLength(2)); | 888 unittest.expect(o, unittest.hasLength(2)); |
| 884 unittest.expect(o[0], unittest.equals('foo')); | 889 unittest.expect(o[0], unittest.equals('foo')); |
| 885 unittest.expect(o[1], unittest.equals('foo')); | 890 unittest.expect(o[1], unittest.equals('foo')); |
| 886 } | 891 } |
| 887 | 892 |
| 888 core.int buildCounterNodePool = 0; | 893 core.int buildCounterNodePool = 0; |
| 889 buildNodePool() { | 894 buildNodePool() { |
| 890 var o = new api.NodePool(); | 895 var o = new api.NodePool(); |
| 891 buildCounterNodePool++; | 896 buildCounterNodePool++; |
| 892 if (buildCounterNodePool < 3) { | 897 if (buildCounterNodePool < 3) { |
| 893 o.autoscaling = buildNodePoolAutoscaling(); | 898 o.autoscaling = buildNodePoolAutoscaling(); |
| 894 o.config = buildNodeConfig(); | 899 o.config = buildNodeConfig(); |
| 895 o.initialNodeCount = 42; | 900 o.initialNodeCount = 42; |
| 896 o.instanceGroupUrls = buildUnnamed1880(); | 901 o.instanceGroupUrls = buildUnnamed1878(); |
| 897 o.management = buildNodeManagement(); | 902 o.management = buildNodeManagement(); |
| 898 o.name = "foo"; | 903 o.name = "foo"; |
| 899 o.selfLink = "foo"; | 904 o.selfLink = "foo"; |
| 900 o.status = "foo"; | 905 o.status = "foo"; |
| 901 o.statusMessage = "foo"; | 906 o.statusMessage = "foo"; |
| 902 o.version = "foo"; | 907 o.version = "foo"; |
| 903 } | 908 } |
| 904 buildCounterNodePool--; | 909 buildCounterNodePool--; |
| 905 return o; | 910 return o; |
| 906 } | 911 } |
| 907 | 912 |
| 908 checkNodePool(api.NodePool o) { | 913 checkNodePool(api.NodePool o) { |
| 909 buildCounterNodePool++; | 914 buildCounterNodePool++; |
| 910 if (buildCounterNodePool < 3) { | 915 if (buildCounterNodePool < 3) { |
| 911 checkNodePoolAutoscaling(o.autoscaling); | 916 checkNodePoolAutoscaling(o.autoscaling); |
| 912 checkNodeConfig(o.config); | 917 checkNodeConfig(o.config); |
| 913 unittest.expect(o.initialNodeCount, unittest.equals(42)); | 918 unittest.expect(o.initialNodeCount, unittest.equals(42)); |
| 914 checkUnnamed1880(o.instanceGroupUrls); | 919 checkUnnamed1878(o.instanceGroupUrls); |
| 915 checkNodeManagement(o.management); | 920 checkNodeManagement(o.management); |
| 916 unittest.expect(o.name, unittest.equals('foo')); | 921 unittest.expect(o.name, unittest.equals('foo')); |
| 917 unittest.expect(o.selfLink, unittest.equals('foo')); | 922 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 918 unittest.expect(o.status, unittest.equals('foo')); | 923 unittest.expect(o.status, unittest.equals('foo')); |
| 919 unittest.expect(o.statusMessage, unittest.equals('foo')); | 924 unittest.expect(o.statusMessage, unittest.equals('foo')); |
| 920 unittest.expect(o.version, unittest.equals('foo')); | 925 unittest.expect(o.version, unittest.equals('foo')); |
| 921 } | 926 } |
| 922 buildCounterNodePool--; | 927 buildCounterNodePool--; |
| 923 } | 928 } |
| 924 | 929 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 944 } | 949 } |
| 945 buildCounterNodePoolAutoscaling--; | 950 buildCounterNodePoolAutoscaling--; |
| 946 } | 951 } |
| 947 | 952 |
| 948 core.int buildCounterOperation = 0; | 953 core.int buildCounterOperation = 0; |
| 949 buildOperation() { | 954 buildOperation() { |
| 950 var o = new api.Operation(); | 955 var o = new api.Operation(); |
| 951 buildCounterOperation++; | 956 buildCounterOperation++; |
| 952 if (buildCounterOperation < 3) { | 957 if (buildCounterOperation < 3) { |
| 953 o.detail = "foo"; | 958 o.detail = "foo"; |
| 959 o.endTime = "foo"; |
| 954 o.name = "foo"; | 960 o.name = "foo"; |
| 955 o.operationType = "foo"; | 961 o.operationType = "foo"; |
| 956 o.selfLink = "foo"; | 962 o.selfLink = "foo"; |
| 963 o.startTime = "foo"; |
| 957 o.status = "foo"; | 964 o.status = "foo"; |
| 958 o.statusMessage = "foo"; | 965 o.statusMessage = "foo"; |
| 959 o.targetLink = "foo"; | 966 o.targetLink = "foo"; |
| 960 o.zone = "foo"; | 967 o.zone = "foo"; |
| 961 } | 968 } |
| 962 buildCounterOperation--; | 969 buildCounterOperation--; |
| 963 return o; | 970 return o; |
| 964 } | 971 } |
| 965 | 972 |
| 966 checkOperation(api.Operation o) { | 973 checkOperation(api.Operation o) { |
| 967 buildCounterOperation++; | 974 buildCounterOperation++; |
| 968 if (buildCounterOperation < 3) { | 975 if (buildCounterOperation < 3) { |
| 969 unittest.expect(o.detail, unittest.equals('foo')); | 976 unittest.expect(o.detail, unittest.equals('foo')); |
| 977 unittest.expect(o.endTime, unittest.equals('foo')); |
| 970 unittest.expect(o.name, unittest.equals('foo')); | 978 unittest.expect(o.name, unittest.equals('foo')); |
| 971 unittest.expect(o.operationType, unittest.equals('foo')); | 979 unittest.expect(o.operationType, unittest.equals('foo')); |
| 972 unittest.expect(o.selfLink, unittest.equals('foo')); | 980 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 981 unittest.expect(o.startTime, unittest.equals('foo')); |
| 973 unittest.expect(o.status, unittest.equals('foo')); | 982 unittest.expect(o.status, unittest.equals('foo')); |
| 974 unittest.expect(o.statusMessage, unittest.equals('foo')); | 983 unittest.expect(o.statusMessage, unittest.equals('foo')); |
| 975 unittest.expect(o.targetLink, unittest.equals('foo')); | 984 unittest.expect(o.targetLink, unittest.equals('foo')); |
| 976 unittest.expect(o.zone, unittest.equals('foo')); | 985 unittest.expect(o.zone, unittest.equals('foo')); |
| 977 } | 986 } |
| 978 buildCounterOperation--; | 987 buildCounterOperation--; |
| 979 } | 988 } |
| 980 | 989 |
| 981 core.int buildCounterRollbackNodePoolUpgradeRequest = 0; | 990 core.int buildCounterRollbackNodePoolUpgradeRequest = 0; |
| 982 buildRollbackNodePoolUpgradeRequest() { | 991 buildRollbackNodePoolUpgradeRequest() { |
| 983 var o = new api.RollbackNodePoolUpgradeRequest(); | 992 var o = new api.RollbackNodePoolUpgradeRequest(); |
| 984 buildCounterRollbackNodePoolUpgradeRequest++; | 993 buildCounterRollbackNodePoolUpgradeRequest++; |
| 985 if (buildCounterRollbackNodePoolUpgradeRequest < 3) { | 994 if (buildCounterRollbackNodePoolUpgradeRequest < 3) {} |
| 986 } | |
| 987 buildCounterRollbackNodePoolUpgradeRequest--; | 995 buildCounterRollbackNodePoolUpgradeRequest--; |
| 988 return o; | 996 return o; |
| 989 } | 997 } |
| 990 | 998 |
| 991 checkRollbackNodePoolUpgradeRequest(api.RollbackNodePoolUpgradeRequest o) { | 999 checkRollbackNodePoolUpgradeRequest(api.RollbackNodePoolUpgradeRequest o) { |
| 992 buildCounterRollbackNodePoolUpgradeRequest++; | 1000 buildCounterRollbackNodePoolUpgradeRequest++; |
| 993 if (buildCounterRollbackNodePoolUpgradeRequest < 3) { | 1001 if (buildCounterRollbackNodePoolUpgradeRequest < 3) {} |
| 994 } | |
| 995 buildCounterRollbackNodePoolUpgradeRequest--; | 1002 buildCounterRollbackNodePoolUpgradeRequest--; |
| 996 } | 1003 } |
| 997 | 1004 |
| 1005 buildUnnamed1879() { |
| 1006 var o = new core.List<core.String>(); |
| 1007 o.add("foo"); |
| 1008 o.add("foo"); |
| 1009 return o; |
| 1010 } |
| 1011 |
| 1012 checkUnnamed1879(core.List<core.String> o) { |
| 1013 unittest.expect(o, unittest.hasLength(2)); |
| 1014 unittest.expect(o[0], unittest.equals('foo')); |
| 1015 unittest.expect(o[1], unittest.equals('foo')); |
| 1016 } |
| 1017 |
| 1018 buildUnnamed1880() { |
| 1019 var o = new core.List<core.String>(); |
| 1020 o.add("foo"); |
| 1021 o.add("foo"); |
| 1022 return o; |
| 1023 } |
| 1024 |
| 1025 checkUnnamed1880(core.List<core.String> o) { |
| 1026 unittest.expect(o, unittest.hasLength(2)); |
| 1027 unittest.expect(o[0], unittest.equals('foo')); |
| 1028 unittest.expect(o[1], unittest.equals('foo')); |
| 1029 } |
| 1030 |
| 998 buildUnnamed1881() { | 1031 buildUnnamed1881() { |
| 999 var o = new core.List<core.String>(); | 1032 var o = new core.List<core.String>(); |
| 1000 o.add("foo"); | 1033 o.add("foo"); |
| 1001 o.add("foo"); | 1034 o.add("foo"); |
| 1002 return o; | 1035 return o; |
| 1003 } | 1036 } |
| 1004 | 1037 |
| 1005 checkUnnamed1881(core.List<core.String> o) { | 1038 checkUnnamed1881(core.List<core.String> o) { |
| 1006 unittest.expect(o, unittest.hasLength(2)); | 1039 unittest.expect(o, unittest.hasLength(2)); |
| 1007 unittest.expect(o[0], unittest.equals('foo')); | 1040 unittest.expect(o[0], unittest.equals('foo')); |
| 1008 unittest.expect(o[1], unittest.equals('foo')); | 1041 unittest.expect(o[1], unittest.equals('foo')); |
| 1009 } | |
| 1010 | |
| 1011 buildUnnamed1882() { | |
| 1012 var o = new core.List<core.String>(); | |
| 1013 o.add("foo"); | |
| 1014 o.add("foo"); | |
| 1015 return o; | |
| 1016 } | |
| 1017 | |
| 1018 checkUnnamed1882(core.List<core.String> o) { | |
| 1019 unittest.expect(o, unittest.hasLength(2)); | |
| 1020 unittest.expect(o[0], unittest.equals('foo')); | |
| 1021 unittest.expect(o[1], unittest.equals('foo')); | |
| 1022 } | |
| 1023 | |
| 1024 buildUnnamed1883() { | |
| 1025 var o = new core.List<core.String>(); | |
| 1026 o.add("foo"); | |
| 1027 o.add("foo"); | |
| 1028 return o; | |
| 1029 } | |
| 1030 | |
| 1031 checkUnnamed1883(core.List<core.String> o) { | |
| 1032 unittest.expect(o, unittest.hasLength(2)); | |
| 1033 unittest.expect(o[0], unittest.equals('foo')); | |
| 1034 unittest.expect(o[1], unittest.equals('foo')); | |
| 1035 } | 1042 } |
| 1036 | 1043 |
| 1037 core.int buildCounterServerConfig = 0; | 1044 core.int buildCounterServerConfig = 0; |
| 1038 buildServerConfig() { | 1045 buildServerConfig() { |
| 1039 var o = new api.ServerConfig(); | 1046 var o = new api.ServerConfig(); |
| 1040 buildCounterServerConfig++; | 1047 buildCounterServerConfig++; |
| 1041 if (buildCounterServerConfig < 3) { | 1048 if (buildCounterServerConfig < 3) { |
| 1042 o.defaultClusterVersion = "foo"; | 1049 o.defaultClusterVersion = "foo"; |
| 1043 o.defaultImageType = "foo"; | 1050 o.defaultImageType = "foo"; |
| 1044 o.validImageTypes = buildUnnamed1881(); | 1051 o.validImageTypes = buildUnnamed1879(); |
| 1045 o.validMasterVersions = buildUnnamed1882(); | 1052 o.validMasterVersions = buildUnnamed1880(); |
| 1046 o.validNodeVersions = buildUnnamed1883(); | 1053 o.validNodeVersions = buildUnnamed1881(); |
| 1047 } | 1054 } |
| 1048 buildCounterServerConfig--; | 1055 buildCounterServerConfig--; |
| 1049 return o; | 1056 return o; |
| 1050 } | 1057 } |
| 1051 | 1058 |
| 1052 checkServerConfig(api.ServerConfig o) { | 1059 checkServerConfig(api.ServerConfig o) { |
| 1053 buildCounterServerConfig++; | 1060 buildCounterServerConfig++; |
| 1054 if (buildCounterServerConfig < 3) { | 1061 if (buildCounterServerConfig < 3) { |
| 1055 unittest.expect(o.defaultClusterVersion, unittest.equals('foo')); | 1062 unittest.expect(o.defaultClusterVersion, unittest.equals('foo')); |
| 1056 unittest.expect(o.defaultImageType, unittest.equals('foo')); | 1063 unittest.expect(o.defaultImageType, unittest.equals('foo')); |
| 1057 checkUnnamed1881(o.validImageTypes); | 1064 checkUnnamed1879(o.validImageTypes); |
| 1058 checkUnnamed1882(o.validMasterVersions); | 1065 checkUnnamed1880(o.validMasterVersions); |
| 1059 checkUnnamed1883(o.validNodeVersions); | 1066 checkUnnamed1881(o.validNodeVersions); |
| 1060 } | 1067 } |
| 1061 buildCounterServerConfig--; | 1068 buildCounterServerConfig--; |
| 1062 } | 1069 } |
| 1063 | 1070 |
| 1064 core.int buildCounterSetAddonsConfigRequest = 0; | 1071 core.int buildCounterSetAddonsConfigRequest = 0; |
| 1065 buildSetAddonsConfigRequest() { | 1072 buildSetAddonsConfigRequest() { |
| 1066 var o = new api.SetAddonsConfigRequest(); | 1073 var o = new api.SetAddonsConfigRequest(); |
| 1067 buildCounterSetAddonsConfigRequest++; | 1074 buildCounterSetAddonsConfigRequest++; |
| 1068 if (buildCounterSetAddonsConfigRequest < 3) { | 1075 if (buildCounterSetAddonsConfigRequest < 3) { |
| 1069 o.addonsConfig = buildAddonsConfig(); | 1076 o.addonsConfig = buildAddonsConfig(); |
| 1070 } | 1077 } |
| 1071 buildCounterSetAddonsConfigRequest--; | 1078 buildCounterSetAddonsConfigRequest--; |
| 1072 return o; | 1079 return o; |
| 1073 } | 1080 } |
| 1074 | 1081 |
| 1075 checkSetAddonsConfigRequest(api.SetAddonsConfigRequest o) { | 1082 checkSetAddonsConfigRequest(api.SetAddonsConfigRequest o) { |
| 1076 buildCounterSetAddonsConfigRequest++; | 1083 buildCounterSetAddonsConfigRequest++; |
| 1077 if (buildCounterSetAddonsConfigRequest < 3) { | 1084 if (buildCounterSetAddonsConfigRequest < 3) { |
| 1078 checkAddonsConfig(o.addonsConfig); | 1085 checkAddonsConfig(o.addonsConfig); |
| 1079 } | 1086 } |
| 1080 buildCounterSetAddonsConfigRequest--; | 1087 buildCounterSetAddonsConfigRequest--; |
| 1081 } | 1088 } |
| 1082 | 1089 |
| 1083 buildUnnamed1884() { | 1090 buildUnnamed1882() { |
| 1084 var o = new core.Map<core.String, core.String>(); | 1091 var o = new core.Map<core.String, core.String>(); |
| 1085 o["x"] = "foo"; | 1092 o["x"] = "foo"; |
| 1086 o["y"] = "foo"; | 1093 o["y"] = "foo"; |
| 1087 return o; | 1094 return o; |
| 1088 } | 1095 } |
| 1089 | 1096 |
| 1090 checkUnnamed1884(core.Map<core.String, core.String> o) { | 1097 checkUnnamed1882(core.Map<core.String, core.String> o) { |
| 1091 unittest.expect(o, unittest.hasLength(2)); | 1098 unittest.expect(o, unittest.hasLength(2)); |
| 1092 unittest.expect(o["x"], unittest.equals('foo')); | 1099 unittest.expect(o["x"], unittest.equals('foo')); |
| 1093 unittest.expect(o["y"], unittest.equals('foo')); | 1100 unittest.expect(o["y"], unittest.equals('foo')); |
| 1094 } | 1101 } |
| 1095 | 1102 |
| 1096 core.int buildCounterSetLabelsRequest = 0; | 1103 core.int buildCounterSetLabelsRequest = 0; |
| 1097 buildSetLabelsRequest() { | 1104 buildSetLabelsRequest() { |
| 1098 var o = new api.SetLabelsRequest(); | 1105 var o = new api.SetLabelsRequest(); |
| 1099 buildCounterSetLabelsRequest++; | 1106 buildCounterSetLabelsRequest++; |
| 1100 if (buildCounterSetLabelsRequest < 3) { | 1107 if (buildCounterSetLabelsRequest < 3) { |
| 1101 o.labelFingerprint = "foo"; | 1108 o.labelFingerprint = "foo"; |
| 1102 o.resourceLabels = buildUnnamed1884(); | 1109 o.resourceLabels = buildUnnamed1882(); |
| 1103 } | 1110 } |
| 1104 buildCounterSetLabelsRequest--; | 1111 buildCounterSetLabelsRequest--; |
| 1105 return o; | 1112 return o; |
| 1106 } | 1113 } |
| 1107 | 1114 |
| 1108 checkSetLabelsRequest(api.SetLabelsRequest o) { | 1115 checkSetLabelsRequest(api.SetLabelsRequest o) { |
| 1109 buildCounterSetLabelsRequest++; | 1116 buildCounterSetLabelsRequest++; |
| 1110 if (buildCounterSetLabelsRequest < 3) { | 1117 if (buildCounterSetLabelsRequest < 3) { |
| 1111 unittest.expect(o.labelFingerprint, unittest.equals('foo')); | 1118 unittest.expect(o.labelFingerprint, unittest.equals('foo')); |
| 1112 checkUnnamed1884(o.resourceLabels); | 1119 checkUnnamed1882(o.resourceLabels); |
| 1113 } | 1120 } |
| 1114 buildCounterSetLabelsRequest--; | 1121 buildCounterSetLabelsRequest--; |
| 1115 } | 1122 } |
| 1116 | 1123 |
| 1117 core.int buildCounterSetLegacyAbacRequest = 0; | 1124 core.int buildCounterSetLegacyAbacRequest = 0; |
| 1118 buildSetLegacyAbacRequest() { | 1125 buildSetLegacyAbacRequest() { |
| 1119 var o = new api.SetLegacyAbacRequest(); | 1126 var o = new api.SetLegacyAbacRequest(); |
| 1120 buildCounterSetLegacyAbacRequest++; | 1127 buildCounterSetLegacyAbacRequest++; |
| 1121 if (buildCounterSetLegacyAbacRequest < 3) { | 1128 if (buildCounterSetLegacyAbacRequest < 3) { |
| 1122 o.enabled = true; | 1129 o.enabled = true; |
| 1123 } | 1130 } |
| 1124 buildCounterSetLegacyAbacRequest--; | 1131 buildCounterSetLegacyAbacRequest--; |
| 1125 return o; | 1132 return o; |
| 1126 } | 1133 } |
| 1127 | 1134 |
| 1128 checkSetLegacyAbacRequest(api.SetLegacyAbacRequest o) { | 1135 checkSetLegacyAbacRequest(api.SetLegacyAbacRequest o) { |
| 1129 buildCounterSetLegacyAbacRequest++; | 1136 buildCounterSetLegacyAbacRequest++; |
| 1130 if (buildCounterSetLegacyAbacRequest < 3) { | 1137 if (buildCounterSetLegacyAbacRequest < 3) { |
| 1131 unittest.expect(o.enabled, unittest.isTrue); | 1138 unittest.expect(o.enabled, unittest.isTrue); |
| 1132 } | 1139 } |
| 1133 buildCounterSetLegacyAbacRequest--; | 1140 buildCounterSetLegacyAbacRequest--; |
| 1134 } | 1141 } |
| 1135 | 1142 |
| 1136 buildUnnamed1885() { | 1143 buildUnnamed1883() { |
| 1137 var o = new core.List<core.String>(); | 1144 var o = new core.List<core.String>(); |
| 1138 o.add("foo"); | 1145 o.add("foo"); |
| 1139 o.add("foo"); | 1146 o.add("foo"); |
| 1140 return o; | 1147 return o; |
| 1141 } | 1148 } |
| 1142 | 1149 |
| 1143 checkUnnamed1885(core.List<core.String> o) { | 1150 checkUnnamed1883(core.List<core.String> o) { |
| 1144 unittest.expect(o, unittest.hasLength(2)); | 1151 unittest.expect(o, unittest.hasLength(2)); |
| 1145 unittest.expect(o[0], unittest.equals('foo')); | 1152 unittest.expect(o[0], unittest.equals('foo')); |
| 1146 unittest.expect(o[1], unittest.equals('foo')); | 1153 unittest.expect(o[1], unittest.equals('foo')); |
| 1147 } | 1154 } |
| 1148 | 1155 |
| 1149 core.int buildCounterSetLocationsRequest = 0; | 1156 core.int buildCounterSetLocationsRequest = 0; |
| 1150 buildSetLocationsRequest() { | 1157 buildSetLocationsRequest() { |
| 1151 var o = new api.SetLocationsRequest(); | 1158 var o = new api.SetLocationsRequest(); |
| 1152 buildCounterSetLocationsRequest++; | 1159 buildCounterSetLocationsRequest++; |
| 1153 if (buildCounterSetLocationsRequest < 3) { | 1160 if (buildCounterSetLocationsRequest < 3) { |
| 1154 o.locations = buildUnnamed1885(); | 1161 o.locations = buildUnnamed1883(); |
| 1155 } | 1162 } |
| 1156 buildCounterSetLocationsRequest--; | 1163 buildCounterSetLocationsRequest--; |
| 1157 return o; | 1164 return o; |
| 1158 } | 1165 } |
| 1159 | 1166 |
| 1160 checkSetLocationsRequest(api.SetLocationsRequest o) { | 1167 checkSetLocationsRequest(api.SetLocationsRequest o) { |
| 1161 buildCounterSetLocationsRequest++; | 1168 buildCounterSetLocationsRequest++; |
| 1162 if (buildCounterSetLocationsRequest < 3) { | 1169 if (buildCounterSetLocationsRequest < 3) { |
| 1163 checkUnnamed1885(o.locations); | 1170 checkUnnamed1883(o.locations); |
| 1164 } | 1171 } |
| 1165 buildCounterSetLocationsRequest--; | 1172 buildCounterSetLocationsRequest--; |
| 1166 } | 1173 } |
| 1167 | 1174 |
| 1168 core.int buildCounterSetLoggingServiceRequest = 0; | 1175 core.int buildCounterSetLoggingServiceRequest = 0; |
| 1169 buildSetLoggingServiceRequest() { | 1176 buildSetLoggingServiceRequest() { |
| 1170 var o = new api.SetLoggingServiceRequest(); | 1177 var o = new api.SetLoggingServiceRequest(); |
| 1171 buildCounterSetLoggingServiceRequest++; | 1178 buildCounterSetLoggingServiceRequest++; |
| 1172 if (buildCounterSetLoggingServiceRequest < 3) { | 1179 if (buildCounterSetLoggingServiceRequest < 3) { |
| 1173 o.loggingService = "foo"; | 1180 o.loggingService = "foo"; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 if (buildCounterSetNodePoolSizeRequest < 3) { | 1304 if (buildCounterSetNodePoolSizeRequest < 3) { |
| 1298 unittest.expect(o.nodeCount, unittest.equals(42)); | 1305 unittest.expect(o.nodeCount, unittest.equals(42)); |
| 1299 } | 1306 } |
| 1300 buildCounterSetNodePoolSizeRequest--; | 1307 buildCounterSetNodePoolSizeRequest--; |
| 1301 } | 1308 } |
| 1302 | 1309 |
| 1303 core.int buildCounterStartIPRotationRequest = 0; | 1310 core.int buildCounterStartIPRotationRequest = 0; |
| 1304 buildStartIPRotationRequest() { | 1311 buildStartIPRotationRequest() { |
| 1305 var o = new api.StartIPRotationRequest(); | 1312 var o = new api.StartIPRotationRequest(); |
| 1306 buildCounterStartIPRotationRequest++; | 1313 buildCounterStartIPRotationRequest++; |
| 1307 if (buildCounterStartIPRotationRequest < 3) { | 1314 if (buildCounterStartIPRotationRequest < 3) {} |
| 1308 } | |
| 1309 buildCounterStartIPRotationRequest--; | 1315 buildCounterStartIPRotationRequest--; |
| 1310 return o; | 1316 return o; |
| 1311 } | 1317 } |
| 1312 | 1318 |
| 1313 checkStartIPRotationRequest(api.StartIPRotationRequest o) { | 1319 checkStartIPRotationRequest(api.StartIPRotationRequest o) { |
| 1314 buildCounterStartIPRotationRequest++; | 1320 buildCounterStartIPRotationRequest++; |
| 1315 if (buildCounterStartIPRotationRequest < 3) { | 1321 if (buildCounterStartIPRotationRequest < 3) {} |
| 1316 } | |
| 1317 buildCounterStartIPRotationRequest--; | 1322 buildCounterStartIPRotationRequest--; |
| 1318 } | 1323 } |
| 1319 | 1324 |
| 1320 core.int buildCounterUpdateClusterRequest = 0; | 1325 core.int buildCounterUpdateClusterRequest = 0; |
| 1321 buildUpdateClusterRequest() { | 1326 buildUpdateClusterRequest() { |
| 1322 var o = new api.UpdateClusterRequest(); | 1327 var o = new api.UpdateClusterRequest(); |
| 1323 buildCounterUpdateClusterRequest++; | 1328 buildCounterUpdateClusterRequest++; |
| 1324 if (buildCounterUpdateClusterRequest < 3) { | 1329 if (buildCounterUpdateClusterRequest < 3) { |
| 1325 o.update = buildClusterUpdate(); | 1330 o.update = buildClusterUpdate(); |
| 1326 } | 1331 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 | 1374 |
| 1370 checkUpdateNodePoolRequest(api.UpdateNodePoolRequest o) { | 1375 checkUpdateNodePoolRequest(api.UpdateNodePoolRequest o) { |
| 1371 buildCounterUpdateNodePoolRequest++; | 1376 buildCounterUpdateNodePoolRequest++; |
| 1372 if (buildCounterUpdateNodePoolRequest < 3) { | 1377 if (buildCounterUpdateNodePoolRequest < 3) { |
| 1373 unittest.expect(o.imageType, unittest.equals('foo')); | 1378 unittest.expect(o.imageType, unittest.equals('foo')); |
| 1374 unittest.expect(o.nodeVersion, unittest.equals('foo')); | 1379 unittest.expect(o.nodeVersion, unittest.equals('foo')); |
| 1375 } | 1380 } |
| 1376 buildCounterUpdateNodePoolRequest--; | 1381 buildCounterUpdateNodePoolRequest--; |
| 1377 } | 1382 } |
| 1378 | 1383 |
| 1379 | |
| 1380 main() { | 1384 main() { |
| 1381 unittest.group("obj-schema-AcceleratorConfig", () { | 1385 unittest.group("obj-schema-AcceleratorConfig", () { |
| 1382 unittest.test("to-json--from-json", () { | 1386 unittest.test("to-json--from-json", () { |
| 1383 var o = buildAcceleratorConfig(); | 1387 var o = buildAcceleratorConfig(); |
| 1384 var od = new api.AcceleratorConfig.fromJson(o.toJson()); | 1388 var od = new api.AcceleratorConfig.fromJson(o.toJson()); |
| 1385 checkAcceleratorConfig(od); | 1389 checkAcceleratorConfig(od); |
| 1386 }); | 1390 }); |
| 1387 }); | 1391 }); |
| 1388 | 1392 |
| 1389 | |
| 1390 unittest.group("obj-schema-AddonsConfig", () { | 1393 unittest.group("obj-schema-AddonsConfig", () { |
| 1391 unittest.test("to-json--from-json", () { | 1394 unittest.test("to-json--from-json", () { |
| 1392 var o = buildAddonsConfig(); | 1395 var o = buildAddonsConfig(); |
| 1393 var od = new api.AddonsConfig.fromJson(o.toJson()); | 1396 var od = new api.AddonsConfig.fromJson(o.toJson()); |
| 1394 checkAddonsConfig(od); | 1397 checkAddonsConfig(od); |
| 1395 }); | 1398 }); |
| 1396 }); | 1399 }); |
| 1397 | 1400 |
| 1398 | |
| 1399 unittest.group("obj-schema-AutoUpgradeOptions", () { | 1401 unittest.group("obj-schema-AutoUpgradeOptions", () { |
| 1400 unittest.test("to-json--from-json", () { | 1402 unittest.test("to-json--from-json", () { |
| 1401 var o = buildAutoUpgradeOptions(); | 1403 var o = buildAutoUpgradeOptions(); |
| 1402 var od = new api.AutoUpgradeOptions.fromJson(o.toJson()); | 1404 var od = new api.AutoUpgradeOptions.fromJson(o.toJson()); |
| 1403 checkAutoUpgradeOptions(od); | 1405 checkAutoUpgradeOptions(od); |
| 1404 }); | 1406 }); |
| 1405 }); | 1407 }); |
| 1406 | 1408 |
| 1407 | |
| 1408 unittest.group("obj-schema-CancelOperationRequest", () { | 1409 unittest.group("obj-schema-CancelOperationRequest", () { |
| 1409 unittest.test("to-json--from-json", () { | 1410 unittest.test("to-json--from-json", () { |
| 1410 var o = buildCancelOperationRequest(); | 1411 var o = buildCancelOperationRequest(); |
| 1411 var od = new api.CancelOperationRequest.fromJson(o.toJson()); | 1412 var od = new api.CancelOperationRequest.fromJson(o.toJson()); |
| 1412 checkCancelOperationRequest(od); | 1413 checkCancelOperationRequest(od); |
| 1413 }); | 1414 }); |
| 1414 }); | 1415 }); |
| 1415 | 1416 |
| 1416 | |
| 1417 unittest.group("obj-schema-CidrBlock", () { | 1417 unittest.group("obj-schema-CidrBlock", () { |
| 1418 unittest.test("to-json--from-json", () { | 1418 unittest.test("to-json--from-json", () { |
| 1419 var o = buildCidrBlock(); | 1419 var o = buildCidrBlock(); |
| 1420 var od = new api.CidrBlock.fromJson(o.toJson()); | 1420 var od = new api.CidrBlock.fromJson(o.toJson()); |
| 1421 checkCidrBlock(od); | 1421 checkCidrBlock(od); |
| 1422 }); | 1422 }); |
| 1423 }); | 1423 }); |
| 1424 | 1424 |
| 1425 | |
| 1426 unittest.group("obj-schema-ClientCertificateConfig", () { | 1425 unittest.group("obj-schema-ClientCertificateConfig", () { |
| 1427 unittest.test("to-json--from-json", () { | 1426 unittest.test("to-json--from-json", () { |
| 1428 var o = buildClientCertificateConfig(); | 1427 var o = buildClientCertificateConfig(); |
| 1429 var od = new api.ClientCertificateConfig.fromJson(o.toJson()); | 1428 var od = new api.ClientCertificateConfig.fromJson(o.toJson()); |
| 1430 checkClientCertificateConfig(od); | 1429 checkClientCertificateConfig(od); |
| 1431 }); | 1430 }); |
| 1432 }); | 1431 }); |
| 1433 | 1432 |
| 1434 | |
| 1435 unittest.group("obj-schema-Cluster", () { | 1433 unittest.group("obj-schema-Cluster", () { |
| 1436 unittest.test("to-json--from-json", () { | 1434 unittest.test("to-json--from-json", () { |
| 1437 var o = buildCluster(); | 1435 var o = buildCluster(); |
| 1438 var od = new api.Cluster.fromJson(o.toJson()); | 1436 var od = new api.Cluster.fromJson(o.toJson()); |
| 1439 checkCluster(od); | 1437 checkCluster(od); |
| 1440 }); | 1438 }); |
| 1441 }); | 1439 }); |
| 1442 | 1440 |
| 1443 | |
| 1444 unittest.group("obj-schema-ClusterUpdate", () { | 1441 unittest.group("obj-schema-ClusterUpdate", () { |
| 1445 unittest.test("to-json--from-json", () { | 1442 unittest.test("to-json--from-json", () { |
| 1446 var o = buildClusterUpdate(); | 1443 var o = buildClusterUpdate(); |
| 1447 var od = new api.ClusterUpdate.fromJson(o.toJson()); | 1444 var od = new api.ClusterUpdate.fromJson(o.toJson()); |
| 1448 checkClusterUpdate(od); | 1445 checkClusterUpdate(od); |
| 1449 }); | 1446 }); |
| 1450 }); | 1447 }); |
| 1451 | 1448 |
| 1452 | |
| 1453 unittest.group("obj-schema-CompleteIPRotationRequest", () { | 1449 unittest.group("obj-schema-CompleteIPRotationRequest", () { |
| 1454 unittest.test("to-json--from-json", () { | 1450 unittest.test("to-json--from-json", () { |
| 1455 var o = buildCompleteIPRotationRequest(); | 1451 var o = buildCompleteIPRotationRequest(); |
| 1456 var od = new api.CompleteIPRotationRequest.fromJson(o.toJson()); | 1452 var od = new api.CompleteIPRotationRequest.fromJson(o.toJson()); |
| 1457 checkCompleteIPRotationRequest(od); | 1453 checkCompleteIPRotationRequest(od); |
| 1458 }); | 1454 }); |
| 1459 }); | 1455 }); |
| 1460 | 1456 |
| 1461 | |
| 1462 unittest.group("obj-schema-CreateClusterRequest", () { | 1457 unittest.group("obj-schema-CreateClusterRequest", () { |
| 1463 unittest.test("to-json--from-json", () { | 1458 unittest.test("to-json--from-json", () { |
| 1464 var o = buildCreateClusterRequest(); | 1459 var o = buildCreateClusterRequest(); |
| 1465 var od = new api.CreateClusterRequest.fromJson(o.toJson()); | 1460 var od = new api.CreateClusterRequest.fromJson(o.toJson()); |
| 1466 checkCreateClusterRequest(od); | 1461 checkCreateClusterRequest(od); |
| 1467 }); | 1462 }); |
| 1468 }); | 1463 }); |
| 1469 | 1464 |
| 1470 | |
| 1471 unittest.group("obj-schema-CreateNodePoolRequest", () { | 1465 unittest.group("obj-schema-CreateNodePoolRequest", () { |
| 1472 unittest.test("to-json--from-json", () { | 1466 unittest.test("to-json--from-json", () { |
| 1473 var o = buildCreateNodePoolRequest(); | 1467 var o = buildCreateNodePoolRequest(); |
| 1474 var od = new api.CreateNodePoolRequest.fromJson(o.toJson()); | 1468 var od = new api.CreateNodePoolRequest.fromJson(o.toJson()); |
| 1475 checkCreateNodePoolRequest(od); | 1469 checkCreateNodePoolRequest(od); |
| 1476 }); | 1470 }); |
| 1477 }); | 1471 }); |
| 1478 | 1472 |
| 1479 | |
| 1480 unittest.group("obj-schema-Empty", () { | 1473 unittest.group("obj-schema-Empty", () { |
| 1481 unittest.test("to-json--from-json", () { | 1474 unittest.test("to-json--from-json", () { |
| 1482 var o = buildEmpty(); | 1475 var o = buildEmpty(); |
| 1483 var od = new api.Empty.fromJson(o.toJson()); | 1476 var od = new api.Empty.fromJson(o.toJson()); |
| 1484 checkEmpty(od); | 1477 checkEmpty(od); |
| 1485 }); | 1478 }); |
| 1486 }); | 1479 }); |
| 1487 | 1480 |
| 1488 | |
| 1489 unittest.group("obj-schema-HorizontalPodAutoscaling", () { | 1481 unittest.group("obj-schema-HorizontalPodAutoscaling", () { |
| 1490 unittest.test("to-json--from-json", () { | 1482 unittest.test("to-json--from-json", () { |
| 1491 var o = buildHorizontalPodAutoscaling(); | 1483 var o = buildHorizontalPodAutoscaling(); |
| 1492 var od = new api.HorizontalPodAutoscaling.fromJson(o.toJson()); | 1484 var od = new api.HorizontalPodAutoscaling.fromJson(o.toJson()); |
| 1493 checkHorizontalPodAutoscaling(od); | 1485 checkHorizontalPodAutoscaling(od); |
| 1494 }); | 1486 }); |
| 1495 }); | 1487 }); |
| 1496 | 1488 |
| 1497 | |
| 1498 unittest.group("obj-schema-HttpLoadBalancing", () { | 1489 unittest.group("obj-schema-HttpLoadBalancing", () { |
| 1499 unittest.test("to-json--from-json", () { | 1490 unittest.test("to-json--from-json", () { |
| 1500 var o = buildHttpLoadBalancing(); | 1491 var o = buildHttpLoadBalancing(); |
| 1501 var od = new api.HttpLoadBalancing.fromJson(o.toJson()); | 1492 var od = new api.HttpLoadBalancing.fromJson(o.toJson()); |
| 1502 checkHttpLoadBalancing(od); | 1493 checkHttpLoadBalancing(od); |
| 1503 }); | 1494 }); |
| 1504 }); | 1495 }); |
| 1505 | 1496 |
| 1506 | |
| 1507 unittest.group("obj-schema-IPAllocationPolicy", () { | 1497 unittest.group("obj-schema-IPAllocationPolicy", () { |
| 1508 unittest.test("to-json--from-json", () { | 1498 unittest.test("to-json--from-json", () { |
| 1509 var o = buildIPAllocationPolicy(); | 1499 var o = buildIPAllocationPolicy(); |
| 1510 var od = new api.IPAllocationPolicy.fromJson(o.toJson()); | 1500 var od = new api.IPAllocationPolicy.fromJson(o.toJson()); |
| 1511 checkIPAllocationPolicy(od); | 1501 checkIPAllocationPolicy(od); |
| 1512 }); | 1502 }); |
| 1513 }); | 1503 }); |
| 1514 | 1504 |
| 1515 | |
| 1516 unittest.group("obj-schema-KubernetesDashboard", () { | 1505 unittest.group("obj-schema-KubernetesDashboard", () { |
| 1517 unittest.test("to-json--from-json", () { | 1506 unittest.test("to-json--from-json", () { |
| 1518 var o = buildKubernetesDashboard(); | 1507 var o = buildKubernetesDashboard(); |
| 1519 var od = new api.KubernetesDashboard.fromJson(o.toJson()); | 1508 var od = new api.KubernetesDashboard.fromJson(o.toJson()); |
| 1520 checkKubernetesDashboard(od); | 1509 checkKubernetesDashboard(od); |
| 1521 }); | 1510 }); |
| 1522 }); | 1511 }); |
| 1523 | 1512 |
| 1524 | |
| 1525 unittest.group("obj-schema-LegacyAbac", () { | 1513 unittest.group("obj-schema-LegacyAbac", () { |
| 1526 unittest.test("to-json--from-json", () { | 1514 unittest.test("to-json--from-json", () { |
| 1527 var o = buildLegacyAbac(); | 1515 var o = buildLegacyAbac(); |
| 1528 var od = new api.LegacyAbac.fromJson(o.toJson()); | 1516 var od = new api.LegacyAbac.fromJson(o.toJson()); |
| 1529 checkLegacyAbac(od); | 1517 checkLegacyAbac(od); |
| 1530 }); | 1518 }); |
| 1531 }); | 1519 }); |
| 1532 | 1520 |
| 1533 | |
| 1534 unittest.group("obj-schema-ListClustersResponse", () { | 1521 unittest.group("obj-schema-ListClustersResponse", () { |
| 1535 unittest.test("to-json--from-json", () { | 1522 unittest.test("to-json--from-json", () { |
| 1536 var o = buildListClustersResponse(); | 1523 var o = buildListClustersResponse(); |
| 1537 var od = new api.ListClustersResponse.fromJson(o.toJson()); | 1524 var od = new api.ListClustersResponse.fromJson(o.toJson()); |
| 1538 checkListClustersResponse(od); | 1525 checkListClustersResponse(od); |
| 1539 }); | 1526 }); |
| 1540 }); | 1527 }); |
| 1541 | 1528 |
| 1542 | |
| 1543 unittest.group("obj-schema-ListNodePoolsResponse", () { | 1529 unittest.group("obj-schema-ListNodePoolsResponse", () { |
| 1544 unittest.test("to-json--from-json", () { | 1530 unittest.test("to-json--from-json", () { |
| 1545 var o = buildListNodePoolsResponse(); | 1531 var o = buildListNodePoolsResponse(); |
| 1546 var od = new api.ListNodePoolsResponse.fromJson(o.toJson()); | 1532 var od = new api.ListNodePoolsResponse.fromJson(o.toJson()); |
| 1547 checkListNodePoolsResponse(od); | 1533 checkListNodePoolsResponse(od); |
| 1548 }); | 1534 }); |
| 1549 }); | 1535 }); |
| 1550 | 1536 |
| 1551 | |
| 1552 unittest.group("obj-schema-ListOperationsResponse", () { | 1537 unittest.group("obj-schema-ListOperationsResponse", () { |
| 1553 unittest.test("to-json--from-json", () { | 1538 unittest.test("to-json--from-json", () { |
| 1554 var o = buildListOperationsResponse(); | 1539 var o = buildListOperationsResponse(); |
| 1555 var od = new api.ListOperationsResponse.fromJson(o.toJson()); | 1540 var od = new api.ListOperationsResponse.fromJson(o.toJson()); |
| 1556 checkListOperationsResponse(od); | 1541 checkListOperationsResponse(od); |
| 1557 }); | 1542 }); |
| 1558 }); | 1543 }); |
| 1559 | 1544 |
| 1560 | |
| 1561 unittest.group("obj-schema-MasterAuth", () { | 1545 unittest.group("obj-schema-MasterAuth", () { |
| 1562 unittest.test("to-json--from-json", () { | 1546 unittest.test("to-json--from-json", () { |
| 1563 var o = buildMasterAuth(); | 1547 var o = buildMasterAuth(); |
| 1564 var od = new api.MasterAuth.fromJson(o.toJson()); | 1548 var od = new api.MasterAuth.fromJson(o.toJson()); |
| 1565 checkMasterAuth(od); | 1549 checkMasterAuth(od); |
| 1566 }); | 1550 }); |
| 1567 }); | 1551 }); |
| 1568 | 1552 |
| 1569 | |
| 1570 unittest.group("obj-schema-MasterAuthorizedNetworksConfig", () { | 1553 unittest.group("obj-schema-MasterAuthorizedNetworksConfig", () { |
| 1571 unittest.test("to-json--from-json", () { | 1554 unittest.test("to-json--from-json", () { |
| 1572 var o = buildMasterAuthorizedNetworksConfig(); | 1555 var o = buildMasterAuthorizedNetworksConfig(); |
| 1573 var od = new api.MasterAuthorizedNetworksConfig.fromJson(o.toJson()); | 1556 var od = new api.MasterAuthorizedNetworksConfig.fromJson(o.toJson()); |
| 1574 checkMasterAuthorizedNetworksConfig(od); | 1557 checkMasterAuthorizedNetworksConfig(od); |
| 1575 }); | 1558 }); |
| 1576 }); | 1559 }); |
| 1577 | 1560 |
| 1578 | |
| 1579 unittest.group("obj-schema-NetworkPolicy", () { | 1561 unittest.group("obj-schema-NetworkPolicy", () { |
| 1580 unittest.test("to-json--from-json", () { | 1562 unittest.test("to-json--from-json", () { |
| 1581 var o = buildNetworkPolicy(); | 1563 var o = buildNetworkPolicy(); |
| 1582 var od = new api.NetworkPolicy.fromJson(o.toJson()); | 1564 var od = new api.NetworkPolicy.fromJson(o.toJson()); |
| 1583 checkNetworkPolicy(od); | 1565 checkNetworkPolicy(od); |
| 1584 }); | 1566 }); |
| 1585 }); | 1567 }); |
| 1586 | 1568 |
| 1587 | |
| 1588 unittest.group("obj-schema-NodeConfig", () { | 1569 unittest.group("obj-schema-NodeConfig", () { |
| 1589 unittest.test("to-json--from-json", () { | 1570 unittest.test("to-json--from-json", () { |
| 1590 var o = buildNodeConfig(); | 1571 var o = buildNodeConfig(); |
| 1591 var od = new api.NodeConfig.fromJson(o.toJson()); | 1572 var od = new api.NodeConfig.fromJson(o.toJson()); |
| 1592 checkNodeConfig(od); | 1573 checkNodeConfig(od); |
| 1593 }); | 1574 }); |
| 1594 }); | 1575 }); |
| 1595 | 1576 |
| 1596 | |
| 1597 unittest.group("obj-schema-NodeManagement", () { | 1577 unittest.group("obj-schema-NodeManagement", () { |
| 1598 unittest.test("to-json--from-json", () { | 1578 unittest.test("to-json--from-json", () { |
| 1599 var o = buildNodeManagement(); | 1579 var o = buildNodeManagement(); |
| 1600 var od = new api.NodeManagement.fromJson(o.toJson()); | 1580 var od = new api.NodeManagement.fromJson(o.toJson()); |
| 1601 checkNodeManagement(od); | 1581 checkNodeManagement(od); |
| 1602 }); | 1582 }); |
| 1603 }); | 1583 }); |
| 1604 | 1584 |
| 1605 | |
| 1606 unittest.group("obj-schema-NodePool", () { | 1585 unittest.group("obj-schema-NodePool", () { |
| 1607 unittest.test("to-json--from-json", () { | 1586 unittest.test("to-json--from-json", () { |
| 1608 var o = buildNodePool(); | 1587 var o = buildNodePool(); |
| 1609 var od = new api.NodePool.fromJson(o.toJson()); | 1588 var od = new api.NodePool.fromJson(o.toJson()); |
| 1610 checkNodePool(od); | 1589 checkNodePool(od); |
| 1611 }); | 1590 }); |
| 1612 }); | 1591 }); |
| 1613 | 1592 |
| 1614 | |
| 1615 unittest.group("obj-schema-NodePoolAutoscaling", () { | 1593 unittest.group("obj-schema-NodePoolAutoscaling", () { |
| 1616 unittest.test("to-json--from-json", () { | 1594 unittest.test("to-json--from-json", () { |
| 1617 var o = buildNodePoolAutoscaling(); | 1595 var o = buildNodePoolAutoscaling(); |
| 1618 var od = new api.NodePoolAutoscaling.fromJson(o.toJson()); | 1596 var od = new api.NodePoolAutoscaling.fromJson(o.toJson()); |
| 1619 checkNodePoolAutoscaling(od); | 1597 checkNodePoolAutoscaling(od); |
| 1620 }); | 1598 }); |
| 1621 }); | 1599 }); |
| 1622 | 1600 |
| 1623 | |
| 1624 unittest.group("obj-schema-Operation", () { | 1601 unittest.group("obj-schema-Operation", () { |
| 1625 unittest.test("to-json--from-json", () { | 1602 unittest.test("to-json--from-json", () { |
| 1626 var o = buildOperation(); | 1603 var o = buildOperation(); |
| 1627 var od = new api.Operation.fromJson(o.toJson()); | 1604 var od = new api.Operation.fromJson(o.toJson()); |
| 1628 checkOperation(od); | 1605 checkOperation(od); |
| 1629 }); | 1606 }); |
| 1630 }); | 1607 }); |
| 1631 | 1608 |
| 1632 | |
| 1633 unittest.group("obj-schema-RollbackNodePoolUpgradeRequest", () { | 1609 unittest.group("obj-schema-RollbackNodePoolUpgradeRequest", () { |
| 1634 unittest.test("to-json--from-json", () { | 1610 unittest.test("to-json--from-json", () { |
| 1635 var o = buildRollbackNodePoolUpgradeRequest(); | 1611 var o = buildRollbackNodePoolUpgradeRequest(); |
| 1636 var od = new api.RollbackNodePoolUpgradeRequest.fromJson(o.toJson()); | 1612 var od = new api.RollbackNodePoolUpgradeRequest.fromJson(o.toJson()); |
| 1637 checkRollbackNodePoolUpgradeRequest(od); | 1613 checkRollbackNodePoolUpgradeRequest(od); |
| 1638 }); | 1614 }); |
| 1639 }); | 1615 }); |
| 1640 | 1616 |
| 1641 | |
| 1642 unittest.group("obj-schema-ServerConfig", () { | 1617 unittest.group("obj-schema-ServerConfig", () { |
| 1643 unittest.test("to-json--from-json", () { | 1618 unittest.test("to-json--from-json", () { |
| 1644 var o = buildServerConfig(); | 1619 var o = buildServerConfig(); |
| 1645 var od = new api.ServerConfig.fromJson(o.toJson()); | 1620 var od = new api.ServerConfig.fromJson(o.toJson()); |
| 1646 checkServerConfig(od); | 1621 checkServerConfig(od); |
| 1647 }); | 1622 }); |
| 1648 }); | 1623 }); |
| 1649 | 1624 |
| 1650 | |
| 1651 unittest.group("obj-schema-SetAddonsConfigRequest", () { | 1625 unittest.group("obj-schema-SetAddonsConfigRequest", () { |
| 1652 unittest.test("to-json--from-json", () { | 1626 unittest.test("to-json--from-json", () { |
| 1653 var o = buildSetAddonsConfigRequest(); | 1627 var o = buildSetAddonsConfigRequest(); |
| 1654 var od = new api.SetAddonsConfigRequest.fromJson(o.toJson()); | 1628 var od = new api.SetAddonsConfigRequest.fromJson(o.toJson()); |
| 1655 checkSetAddonsConfigRequest(od); | 1629 checkSetAddonsConfigRequest(od); |
| 1656 }); | 1630 }); |
| 1657 }); | 1631 }); |
| 1658 | 1632 |
| 1659 | |
| 1660 unittest.group("obj-schema-SetLabelsRequest", () { | 1633 unittest.group("obj-schema-SetLabelsRequest", () { |
| 1661 unittest.test("to-json--from-json", () { | 1634 unittest.test("to-json--from-json", () { |
| 1662 var o = buildSetLabelsRequest(); | 1635 var o = buildSetLabelsRequest(); |
| 1663 var od = new api.SetLabelsRequest.fromJson(o.toJson()); | 1636 var od = new api.SetLabelsRequest.fromJson(o.toJson()); |
| 1664 checkSetLabelsRequest(od); | 1637 checkSetLabelsRequest(od); |
| 1665 }); | 1638 }); |
| 1666 }); | 1639 }); |
| 1667 | 1640 |
| 1668 | |
| 1669 unittest.group("obj-schema-SetLegacyAbacRequest", () { | 1641 unittest.group("obj-schema-SetLegacyAbacRequest", () { |
| 1670 unittest.test("to-json--from-json", () { | 1642 unittest.test("to-json--from-json", () { |
| 1671 var o = buildSetLegacyAbacRequest(); | 1643 var o = buildSetLegacyAbacRequest(); |
| 1672 var od = new api.SetLegacyAbacRequest.fromJson(o.toJson()); | 1644 var od = new api.SetLegacyAbacRequest.fromJson(o.toJson()); |
| 1673 checkSetLegacyAbacRequest(od); | 1645 checkSetLegacyAbacRequest(od); |
| 1674 }); | 1646 }); |
| 1675 }); | 1647 }); |
| 1676 | 1648 |
| 1677 | |
| 1678 unittest.group("obj-schema-SetLocationsRequest", () { | 1649 unittest.group("obj-schema-SetLocationsRequest", () { |
| 1679 unittest.test("to-json--from-json", () { | 1650 unittest.test("to-json--from-json", () { |
| 1680 var o = buildSetLocationsRequest(); | 1651 var o = buildSetLocationsRequest(); |
| 1681 var od = new api.SetLocationsRequest.fromJson(o.toJson()); | 1652 var od = new api.SetLocationsRequest.fromJson(o.toJson()); |
| 1682 checkSetLocationsRequest(od); | 1653 checkSetLocationsRequest(od); |
| 1683 }); | 1654 }); |
| 1684 }); | 1655 }); |
| 1685 | 1656 |
| 1686 | |
| 1687 unittest.group("obj-schema-SetLoggingServiceRequest", () { | 1657 unittest.group("obj-schema-SetLoggingServiceRequest", () { |
| 1688 unittest.test("to-json--from-json", () { | 1658 unittest.test("to-json--from-json", () { |
| 1689 var o = buildSetLoggingServiceRequest(); | 1659 var o = buildSetLoggingServiceRequest(); |
| 1690 var od = new api.SetLoggingServiceRequest.fromJson(o.toJson()); | 1660 var od = new api.SetLoggingServiceRequest.fromJson(o.toJson()); |
| 1691 checkSetLoggingServiceRequest(od); | 1661 checkSetLoggingServiceRequest(od); |
| 1692 }); | 1662 }); |
| 1693 }); | 1663 }); |
| 1694 | 1664 |
| 1695 | |
| 1696 unittest.group("obj-schema-SetMasterAuthRequest", () { | 1665 unittest.group("obj-schema-SetMasterAuthRequest", () { |
| 1697 unittest.test("to-json--from-json", () { | 1666 unittest.test("to-json--from-json", () { |
| 1698 var o = buildSetMasterAuthRequest(); | 1667 var o = buildSetMasterAuthRequest(); |
| 1699 var od = new api.SetMasterAuthRequest.fromJson(o.toJson()); | 1668 var od = new api.SetMasterAuthRequest.fromJson(o.toJson()); |
| 1700 checkSetMasterAuthRequest(od); | 1669 checkSetMasterAuthRequest(od); |
| 1701 }); | 1670 }); |
| 1702 }); | 1671 }); |
| 1703 | 1672 |
| 1704 | |
| 1705 unittest.group("obj-schema-SetMonitoringServiceRequest", () { | 1673 unittest.group("obj-schema-SetMonitoringServiceRequest", () { |
| 1706 unittest.test("to-json--from-json", () { | 1674 unittest.test("to-json--from-json", () { |
| 1707 var o = buildSetMonitoringServiceRequest(); | 1675 var o = buildSetMonitoringServiceRequest(); |
| 1708 var od = new api.SetMonitoringServiceRequest.fromJson(o.toJson()); | 1676 var od = new api.SetMonitoringServiceRequest.fromJson(o.toJson()); |
| 1709 checkSetMonitoringServiceRequest(od); | 1677 checkSetMonitoringServiceRequest(od); |
| 1710 }); | 1678 }); |
| 1711 }); | 1679 }); |
| 1712 | 1680 |
| 1713 | |
| 1714 unittest.group("obj-schema-SetNetworkPolicyRequest", () { | 1681 unittest.group("obj-schema-SetNetworkPolicyRequest", () { |
| 1715 unittest.test("to-json--from-json", () { | 1682 unittest.test("to-json--from-json", () { |
| 1716 var o = buildSetNetworkPolicyRequest(); | 1683 var o = buildSetNetworkPolicyRequest(); |
| 1717 var od = new api.SetNetworkPolicyRequest.fromJson(o.toJson()); | 1684 var od = new api.SetNetworkPolicyRequest.fromJson(o.toJson()); |
| 1718 checkSetNetworkPolicyRequest(od); | 1685 checkSetNetworkPolicyRequest(od); |
| 1719 }); | 1686 }); |
| 1720 }); | 1687 }); |
| 1721 | 1688 |
| 1722 | |
| 1723 unittest.group("obj-schema-SetNodePoolAutoscalingRequest", () { | 1689 unittest.group("obj-schema-SetNodePoolAutoscalingRequest", () { |
| 1724 unittest.test("to-json--from-json", () { | 1690 unittest.test("to-json--from-json", () { |
| 1725 var o = buildSetNodePoolAutoscalingRequest(); | 1691 var o = buildSetNodePoolAutoscalingRequest(); |
| 1726 var od = new api.SetNodePoolAutoscalingRequest.fromJson(o.toJson()); | 1692 var od = new api.SetNodePoolAutoscalingRequest.fromJson(o.toJson()); |
| 1727 checkSetNodePoolAutoscalingRequest(od); | 1693 checkSetNodePoolAutoscalingRequest(od); |
| 1728 }); | 1694 }); |
| 1729 }); | 1695 }); |
| 1730 | 1696 |
| 1731 | |
| 1732 unittest.group("obj-schema-SetNodePoolManagementRequest", () { | 1697 unittest.group("obj-schema-SetNodePoolManagementRequest", () { |
| 1733 unittest.test("to-json--from-json", () { | 1698 unittest.test("to-json--from-json", () { |
| 1734 var o = buildSetNodePoolManagementRequest(); | 1699 var o = buildSetNodePoolManagementRequest(); |
| 1735 var od = new api.SetNodePoolManagementRequest.fromJson(o.toJson()); | 1700 var od = new api.SetNodePoolManagementRequest.fromJson(o.toJson()); |
| 1736 checkSetNodePoolManagementRequest(od); | 1701 checkSetNodePoolManagementRequest(od); |
| 1737 }); | 1702 }); |
| 1738 }); | 1703 }); |
| 1739 | 1704 |
| 1740 | |
| 1741 unittest.group("obj-schema-SetNodePoolSizeRequest", () { | 1705 unittest.group("obj-schema-SetNodePoolSizeRequest", () { |
| 1742 unittest.test("to-json--from-json", () { | 1706 unittest.test("to-json--from-json", () { |
| 1743 var o = buildSetNodePoolSizeRequest(); | 1707 var o = buildSetNodePoolSizeRequest(); |
| 1744 var od = new api.SetNodePoolSizeRequest.fromJson(o.toJson()); | 1708 var od = new api.SetNodePoolSizeRequest.fromJson(o.toJson()); |
| 1745 checkSetNodePoolSizeRequest(od); | 1709 checkSetNodePoolSizeRequest(od); |
| 1746 }); | 1710 }); |
| 1747 }); | 1711 }); |
| 1748 | 1712 |
| 1749 | |
| 1750 unittest.group("obj-schema-StartIPRotationRequest", () { | 1713 unittest.group("obj-schema-StartIPRotationRequest", () { |
| 1751 unittest.test("to-json--from-json", () { | 1714 unittest.test("to-json--from-json", () { |
| 1752 var o = buildStartIPRotationRequest(); | 1715 var o = buildStartIPRotationRequest(); |
| 1753 var od = new api.StartIPRotationRequest.fromJson(o.toJson()); | 1716 var od = new api.StartIPRotationRequest.fromJson(o.toJson()); |
| 1754 checkStartIPRotationRequest(od); | 1717 checkStartIPRotationRequest(od); |
| 1755 }); | 1718 }); |
| 1756 }); | 1719 }); |
| 1757 | 1720 |
| 1758 | |
| 1759 unittest.group("obj-schema-UpdateClusterRequest", () { | 1721 unittest.group("obj-schema-UpdateClusterRequest", () { |
| 1760 unittest.test("to-json--from-json", () { | 1722 unittest.test("to-json--from-json", () { |
| 1761 var o = buildUpdateClusterRequest(); | 1723 var o = buildUpdateClusterRequest(); |
| 1762 var od = new api.UpdateClusterRequest.fromJson(o.toJson()); | 1724 var od = new api.UpdateClusterRequest.fromJson(o.toJson()); |
| 1763 checkUpdateClusterRequest(od); | 1725 checkUpdateClusterRequest(od); |
| 1764 }); | 1726 }); |
| 1765 }); | 1727 }); |
| 1766 | 1728 |
| 1767 | |
| 1768 unittest.group("obj-schema-UpdateMasterRequest", () { | 1729 unittest.group("obj-schema-UpdateMasterRequest", () { |
| 1769 unittest.test("to-json--from-json", () { | 1730 unittest.test("to-json--from-json", () { |
| 1770 var o = buildUpdateMasterRequest(); | 1731 var o = buildUpdateMasterRequest(); |
| 1771 var od = new api.UpdateMasterRequest.fromJson(o.toJson()); | 1732 var od = new api.UpdateMasterRequest.fromJson(o.toJson()); |
| 1772 checkUpdateMasterRequest(od); | 1733 checkUpdateMasterRequest(od); |
| 1773 }); | 1734 }); |
| 1774 }); | 1735 }); |
| 1775 | 1736 |
| 1776 | |
| 1777 unittest.group("obj-schema-UpdateNodePoolRequest", () { | 1737 unittest.group("obj-schema-UpdateNodePoolRequest", () { |
| 1778 unittest.test("to-json--from-json", () { | 1738 unittest.test("to-json--from-json", () { |
| 1779 var o = buildUpdateNodePoolRequest(); | 1739 var o = buildUpdateNodePoolRequest(); |
| 1780 var od = new api.UpdateNodePoolRequest.fromJson(o.toJson()); | 1740 var od = new api.UpdateNodePoolRequest.fromJson(o.toJson()); |
| 1781 checkUpdateNodePoolRequest(od); | 1741 checkUpdateNodePoolRequest(od); |
| 1782 }); | 1742 }); |
| 1783 }); | 1743 }); |
| 1784 | 1744 |
| 1785 | |
| 1786 unittest.group("resource-ProjectsZonesResourceApi", () { | 1745 unittest.group("resource-ProjectsZonesResourceApi", () { |
| 1787 unittest.test("method--getServerconfig", () { | 1746 unittest.test("method--getServerconfig", () { |
| 1788 | |
| 1789 var mock = new HttpServerMock(); | 1747 var mock = new HttpServerMock(); |
| 1790 api.ProjectsZonesResourceApi res = new api.ContainerApi(mock).projects.zon
es; | 1748 api.ProjectsZonesResourceApi res = |
| 1749 new api.ContainerApi(mock).projects.zones; |
| 1791 var arg_projectId = "foo"; | 1750 var arg_projectId = "foo"; |
| 1792 var arg_zone = "foo"; | 1751 var arg_zone = "foo"; |
| 1793 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1752 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1794 var path = (req.url).path; | 1753 var path = (req.url).path; |
| 1795 var pathOffset = 0; | 1754 var pathOffset = 0; |
| 1796 var index; | 1755 var index; |
| 1797 var subPart; | 1756 var subPart; |
| 1798 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1757 unittest.expect( |
| 1758 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1799 pathOffset += 1; | 1759 pathOffset += 1; |
| 1800 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1760 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1761 unittest.equals("v1/projects/")); |
| 1801 pathOffset += 12; | 1762 pathOffset += 12; |
| 1802 index = path.indexOf("/zones/", pathOffset); | 1763 index = path.indexOf("/zones/", pathOffset); |
| 1803 unittest.expect(index >= 0, unittest.isTrue); | 1764 unittest.expect(index >= 0, unittest.isTrue); |
| 1804 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1765 subPart = |
| 1766 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1805 pathOffset = index; | 1767 pathOffset = index; |
| 1806 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 1768 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1807 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 1769 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 1770 unittest.equals("/zones/")); |
| 1808 pathOffset += 7; | 1771 pathOffset += 7; |
| 1809 index = path.indexOf("/serverconfig", pathOffset); | 1772 index = path.indexOf("/serverconfig", pathOffset); |
| 1810 unittest.expect(index >= 0, unittest.isTrue); | 1773 unittest.expect(index >= 0, unittest.isTrue); |
| 1811 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1774 subPart = |
| 1775 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1812 pathOffset = index; | 1776 pathOffset = index; |
| 1813 unittest.expect(subPart, unittest.equals("$arg_zone")); | 1777 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 1814 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/serverconfig")); | 1778 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 1779 unittest.equals("/serverconfig")); |
| 1815 pathOffset += 13; | 1780 pathOffset += 13; |
| 1816 | 1781 |
| 1817 var query = (req.url).query; | 1782 var query = (req.url).query; |
| 1818 var queryOffset = 0; | 1783 var queryOffset = 0; |
| 1819 var queryMap = {}; | 1784 var queryMap = {}; |
| 1820 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1785 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1821 parseBool(n) { | 1786 parseBool(n) { |
| 1822 if (n == "true") return true; | 1787 if (n == "true") return true; |
| 1823 if (n == "false") return false; | 1788 if (n == "false") return false; |
| 1824 if (n == null) return null; | 1789 if (n == null) return null; |
| 1825 throw new core.ArgumentError("Invalid boolean: $n"); | 1790 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1826 } | 1791 } |
| 1792 |
| 1827 if (query.length > 0) { | 1793 if (query.length > 0) { |
| 1828 for (var part in query.split("&")) { | 1794 for (var part in query.split("&")) { |
| 1829 var keyvalue = part.split("="); | 1795 var keyvalue = part.split("="); |
| 1830 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1796 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1797 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1831 } | 1798 } |
| 1832 } | 1799 } |
| 1833 | 1800 |
| 1834 | |
| 1835 var h = { | 1801 var h = { |
| 1836 "content-type" : "application/json; charset=utf-8", | 1802 "content-type": "application/json; charset=utf-8", |
| 1837 }; | 1803 }; |
| 1838 var resp = convert.JSON.encode(buildServerConfig()); | 1804 var resp = convert.JSON.encode(buildServerConfig()); |
| 1839 return new async.Future.value(stringResponse(200, h, resp)); | 1805 return new async.Future.value(stringResponse(200, h, resp)); |
| 1840 }), true); | 1806 }), true); |
| 1841 res.getServerconfig(arg_projectId, arg_zone).then(unittest.expectAsync1(((
api.ServerConfig response) { | 1807 res |
| 1808 .getServerconfig(arg_projectId, arg_zone) |
| 1809 .then(unittest.expectAsync1(((api.ServerConfig response) { |
| 1842 checkServerConfig(response); | 1810 checkServerConfig(response); |
| 1843 }))); | 1811 }))); |
| 1844 }); | 1812 }); |
| 1845 | |
| 1846 }); | 1813 }); |
| 1847 | 1814 |
| 1848 | |
| 1849 unittest.group("resource-ProjectsZonesClustersResourceApi", () { | 1815 unittest.group("resource-ProjectsZonesClustersResourceApi", () { |
| 1850 unittest.test("method--addons", () { | 1816 unittest.test("method--addons", () { |
| 1851 | |
| 1852 var mock = new HttpServerMock(); | 1817 var mock = new HttpServerMock(); |
| 1853 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 1818 api.ProjectsZonesClustersResourceApi res = |
| 1819 new api.ContainerApi(mock).projects.zones.clusters; |
| 1854 var arg_request = buildSetAddonsConfigRequest(); | 1820 var arg_request = buildSetAddonsConfigRequest(); |
| 1855 var arg_projectId = "foo"; | 1821 var arg_projectId = "foo"; |
| 1856 var arg_zone = "foo"; | 1822 var arg_zone = "foo"; |
| 1857 var arg_clusterId = "foo"; | 1823 var arg_clusterId = "foo"; |
| 1858 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1824 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1859 var obj = new api.SetAddonsConfigRequest.fromJson(json); | 1825 var obj = new api.SetAddonsConfigRequest.fromJson(json); |
| 1860 checkSetAddonsConfigRequest(obj); | 1826 checkSetAddonsConfigRequest(obj); |
| 1861 | 1827 |
| 1862 var path = (req.url).path; | 1828 var path = (req.url).path; |
| 1863 var pathOffset = 0; | 1829 var pathOffset = 0; |
| 1864 var index; | 1830 var index; |
| 1865 var subPart; | 1831 var subPart; |
| 1866 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1832 unittest.expect( |
| 1833 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1867 pathOffset += 1; | 1834 pathOffset += 1; |
| 1868 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1835 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1836 unittest.equals("v1/projects/")); |
| 1869 pathOffset += 12; | 1837 pathOffset += 12; |
| 1870 index = path.indexOf("/zones/", pathOffset); | 1838 index = path.indexOf("/zones/", pathOffset); |
| 1871 unittest.expect(index >= 0, unittest.isTrue); | 1839 unittest.expect(index >= 0, unittest.isTrue); |
| 1872 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1840 subPart = |
| 1841 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1873 pathOffset = index; | 1842 pathOffset = index; |
| 1874 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 1843 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1875 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 1844 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 1845 unittest.equals("/zones/")); |
| 1876 pathOffset += 7; | 1846 pathOffset += 7; |
| 1877 index = path.indexOf("/clusters/", pathOffset); | 1847 index = path.indexOf("/clusters/", pathOffset); |
| 1878 unittest.expect(index >= 0, unittest.isTrue); | 1848 unittest.expect(index >= 0, unittest.isTrue); |
| 1879 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1849 subPart = |
| 1850 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1880 pathOffset = index; | 1851 pathOffset = index; |
| 1881 unittest.expect(subPart, unittest.equals("$arg_zone")); | 1852 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 1882 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 1853 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 1854 unittest.equals("/clusters/")); |
| 1883 pathOffset += 10; | 1855 pathOffset += 10; |
| 1884 index = path.indexOf("/addons", pathOffset); | 1856 index = path.indexOf("/addons", pathOffset); |
| 1885 unittest.expect(index >= 0, unittest.isTrue); | 1857 unittest.expect(index >= 0, unittest.isTrue); |
| 1886 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1858 subPart = |
| 1859 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1887 pathOffset = index; | 1860 pathOffset = index; |
| 1888 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 1861 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 1889 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/addons")); | 1862 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 1863 unittest.equals("/addons")); |
| 1890 pathOffset += 7; | 1864 pathOffset += 7; |
| 1891 | 1865 |
| 1892 var query = (req.url).query; | 1866 var query = (req.url).query; |
| 1893 var queryOffset = 0; | 1867 var queryOffset = 0; |
| 1894 var queryMap = {}; | 1868 var queryMap = {}; |
| 1895 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1869 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1896 parseBool(n) { | 1870 parseBool(n) { |
| 1897 if (n == "true") return true; | 1871 if (n == "true") return true; |
| 1898 if (n == "false") return false; | 1872 if (n == "false") return false; |
| 1899 if (n == null) return null; | 1873 if (n == null) return null; |
| 1900 throw new core.ArgumentError("Invalid boolean: $n"); | 1874 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1901 } | 1875 } |
| 1876 |
| 1902 if (query.length > 0) { | 1877 if (query.length > 0) { |
| 1903 for (var part in query.split("&")) { | 1878 for (var part in query.split("&")) { |
| 1904 var keyvalue = part.split("="); | 1879 var keyvalue = part.split("="); |
| 1905 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1880 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1881 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1906 } | 1882 } |
| 1907 } | 1883 } |
| 1908 | 1884 |
| 1909 | |
| 1910 var h = { | 1885 var h = { |
| 1911 "content-type" : "application/json; charset=utf-8", | 1886 "content-type": "application/json; charset=utf-8", |
| 1912 }; | 1887 }; |
| 1913 var resp = convert.JSON.encode(buildOperation()); | 1888 var resp = convert.JSON.encode(buildOperation()); |
| 1914 return new async.Future.value(stringResponse(200, h, resp)); | 1889 return new async.Future.value(stringResponse(200, h, resp)); |
| 1915 }), true); | 1890 }), true); |
| 1916 res.addons(arg_request, arg_projectId, arg_zone, arg_clusterId).then(unitt
est.expectAsync1(((api.Operation response) { | 1891 res |
| 1892 .addons(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 1893 .then(unittest.expectAsync1(((api.Operation response) { |
| 1917 checkOperation(response); | 1894 checkOperation(response); |
| 1918 }))); | 1895 }))); |
| 1919 }); | 1896 }); |
| 1920 | 1897 |
| 1921 unittest.test("method--completeIpRotation", () { | 1898 unittest.test("method--completeIpRotation", () { |
| 1922 | |
| 1923 var mock = new HttpServerMock(); | 1899 var mock = new HttpServerMock(); |
| 1924 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 1900 api.ProjectsZonesClustersResourceApi res = |
| 1901 new api.ContainerApi(mock).projects.zones.clusters; |
| 1925 var arg_request = buildCompleteIPRotationRequest(); | 1902 var arg_request = buildCompleteIPRotationRequest(); |
| 1926 var arg_projectId = "foo"; | 1903 var arg_projectId = "foo"; |
| 1927 var arg_zone = "foo"; | 1904 var arg_zone = "foo"; |
| 1928 var arg_clusterId = "foo"; | 1905 var arg_clusterId = "foo"; |
| 1929 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1906 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1930 var obj = new api.CompleteIPRotationRequest.fromJson(json); | 1907 var obj = new api.CompleteIPRotationRequest.fromJson(json); |
| 1931 checkCompleteIPRotationRequest(obj); | 1908 checkCompleteIPRotationRequest(obj); |
| 1932 | 1909 |
| 1933 var path = (req.url).path; | 1910 var path = (req.url).path; |
| 1934 var pathOffset = 0; | 1911 var pathOffset = 0; |
| 1935 var index; | 1912 var index; |
| 1936 var subPart; | 1913 var subPart; |
| 1937 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1914 unittest.expect( |
| 1915 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1938 pathOffset += 1; | 1916 pathOffset += 1; |
| 1939 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1917 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1918 unittest.equals("v1/projects/")); |
| 1940 pathOffset += 12; | 1919 pathOffset += 12; |
| 1941 index = path.indexOf("/zones/", pathOffset); | 1920 index = path.indexOf("/zones/", pathOffset); |
| 1942 unittest.expect(index >= 0, unittest.isTrue); | 1921 unittest.expect(index >= 0, unittest.isTrue); |
| 1943 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1922 subPart = |
| 1923 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1944 pathOffset = index; | 1924 pathOffset = index; |
| 1945 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 1925 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1946 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 1926 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 1927 unittest.equals("/zones/")); |
| 1947 pathOffset += 7; | 1928 pathOffset += 7; |
| 1948 index = path.indexOf("/clusters/", pathOffset); | 1929 index = path.indexOf("/clusters/", pathOffset); |
| 1949 unittest.expect(index >= 0, unittest.isTrue); | 1930 unittest.expect(index >= 0, unittest.isTrue); |
| 1950 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1931 subPart = |
| 1932 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1951 pathOffset = index; | 1933 pathOffset = index; |
| 1952 unittest.expect(subPart, unittest.equals("$arg_zone")); | 1934 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 1953 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 1935 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 1936 unittest.equals("/clusters/")); |
| 1954 pathOffset += 10; | 1937 pathOffset += 10; |
| 1955 index = path.indexOf(":completeIpRotation", pathOffset); | 1938 index = path.indexOf(":completeIpRotation", pathOffset); |
| 1956 unittest.expect(index >= 0, unittest.isTrue); | 1939 unittest.expect(index >= 0, unittest.isTrue); |
| 1957 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1940 subPart = |
| 1941 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 1958 pathOffset = index; | 1942 pathOffset = index; |
| 1959 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 1943 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 1960 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals(":completeIpRotation")); | 1944 unittest.expect(path.substring(pathOffset, pathOffset + 19), |
| 1945 unittest.equals(":completeIpRotation")); |
| 1961 pathOffset += 19; | 1946 pathOffset += 19; |
| 1962 | 1947 |
| 1963 var query = (req.url).query; | 1948 var query = (req.url).query; |
| 1964 var queryOffset = 0; | 1949 var queryOffset = 0; |
| 1965 var queryMap = {}; | 1950 var queryMap = {}; |
| 1966 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1951 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1967 parseBool(n) { | 1952 parseBool(n) { |
| 1968 if (n == "true") return true; | 1953 if (n == "true") return true; |
| 1969 if (n == "false") return false; | 1954 if (n == "false") return false; |
| 1970 if (n == null) return null; | 1955 if (n == null) return null; |
| 1971 throw new core.ArgumentError("Invalid boolean: $n"); | 1956 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1972 } | 1957 } |
| 1958 |
| 1973 if (query.length > 0) { | 1959 if (query.length > 0) { |
| 1974 for (var part in query.split("&")) { | 1960 for (var part in query.split("&")) { |
| 1975 var keyvalue = part.split("="); | 1961 var keyvalue = part.split("="); |
| 1976 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1962 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1963 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1977 } | 1964 } |
| 1978 } | 1965 } |
| 1979 | 1966 |
| 1980 | |
| 1981 var h = { | 1967 var h = { |
| 1982 "content-type" : "application/json; charset=utf-8", | 1968 "content-type": "application/json; charset=utf-8", |
| 1983 }; | 1969 }; |
| 1984 var resp = convert.JSON.encode(buildOperation()); | 1970 var resp = convert.JSON.encode(buildOperation()); |
| 1985 return new async.Future.value(stringResponse(200, h, resp)); | 1971 return new async.Future.value(stringResponse(200, h, resp)); |
| 1986 }), true); | 1972 }), true); |
| 1987 res.completeIpRotation(arg_request, arg_projectId, arg_zone, arg_clusterId
).then(unittest.expectAsync1(((api.Operation response) { | 1973 res |
| 1974 .completeIpRotation( |
| 1975 arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 1976 .then(unittest.expectAsync1(((api.Operation response) { |
| 1988 checkOperation(response); | 1977 checkOperation(response); |
| 1989 }))); | 1978 }))); |
| 1990 }); | 1979 }); |
| 1991 | 1980 |
| 1992 unittest.test("method--create", () { | 1981 unittest.test("method--create", () { |
| 1993 | |
| 1994 var mock = new HttpServerMock(); | 1982 var mock = new HttpServerMock(); |
| 1995 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 1983 api.ProjectsZonesClustersResourceApi res = |
| 1984 new api.ContainerApi(mock).projects.zones.clusters; |
| 1996 var arg_request = buildCreateClusterRequest(); | 1985 var arg_request = buildCreateClusterRequest(); |
| 1997 var arg_projectId = "foo"; | 1986 var arg_projectId = "foo"; |
| 1998 var arg_zone = "foo"; | 1987 var arg_zone = "foo"; |
| 1999 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1988 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2000 var obj = new api.CreateClusterRequest.fromJson(json); | 1989 var obj = new api.CreateClusterRequest.fromJson(json); |
| 2001 checkCreateClusterRequest(obj); | 1990 checkCreateClusterRequest(obj); |
| 2002 | 1991 |
| 2003 var path = (req.url).path; | 1992 var path = (req.url).path; |
| 2004 var pathOffset = 0; | 1993 var pathOffset = 0; |
| 2005 var index; | 1994 var index; |
| 2006 var subPart; | 1995 var subPart; |
| 2007 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1996 unittest.expect( |
| 1997 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2008 pathOffset += 1; | 1998 pathOffset += 1; |
| 2009 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 1999 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2000 unittest.equals("v1/projects/")); |
| 2010 pathOffset += 12; | 2001 pathOffset += 12; |
| 2011 index = path.indexOf("/zones/", pathOffset); | 2002 index = path.indexOf("/zones/", pathOffset); |
| 2012 unittest.expect(index >= 0, unittest.isTrue); | 2003 unittest.expect(index >= 0, unittest.isTrue); |
| 2013 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2004 subPart = |
| 2005 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2014 pathOffset = index; | 2006 pathOffset = index; |
| 2015 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2007 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2016 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2008 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2009 unittest.equals("/zones/")); |
| 2017 pathOffset += 7; | 2010 pathOffset += 7; |
| 2018 index = path.indexOf("/clusters", pathOffset); | 2011 index = path.indexOf("/clusters", pathOffset); |
| 2019 unittest.expect(index >= 0, unittest.isTrue); | 2012 unittest.expect(index >= 0, unittest.isTrue); |
| 2020 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2013 subPart = |
| 2014 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2021 pathOffset = index; | 2015 pathOffset = index; |
| 2022 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2016 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2023 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clusters")); | 2017 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2018 unittest.equals("/clusters")); |
| 2024 pathOffset += 9; | 2019 pathOffset += 9; |
| 2025 | 2020 |
| 2026 var query = (req.url).query; | 2021 var query = (req.url).query; |
| 2027 var queryOffset = 0; | 2022 var queryOffset = 0; |
| 2028 var queryMap = {}; | 2023 var queryMap = {}; |
| 2029 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2024 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2030 parseBool(n) { | 2025 parseBool(n) { |
| 2031 if (n == "true") return true; | 2026 if (n == "true") return true; |
| 2032 if (n == "false") return false; | 2027 if (n == "false") return false; |
| 2033 if (n == null) return null; | 2028 if (n == null) return null; |
| 2034 throw new core.ArgumentError("Invalid boolean: $n"); | 2029 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2035 } | 2030 } |
| 2031 |
| 2036 if (query.length > 0) { | 2032 if (query.length > 0) { |
| 2037 for (var part in query.split("&")) { | 2033 for (var part in query.split("&")) { |
| 2038 var keyvalue = part.split("="); | 2034 var keyvalue = part.split("="); |
| 2039 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2035 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2036 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2040 } | 2037 } |
| 2041 } | 2038 } |
| 2042 | 2039 |
| 2043 | |
| 2044 var h = { | 2040 var h = { |
| 2045 "content-type" : "application/json; charset=utf-8", | 2041 "content-type": "application/json; charset=utf-8", |
| 2046 }; | 2042 }; |
| 2047 var resp = convert.JSON.encode(buildOperation()); | 2043 var resp = convert.JSON.encode(buildOperation()); |
| 2048 return new async.Future.value(stringResponse(200, h, resp)); | 2044 return new async.Future.value(stringResponse(200, h, resp)); |
| 2049 }), true); | 2045 }), true); |
| 2050 res.create(arg_request, arg_projectId, arg_zone).then(unittest.expectAsync
1(((api.Operation response) { | 2046 res |
| 2047 .create(arg_request, arg_projectId, arg_zone) |
| 2048 .then(unittest.expectAsync1(((api.Operation response) { |
| 2051 checkOperation(response); | 2049 checkOperation(response); |
| 2052 }))); | 2050 }))); |
| 2053 }); | 2051 }); |
| 2054 | 2052 |
| 2055 unittest.test("method--delete", () { | 2053 unittest.test("method--delete", () { |
| 2056 | |
| 2057 var mock = new HttpServerMock(); | 2054 var mock = new HttpServerMock(); |
| 2058 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2055 api.ProjectsZonesClustersResourceApi res = |
| 2056 new api.ContainerApi(mock).projects.zones.clusters; |
| 2059 var arg_projectId = "foo"; | 2057 var arg_projectId = "foo"; |
| 2060 var arg_zone = "foo"; | 2058 var arg_zone = "foo"; |
| 2061 var arg_clusterId = "foo"; | 2059 var arg_clusterId = "foo"; |
| 2062 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2060 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2063 var path = (req.url).path; | 2061 var path = (req.url).path; |
| 2064 var pathOffset = 0; | 2062 var pathOffset = 0; |
| 2065 var index; | 2063 var index; |
| 2066 var subPart; | 2064 var subPart; |
| 2067 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2065 unittest.expect( |
| 2066 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2068 pathOffset += 1; | 2067 pathOffset += 1; |
| 2069 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2068 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2069 unittest.equals("v1/projects/")); |
| 2070 pathOffset += 12; | 2070 pathOffset += 12; |
| 2071 index = path.indexOf("/zones/", pathOffset); | 2071 index = path.indexOf("/zones/", pathOffset); |
| 2072 unittest.expect(index >= 0, unittest.isTrue); | 2072 unittest.expect(index >= 0, unittest.isTrue); |
| 2073 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2073 subPart = |
| 2074 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2074 pathOffset = index; | 2075 pathOffset = index; |
| 2075 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2076 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2076 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2077 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2078 unittest.equals("/zones/")); |
| 2077 pathOffset += 7; | 2079 pathOffset += 7; |
| 2078 index = path.indexOf("/clusters/", pathOffset); | 2080 index = path.indexOf("/clusters/", pathOffset); |
| 2079 unittest.expect(index >= 0, unittest.isTrue); | 2081 unittest.expect(index >= 0, unittest.isTrue); |
| 2080 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2082 subPart = |
| 2083 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2081 pathOffset = index; | 2084 pathOffset = index; |
| 2082 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2085 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2083 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2086 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2087 unittest.equals("/clusters/")); |
| 2084 pathOffset += 10; | 2088 pathOffset += 10; |
| 2085 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2089 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2086 pathOffset = path.length; | 2090 pathOffset = path.length; |
| 2087 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2091 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2088 | 2092 |
| 2089 var query = (req.url).query; | 2093 var query = (req.url).query; |
| 2090 var queryOffset = 0; | 2094 var queryOffset = 0; |
| 2091 var queryMap = {}; | 2095 var queryMap = {}; |
| 2092 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2096 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2093 parseBool(n) { | 2097 parseBool(n) { |
| 2094 if (n == "true") return true; | 2098 if (n == "true") return true; |
| 2095 if (n == "false") return false; | 2099 if (n == "false") return false; |
| 2096 if (n == null) return null; | 2100 if (n == null) return null; |
| 2097 throw new core.ArgumentError("Invalid boolean: $n"); | 2101 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2098 } | 2102 } |
| 2103 |
| 2099 if (query.length > 0) { | 2104 if (query.length > 0) { |
| 2100 for (var part in query.split("&")) { | 2105 for (var part in query.split("&")) { |
| 2101 var keyvalue = part.split("="); | 2106 var keyvalue = part.split("="); |
| 2102 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2107 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2108 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2103 } | 2109 } |
| 2104 } | 2110 } |
| 2105 | 2111 |
| 2106 | |
| 2107 var h = { | 2112 var h = { |
| 2108 "content-type" : "application/json; charset=utf-8", | 2113 "content-type": "application/json; charset=utf-8", |
| 2109 }; | 2114 }; |
| 2110 var resp = convert.JSON.encode(buildOperation()); | 2115 var resp = convert.JSON.encode(buildOperation()); |
| 2111 return new async.Future.value(stringResponse(200, h, resp)); | 2116 return new async.Future.value(stringResponse(200, h, resp)); |
| 2112 }), true); | 2117 }), true); |
| 2113 res.delete(arg_projectId, arg_zone, arg_clusterId).then(unittest.expectAsy
nc1(((api.Operation response) { | 2118 res |
| 2119 .delete(arg_projectId, arg_zone, arg_clusterId) |
| 2120 .then(unittest.expectAsync1(((api.Operation response) { |
| 2114 checkOperation(response); | 2121 checkOperation(response); |
| 2115 }))); | 2122 }))); |
| 2116 }); | 2123 }); |
| 2117 | 2124 |
| 2118 unittest.test("method--get", () { | 2125 unittest.test("method--get", () { |
| 2119 | |
| 2120 var mock = new HttpServerMock(); | 2126 var mock = new HttpServerMock(); |
| 2121 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2127 api.ProjectsZonesClustersResourceApi res = |
| 2128 new api.ContainerApi(mock).projects.zones.clusters; |
| 2122 var arg_projectId = "foo"; | 2129 var arg_projectId = "foo"; |
| 2123 var arg_zone = "foo"; | 2130 var arg_zone = "foo"; |
| 2124 var arg_clusterId = "foo"; | 2131 var arg_clusterId = "foo"; |
| 2125 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2132 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2126 var path = (req.url).path; | 2133 var path = (req.url).path; |
| 2127 var pathOffset = 0; | 2134 var pathOffset = 0; |
| 2128 var index; | 2135 var index; |
| 2129 var subPart; | 2136 var subPart; |
| 2130 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2137 unittest.expect( |
| 2138 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2131 pathOffset += 1; | 2139 pathOffset += 1; |
| 2132 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2140 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2141 unittest.equals("v1/projects/")); |
| 2133 pathOffset += 12; | 2142 pathOffset += 12; |
| 2134 index = path.indexOf("/zones/", pathOffset); | 2143 index = path.indexOf("/zones/", pathOffset); |
| 2135 unittest.expect(index >= 0, unittest.isTrue); | 2144 unittest.expect(index >= 0, unittest.isTrue); |
| 2136 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2145 subPart = |
| 2146 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2137 pathOffset = index; | 2147 pathOffset = index; |
| 2138 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2148 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2139 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2149 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2150 unittest.equals("/zones/")); |
| 2140 pathOffset += 7; | 2151 pathOffset += 7; |
| 2141 index = path.indexOf("/clusters/", pathOffset); | 2152 index = path.indexOf("/clusters/", pathOffset); |
| 2142 unittest.expect(index >= 0, unittest.isTrue); | 2153 unittest.expect(index >= 0, unittest.isTrue); |
| 2143 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2154 subPart = |
| 2155 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2144 pathOffset = index; | 2156 pathOffset = index; |
| 2145 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2157 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2146 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2158 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2159 unittest.equals("/clusters/")); |
| 2147 pathOffset += 10; | 2160 pathOffset += 10; |
| 2148 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2161 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2149 pathOffset = path.length; | 2162 pathOffset = path.length; |
| 2150 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2163 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2151 | 2164 |
| 2152 var query = (req.url).query; | 2165 var query = (req.url).query; |
| 2153 var queryOffset = 0; | 2166 var queryOffset = 0; |
| 2154 var queryMap = {}; | 2167 var queryMap = {}; |
| 2155 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2168 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2156 parseBool(n) { | 2169 parseBool(n) { |
| 2157 if (n == "true") return true; | 2170 if (n == "true") return true; |
| 2158 if (n == "false") return false; | 2171 if (n == "false") return false; |
| 2159 if (n == null) return null; | 2172 if (n == null) return null; |
| 2160 throw new core.ArgumentError("Invalid boolean: $n"); | 2173 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2161 } | 2174 } |
| 2175 |
| 2162 if (query.length > 0) { | 2176 if (query.length > 0) { |
| 2163 for (var part in query.split("&")) { | 2177 for (var part in query.split("&")) { |
| 2164 var keyvalue = part.split("="); | 2178 var keyvalue = part.split("="); |
| 2165 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2179 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2180 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2166 } | 2181 } |
| 2167 } | 2182 } |
| 2168 | 2183 |
| 2169 | |
| 2170 var h = { | 2184 var h = { |
| 2171 "content-type" : "application/json; charset=utf-8", | 2185 "content-type": "application/json; charset=utf-8", |
| 2172 }; | 2186 }; |
| 2173 var resp = convert.JSON.encode(buildCluster()); | 2187 var resp = convert.JSON.encode(buildCluster()); |
| 2174 return new async.Future.value(stringResponse(200, h, resp)); | 2188 return new async.Future.value(stringResponse(200, h, resp)); |
| 2175 }), true); | 2189 }), true); |
| 2176 res.get(arg_projectId, arg_zone, arg_clusterId).then(unittest.expectAsync1
(((api.Cluster response) { | 2190 res |
| 2191 .get(arg_projectId, arg_zone, arg_clusterId) |
| 2192 .then(unittest.expectAsync1(((api.Cluster response) { |
| 2177 checkCluster(response); | 2193 checkCluster(response); |
| 2178 }))); | 2194 }))); |
| 2179 }); | 2195 }); |
| 2180 | 2196 |
| 2181 unittest.test("method--legacyAbac", () { | 2197 unittest.test("method--legacyAbac", () { |
| 2182 | |
| 2183 var mock = new HttpServerMock(); | 2198 var mock = new HttpServerMock(); |
| 2184 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2199 api.ProjectsZonesClustersResourceApi res = |
| 2200 new api.ContainerApi(mock).projects.zones.clusters; |
| 2185 var arg_request = buildSetLegacyAbacRequest(); | 2201 var arg_request = buildSetLegacyAbacRequest(); |
| 2186 var arg_projectId = "foo"; | 2202 var arg_projectId = "foo"; |
| 2187 var arg_zone = "foo"; | 2203 var arg_zone = "foo"; |
| 2188 var arg_clusterId = "foo"; | 2204 var arg_clusterId = "foo"; |
| 2189 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2205 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2190 var obj = new api.SetLegacyAbacRequest.fromJson(json); | 2206 var obj = new api.SetLegacyAbacRequest.fromJson(json); |
| 2191 checkSetLegacyAbacRequest(obj); | 2207 checkSetLegacyAbacRequest(obj); |
| 2192 | 2208 |
| 2193 var path = (req.url).path; | 2209 var path = (req.url).path; |
| 2194 var pathOffset = 0; | 2210 var pathOffset = 0; |
| 2195 var index; | 2211 var index; |
| 2196 var subPart; | 2212 var subPart; |
| 2197 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2213 unittest.expect( |
| 2214 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2198 pathOffset += 1; | 2215 pathOffset += 1; |
| 2199 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2216 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2217 unittest.equals("v1/projects/")); |
| 2200 pathOffset += 12; | 2218 pathOffset += 12; |
| 2201 index = path.indexOf("/zones/", pathOffset); | 2219 index = path.indexOf("/zones/", pathOffset); |
| 2202 unittest.expect(index >= 0, unittest.isTrue); | 2220 unittest.expect(index >= 0, unittest.isTrue); |
| 2203 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2221 subPart = |
| 2222 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2204 pathOffset = index; | 2223 pathOffset = index; |
| 2205 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2224 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2206 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2225 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2226 unittest.equals("/zones/")); |
| 2207 pathOffset += 7; | 2227 pathOffset += 7; |
| 2208 index = path.indexOf("/clusters/", pathOffset); | 2228 index = path.indexOf("/clusters/", pathOffset); |
| 2209 unittest.expect(index >= 0, unittest.isTrue); | 2229 unittest.expect(index >= 0, unittest.isTrue); |
| 2210 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2230 subPart = |
| 2231 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2211 pathOffset = index; | 2232 pathOffset = index; |
| 2212 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2233 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2213 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2234 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2235 unittest.equals("/clusters/")); |
| 2214 pathOffset += 10; | 2236 pathOffset += 10; |
| 2215 index = path.indexOf("/legacyAbac", pathOffset); | 2237 index = path.indexOf("/legacyAbac", pathOffset); |
| 2216 unittest.expect(index >= 0, unittest.isTrue); | 2238 unittest.expect(index >= 0, unittest.isTrue); |
| 2217 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2239 subPart = |
| 2240 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2218 pathOffset = index; | 2241 pathOffset = index; |
| 2219 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2242 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2220 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/legacyAbac")); | 2243 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2244 unittest.equals("/legacyAbac")); |
| 2221 pathOffset += 11; | 2245 pathOffset += 11; |
| 2222 | 2246 |
| 2223 var query = (req.url).query; | 2247 var query = (req.url).query; |
| 2224 var queryOffset = 0; | 2248 var queryOffset = 0; |
| 2225 var queryMap = {}; | 2249 var queryMap = {}; |
| 2226 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2250 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2227 parseBool(n) { | 2251 parseBool(n) { |
| 2228 if (n == "true") return true; | 2252 if (n == "true") return true; |
| 2229 if (n == "false") return false; | 2253 if (n == "false") return false; |
| 2230 if (n == null) return null; | 2254 if (n == null) return null; |
| 2231 throw new core.ArgumentError("Invalid boolean: $n"); | 2255 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2232 } | 2256 } |
| 2257 |
| 2233 if (query.length > 0) { | 2258 if (query.length > 0) { |
| 2234 for (var part in query.split("&")) { | 2259 for (var part in query.split("&")) { |
| 2235 var keyvalue = part.split("="); | 2260 var keyvalue = part.split("="); |
| 2236 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2261 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2262 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2237 } | 2263 } |
| 2238 } | 2264 } |
| 2239 | 2265 |
| 2240 | |
| 2241 var h = { | 2266 var h = { |
| 2242 "content-type" : "application/json; charset=utf-8", | 2267 "content-type": "application/json; charset=utf-8", |
| 2243 }; | 2268 }; |
| 2244 var resp = convert.JSON.encode(buildOperation()); | 2269 var resp = convert.JSON.encode(buildOperation()); |
| 2245 return new async.Future.value(stringResponse(200, h, resp)); | 2270 return new async.Future.value(stringResponse(200, h, resp)); |
| 2246 }), true); | 2271 }), true); |
| 2247 res.legacyAbac(arg_request, arg_projectId, arg_zone, arg_clusterId).then(u
nittest.expectAsync1(((api.Operation response) { | 2272 res |
| 2273 .legacyAbac(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2274 .then(unittest.expectAsync1(((api.Operation response) { |
| 2248 checkOperation(response); | 2275 checkOperation(response); |
| 2249 }))); | 2276 }))); |
| 2250 }); | 2277 }); |
| 2251 | 2278 |
| 2252 unittest.test("method--list", () { | 2279 unittest.test("method--list", () { |
| 2253 | |
| 2254 var mock = new HttpServerMock(); | 2280 var mock = new HttpServerMock(); |
| 2255 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2281 api.ProjectsZonesClustersResourceApi res = |
| 2282 new api.ContainerApi(mock).projects.zones.clusters; |
| 2256 var arg_projectId = "foo"; | 2283 var arg_projectId = "foo"; |
| 2257 var arg_zone = "foo"; | 2284 var arg_zone = "foo"; |
| 2258 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2285 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2259 var path = (req.url).path; | 2286 var path = (req.url).path; |
| 2260 var pathOffset = 0; | 2287 var pathOffset = 0; |
| 2261 var index; | 2288 var index; |
| 2262 var subPart; | 2289 var subPart; |
| 2263 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2290 unittest.expect( |
| 2291 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2264 pathOffset += 1; | 2292 pathOffset += 1; |
| 2265 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2293 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2294 unittest.equals("v1/projects/")); |
| 2266 pathOffset += 12; | 2295 pathOffset += 12; |
| 2267 index = path.indexOf("/zones/", pathOffset); | 2296 index = path.indexOf("/zones/", pathOffset); |
| 2268 unittest.expect(index >= 0, unittest.isTrue); | 2297 unittest.expect(index >= 0, unittest.isTrue); |
| 2269 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2298 subPart = |
| 2299 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2270 pathOffset = index; | 2300 pathOffset = index; |
| 2271 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2301 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2272 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2302 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2303 unittest.equals("/zones/")); |
| 2273 pathOffset += 7; | 2304 pathOffset += 7; |
| 2274 index = path.indexOf("/clusters", pathOffset); | 2305 index = path.indexOf("/clusters", pathOffset); |
| 2275 unittest.expect(index >= 0, unittest.isTrue); | 2306 unittest.expect(index >= 0, unittest.isTrue); |
| 2276 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2307 subPart = |
| 2308 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2277 pathOffset = index; | 2309 pathOffset = index; |
| 2278 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2310 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2279 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clusters")); | 2311 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2312 unittest.equals("/clusters")); |
| 2280 pathOffset += 9; | 2313 pathOffset += 9; |
| 2281 | 2314 |
| 2282 var query = (req.url).query; | 2315 var query = (req.url).query; |
| 2283 var queryOffset = 0; | 2316 var queryOffset = 0; |
| 2284 var queryMap = {}; | 2317 var queryMap = {}; |
| 2285 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2318 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2286 parseBool(n) { | 2319 parseBool(n) { |
| 2287 if (n == "true") return true; | 2320 if (n == "true") return true; |
| 2288 if (n == "false") return false; | 2321 if (n == "false") return false; |
| 2289 if (n == null) return null; | 2322 if (n == null) return null; |
| 2290 throw new core.ArgumentError("Invalid boolean: $n"); | 2323 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2291 } | 2324 } |
| 2325 |
| 2292 if (query.length > 0) { | 2326 if (query.length > 0) { |
| 2293 for (var part in query.split("&")) { | 2327 for (var part in query.split("&")) { |
| 2294 var keyvalue = part.split("="); | 2328 var keyvalue = part.split("="); |
| 2295 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2329 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2330 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2296 } | 2331 } |
| 2297 } | 2332 } |
| 2298 | 2333 |
| 2299 | |
| 2300 var h = { | 2334 var h = { |
| 2301 "content-type" : "application/json; charset=utf-8", | 2335 "content-type": "application/json; charset=utf-8", |
| 2302 }; | 2336 }; |
| 2303 var resp = convert.JSON.encode(buildListClustersResponse()); | 2337 var resp = convert.JSON.encode(buildListClustersResponse()); |
| 2304 return new async.Future.value(stringResponse(200, h, resp)); | 2338 return new async.Future.value(stringResponse(200, h, resp)); |
| 2305 }), true); | 2339 }), true); |
| 2306 res.list(arg_projectId, arg_zone).then(unittest.expectAsync1(((api.ListClu
stersResponse response) { | 2340 res |
| 2341 .list(arg_projectId, arg_zone) |
| 2342 .then(unittest.expectAsync1(((api.ListClustersResponse response) { |
| 2307 checkListClustersResponse(response); | 2343 checkListClustersResponse(response); |
| 2308 }))); | 2344 }))); |
| 2309 }); | 2345 }); |
| 2310 | 2346 |
| 2311 unittest.test("method--locations", () { | 2347 unittest.test("method--locations", () { |
| 2312 | |
| 2313 var mock = new HttpServerMock(); | 2348 var mock = new HttpServerMock(); |
| 2314 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2349 api.ProjectsZonesClustersResourceApi res = |
| 2350 new api.ContainerApi(mock).projects.zones.clusters; |
| 2315 var arg_request = buildSetLocationsRequest(); | 2351 var arg_request = buildSetLocationsRequest(); |
| 2316 var arg_projectId = "foo"; | 2352 var arg_projectId = "foo"; |
| 2317 var arg_zone = "foo"; | 2353 var arg_zone = "foo"; |
| 2318 var arg_clusterId = "foo"; | 2354 var arg_clusterId = "foo"; |
| 2319 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2355 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2320 var obj = new api.SetLocationsRequest.fromJson(json); | 2356 var obj = new api.SetLocationsRequest.fromJson(json); |
| 2321 checkSetLocationsRequest(obj); | 2357 checkSetLocationsRequest(obj); |
| 2322 | 2358 |
| 2323 var path = (req.url).path; | 2359 var path = (req.url).path; |
| 2324 var pathOffset = 0; | 2360 var pathOffset = 0; |
| 2325 var index; | 2361 var index; |
| 2326 var subPart; | 2362 var subPart; |
| 2327 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2363 unittest.expect( |
| 2364 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2328 pathOffset += 1; | 2365 pathOffset += 1; |
| 2329 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2366 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2367 unittest.equals("v1/projects/")); |
| 2330 pathOffset += 12; | 2368 pathOffset += 12; |
| 2331 index = path.indexOf("/zones/", pathOffset); | 2369 index = path.indexOf("/zones/", pathOffset); |
| 2332 unittest.expect(index >= 0, unittest.isTrue); | 2370 unittest.expect(index >= 0, unittest.isTrue); |
| 2333 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2371 subPart = |
| 2372 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2334 pathOffset = index; | 2373 pathOffset = index; |
| 2335 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2374 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2336 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2375 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2376 unittest.equals("/zones/")); |
| 2337 pathOffset += 7; | 2377 pathOffset += 7; |
| 2338 index = path.indexOf("/clusters/", pathOffset); | 2378 index = path.indexOf("/clusters/", pathOffset); |
| 2339 unittest.expect(index >= 0, unittest.isTrue); | 2379 unittest.expect(index >= 0, unittest.isTrue); |
| 2340 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2380 subPart = |
| 2381 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2341 pathOffset = index; | 2382 pathOffset = index; |
| 2342 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2383 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2343 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2384 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2385 unittest.equals("/clusters/")); |
| 2344 pathOffset += 10; | 2386 pathOffset += 10; |
| 2345 index = path.indexOf("/locations", pathOffset); | 2387 index = path.indexOf("/locations", pathOffset); |
| 2346 unittest.expect(index >= 0, unittest.isTrue); | 2388 unittest.expect(index >= 0, unittest.isTrue); |
| 2347 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2389 subPart = |
| 2390 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2348 pathOffset = index; | 2391 pathOffset = index; |
| 2349 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2392 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2350 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/locations")); | 2393 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2394 unittest.equals("/locations")); |
| 2351 pathOffset += 10; | 2395 pathOffset += 10; |
| 2352 | 2396 |
| 2353 var query = (req.url).query; | 2397 var query = (req.url).query; |
| 2354 var queryOffset = 0; | 2398 var queryOffset = 0; |
| 2355 var queryMap = {}; | 2399 var queryMap = {}; |
| 2356 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2400 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2357 parseBool(n) { | 2401 parseBool(n) { |
| 2358 if (n == "true") return true; | 2402 if (n == "true") return true; |
| 2359 if (n == "false") return false; | 2403 if (n == "false") return false; |
| 2360 if (n == null) return null; | 2404 if (n == null) return null; |
| 2361 throw new core.ArgumentError("Invalid boolean: $n"); | 2405 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2362 } | 2406 } |
| 2407 |
| 2363 if (query.length > 0) { | 2408 if (query.length > 0) { |
| 2364 for (var part in query.split("&")) { | 2409 for (var part in query.split("&")) { |
| 2365 var keyvalue = part.split("="); | 2410 var keyvalue = part.split("="); |
| 2366 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2411 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2412 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2367 } | 2413 } |
| 2368 } | 2414 } |
| 2369 | 2415 |
| 2370 | |
| 2371 var h = { | 2416 var h = { |
| 2372 "content-type" : "application/json; charset=utf-8", | 2417 "content-type": "application/json; charset=utf-8", |
| 2373 }; | 2418 }; |
| 2374 var resp = convert.JSON.encode(buildOperation()); | 2419 var resp = convert.JSON.encode(buildOperation()); |
| 2375 return new async.Future.value(stringResponse(200, h, resp)); | 2420 return new async.Future.value(stringResponse(200, h, resp)); |
| 2376 }), true); | 2421 }), true); |
| 2377 res.locations(arg_request, arg_projectId, arg_zone, arg_clusterId).then(un
ittest.expectAsync1(((api.Operation response) { | 2422 res |
| 2423 .locations(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2424 .then(unittest.expectAsync1(((api.Operation response) { |
| 2378 checkOperation(response); | 2425 checkOperation(response); |
| 2379 }))); | 2426 }))); |
| 2380 }); | 2427 }); |
| 2381 | 2428 |
| 2382 unittest.test("method--logging", () { | 2429 unittest.test("method--logging", () { |
| 2383 | |
| 2384 var mock = new HttpServerMock(); | 2430 var mock = new HttpServerMock(); |
| 2385 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2431 api.ProjectsZonesClustersResourceApi res = |
| 2432 new api.ContainerApi(mock).projects.zones.clusters; |
| 2386 var arg_request = buildSetLoggingServiceRequest(); | 2433 var arg_request = buildSetLoggingServiceRequest(); |
| 2387 var arg_projectId = "foo"; | 2434 var arg_projectId = "foo"; |
| 2388 var arg_zone = "foo"; | 2435 var arg_zone = "foo"; |
| 2389 var arg_clusterId = "foo"; | 2436 var arg_clusterId = "foo"; |
| 2390 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2437 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2391 var obj = new api.SetLoggingServiceRequest.fromJson(json); | 2438 var obj = new api.SetLoggingServiceRequest.fromJson(json); |
| 2392 checkSetLoggingServiceRequest(obj); | 2439 checkSetLoggingServiceRequest(obj); |
| 2393 | 2440 |
| 2394 var path = (req.url).path; | 2441 var path = (req.url).path; |
| 2395 var pathOffset = 0; | 2442 var pathOffset = 0; |
| 2396 var index; | 2443 var index; |
| 2397 var subPart; | 2444 var subPart; |
| 2398 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2445 unittest.expect( |
| 2446 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2399 pathOffset += 1; | 2447 pathOffset += 1; |
| 2400 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2448 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2449 unittest.equals("v1/projects/")); |
| 2401 pathOffset += 12; | 2450 pathOffset += 12; |
| 2402 index = path.indexOf("/zones/", pathOffset); | 2451 index = path.indexOf("/zones/", pathOffset); |
| 2403 unittest.expect(index >= 0, unittest.isTrue); | 2452 unittest.expect(index >= 0, unittest.isTrue); |
| 2404 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2453 subPart = |
| 2454 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2405 pathOffset = index; | 2455 pathOffset = index; |
| 2406 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2456 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2407 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2457 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2458 unittest.equals("/zones/")); |
| 2408 pathOffset += 7; | 2459 pathOffset += 7; |
| 2409 index = path.indexOf("/clusters/", pathOffset); | 2460 index = path.indexOf("/clusters/", pathOffset); |
| 2410 unittest.expect(index >= 0, unittest.isTrue); | 2461 unittest.expect(index >= 0, unittest.isTrue); |
| 2411 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2462 subPart = |
| 2463 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2412 pathOffset = index; | 2464 pathOffset = index; |
| 2413 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2465 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2414 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2466 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2467 unittest.equals("/clusters/")); |
| 2415 pathOffset += 10; | 2468 pathOffset += 10; |
| 2416 index = path.indexOf("/logging", pathOffset); | 2469 index = path.indexOf("/logging", pathOffset); |
| 2417 unittest.expect(index >= 0, unittest.isTrue); | 2470 unittest.expect(index >= 0, unittest.isTrue); |
| 2418 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2471 subPart = |
| 2472 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2419 pathOffset = index; | 2473 pathOffset = index; |
| 2420 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2474 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2421 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/logging")); | 2475 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 2476 unittest.equals("/logging")); |
| 2422 pathOffset += 8; | 2477 pathOffset += 8; |
| 2423 | 2478 |
| 2424 var query = (req.url).query; | 2479 var query = (req.url).query; |
| 2425 var queryOffset = 0; | 2480 var queryOffset = 0; |
| 2426 var queryMap = {}; | 2481 var queryMap = {}; |
| 2427 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2482 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2428 parseBool(n) { | 2483 parseBool(n) { |
| 2429 if (n == "true") return true; | 2484 if (n == "true") return true; |
| 2430 if (n == "false") return false; | 2485 if (n == "false") return false; |
| 2431 if (n == null) return null; | 2486 if (n == null) return null; |
| 2432 throw new core.ArgumentError("Invalid boolean: $n"); | 2487 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2433 } | 2488 } |
| 2489 |
| 2434 if (query.length > 0) { | 2490 if (query.length > 0) { |
| 2435 for (var part in query.split("&")) { | 2491 for (var part in query.split("&")) { |
| 2436 var keyvalue = part.split("="); | 2492 var keyvalue = part.split("="); |
| 2437 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2493 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2494 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2438 } | 2495 } |
| 2439 } | 2496 } |
| 2440 | 2497 |
| 2441 | |
| 2442 var h = { | 2498 var h = { |
| 2443 "content-type" : "application/json; charset=utf-8", | 2499 "content-type": "application/json; charset=utf-8", |
| 2444 }; | 2500 }; |
| 2445 var resp = convert.JSON.encode(buildOperation()); | 2501 var resp = convert.JSON.encode(buildOperation()); |
| 2446 return new async.Future.value(stringResponse(200, h, resp)); | 2502 return new async.Future.value(stringResponse(200, h, resp)); |
| 2447 }), true); | 2503 }), true); |
| 2448 res.logging(arg_request, arg_projectId, arg_zone, arg_clusterId).then(unit
test.expectAsync1(((api.Operation response) { | 2504 res |
| 2505 .logging(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2506 .then(unittest.expectAsync1(((api.Operation response) { |
| 2449 checkOperation(response); | 2507 checkOperation(response); |
| 2450 }))); | 2508 }))); |
| 2451 }); | 2509 }); |
| 2452 | 2510 |
| 2453 unittest.test("method--master", () { | 2511 unittest.test("method--master", () { |
| 2454 | |
| 2455 var mock = new HttpServerMock(); | 2512 var mock = new HttpServerMock(); |
| 2456 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2513 api.ProjectsZonesClustersResourceApi res = |
| 2514 new api.ContainerApi(mock).projects.zones.clusters; |
| 2457 var arg_request = buildUpdateMasterRequest(); | 2515 var arg_request = buildUpdateMasterRequest(); |
| 2458 var arg_projectId = "foo"; | 2516 var arg_projectId = "foo"; |
| 2459 var arg_zone = "foo"; | 2517 var arg_zone = "foo"; |
| 2460 var arg_clusterId = "foo"; | 2518 var arg_clusterId = "foo"; |
| 2461 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2519 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2462 var obj = new api.UpdateMasterRequest.fromJson(json); | 2520 var obj = new api.UpdateMasterRequest.fromJson(json); |
| 2463 checkUpdateMasterRequest(obj); | 2521 checkUpdateMasterRequest(obj); |
| 2464 | 2522 |
| 2465 var path = (req.url).path; | 2523 var path = (req.url).path; |
| 2466 var pathOffset = 0; | 2524 var pathOffset = 0; |
| 2467 var index; | 2525 var index; |
| 2468 var subPart; | 2526 var subPart; |
| 2469 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2527 unittest.expect( |
| 2528 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2470 pathOffset += 1; | 2529 pathOffset += 1; |
| 2471 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2530 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2531 unittest.equals("v1/projects/")); |
| 2472 pathOffset += 12; | 2532 pathOffset += 12; |
| 2473 index = path.indexOf("/zones/", pathOffset); | 2533 index = path.indexOf("/zones/", pathOffset); |
| 2474 unittest.expect(index >= 0, unittest.isTrue); | 2534 unittest.expect(index >= 0, unittest.isTrue); |
| 2475 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2535 subPart = |
| 2536 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2476 pathOffset = index; | 2537 pathOffset = index; |
| 2477 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2538 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2478 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2539 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2540 unittest.equals("/zones/")); |
| 2479 pathOffset += 7; | 2541 pathOffset += 7; |
| 2480 index = path.indexOf("/clusters/", pathOffset); | 2542 index = path.indexOf("/clusters/", pathOffset); |
| 2481 unittest.expect(index >= 0, unittest.isTrue); | 2543 unittest.expect(index >= 0, unittest.isTrue); |
| 2482 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2544 subPart = |
| 2545 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2483 pathOffset = index; | 2546 pathOffset = index; |
| 2484 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2547 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2485 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2548 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2549 unittest.equals("/clusters/")); |
| 2486 pathOffset += 10; | 2550 pathOffset += 10; |
| 2487 index = path.indexOf("/master", pathOffset); | 2551 index = path.indexOf("/master", pathOffset); |
| 2488 unittest.expect(index >= 0, unittest.isTrue); | 2552 unittest.expect(index >= 0, unittest.isTrue); |
| 2489 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2553 subPart = |
| 2554 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2490 pathOffset = index; | 2555 pathOffset = index; |
| 2491 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2556 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2492 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/master")); | 2557 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2558 unittest.equals("/master")); |
| 2493 pathOffset += 7; | 2559 pathOffset += 7; |
| 2494 | 2560 |
| 2495 var query = (req.url).query; | 2561 var query = (req.url).query; |
| 2496 var queryOffset = 0; | 2562 var queryOffset = 0; |
| 2497 var queryMap = {}; | 2563 var queryMap = {}; |
| 2498 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2564 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2499 parseBool(n) { | 2565 parseBool(n) { |
| 2500 if (n == "true") return true; | 2566 if (n == "true") return true; |
| 2501 if (n == "false") return false; | 2567 if (n == "false") return false; |
| 2502 if (n == null) return null; | 2568 if (n == null) return null; |
| 2503 throw new core.ArgumentError("Invalid boolean: $n"); | 2569 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2504 } | 2570 } |
| 2571 |
| 2505 if (query.length > 0) { | 2572 if (query.length > 0) { |
| 2506 for (var part in query.split("&")) { | 2573 for (var part in query.split("&")) { |
| 2507 var keyvalue = part.split("="); | 2574 var keyvalue = part.split("="); |
| 2508 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2575 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2576 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2509 } | 2577 } |
| 2510 } | 2578 } |
| 2511 | 2579 |
| 2512 | |
| 2513 var h = { | 2580 var h = { |
| 2514 "content-type" : "application/json; charset=utf-8", | 2581 "content-type": "application/json; charset=utf-8", |
| 2515 }; | 2582 }; |
| 2516 var resp = convert.JSON.encode(buildOperation()); | 2583 var resp = convert.JSON.encode(buildOperation()); |
| 2517 return new async.Future.value(stringResponse(200, h, resp)); | 2584 return new async.Future.value(stringResponse(200, h, resp)); |
| 2518 }), true); | 2585 }), true); |
| 2519 res.master(arg_request, arg_projectId, arg_zone, arg_clusterId).then(unitt
est.expectAsync1(((api.Operation response) { | 2586 res |
| 2587 .master(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2588 .then(unittest.expectAsync1(((api.Operation response) { |
| 2520 checkOperation(response); | 2589 checkOperation(response); |
| 2521 }))); | 2590 }))); |
| 2522 }); | 2591 }); |
| 2523 | 2592 |
| 2524 unittest.test("method--monitoring", () { | 2593 unittest.test("method--monitoring", () { |
| 2525 | |
| 2526 var mock = new HttpServerMock(); | 2594 var mock = new HttpServerMock(); |
| 2527 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2595 api.ProjectsZonesClustersResourceApi res = |
| 2596 new api.ContainerApi(mock).projects.zones.clusters; |
| 2528 var arg_request = buildSetMonitoringServiceRequest(); | 2597 var arg_request = buildSetMonitoringServiceRequest(); |
| 2529 var arg_projectId = "foo"; | 2598 var arg_projectId = "foo"; |
| 2530 var arg_zone = "foo"; | 2599 var arg_zone = "foo"; |
| 2531 var arg_clusterId = "foo"; | 2600 var arg_clusterId = "foo"; |
| 2532 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2601 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2533 var obj = new api.SetMonitoringServiceRequest.fromJson(json); | 2602 var obj = new api.SetMonitoringServiceRequest.fromJson(json); |
| 2534 checkSetMonitoringServiceRequest(obj); | 2603 checkSetMonitoringServiceRequest(obj); |
| 2535 | 2604 |
| 2536 var path = (req.url).path; | 2605 var path = (req.url).path; |
| 2537 var pathOffset = 0; | 2606 var pathOffset = 0; |
| 2538 var index; | 2607 var index; |
| 2539 var subPart; | 2608 var subPart; |
| 2540 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2609 unittest.expect( |
| 2610 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2541 pathOffset += 1; | 2611 pathOffset += 1; |
| 2542 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2612 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2613 unittest.equals("v1/projects/")); |
| 2543 pathOffset += 12; | 2614 pathOffset += 12; |
| 2544 index = path.indexOf("/zones/", pathOffset); | 2615 index = path.indexOf("/zones/", pathOffset); |
| 2545 unittest.expect(index >= 0, unittest.isTrue); | 2616 unittest.expect(index >= 0, unittest.isTrue); |
| 2546 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2617 subPart = |
| 2618 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2547 pathOffset = index; | 2619 pathOffset = index; |
| 2548 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2620 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2549 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2621 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2622 unittest.equals("/zones/")); |
| 2550 pathOffset += 7; | 2623 pathOffset += 7; |
| 2551 index = path.indexOf("/clusters/", pathOffset); | 2624 index = path.indexOf("/clusters/", pathOffset); |
| 2552 unittest.expect(index >= 0, unittest.isTrue); | 2625 unittest.expect(index >= 0, unittest.isTrue); |
| 2553 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2626 subPart = |
| 2627 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2554 pathOffset = index; | 2628 pathOffset = index; |
| 2555 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2629 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2556 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2630 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2631 unittest.equals("/clusters/")); |
| 2557 pathOffset += 10; | 2632 pathOffset += 10; |
| 2558 index = path.indexOf("/monitoring", pathOffset); | 2633 index = path.indexOf("/monitoring", pathOffset); |
| 2559 unittest.expect(index >= 0, unittest.isTrue); | 2634 unittest.expect(index >= 0, unittest.isTrue); |
| 2560 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2635 subPart = |
| 2636 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2561 pathOffset = index; | 2637 pathOffset = index; |
| 2562 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2638 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2563 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/monitoring")); | 2639 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2640 unittest.equals("/monitoring")); |
| 2564 pathOffset += 11; | 2641 pathOffset += 11; |
| 2565 | 2642 |
| 2566 var query = (req.url).query; | 2643 var query = (req.url).query; |
| 2567 var queryOffset = 0; | 2644 var queryOffset = 0; |
| 2568 var queryMap = {}; | 2645 var queryMap = {}; |
| 2569 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2646 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2570 parseBool(n) { | 2647 parseBool(n) { |
| 2571 if (n == "true") return true; | 2648 if (n == "true") return true; |
| 2572 if (n == "false") return false; | 2649 if (n == "false") return false; |
| 2573 if (n == null) return null; | 2650 if (n == null) return null; |
| 2574 throw new core.ArgumentError("Invalid boolean: $n"); | 2651 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2575 } | 2652 } |
| 2653 |
| 2576 if (query.length > 0) { | 2654 if (query.length > 0) { |
| 2577 for (var part in query.split("&")) { | 2655 for (var part in query.split("&")) { |
| 2578 var keyvalue = part.split("="); | 2656 var keyvalue = part.split("="); |
| 2579 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2657 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2658 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2580 } | 2659 } |
| 2581 } | 2660 } |
| 2582 | 2661 |
| 2583 | |
| 2584 var h = { | 2662 var h = { |
| 2585 "content-type" : "application/json; charset=utf-8", | 2663 "content-type": "application/json; charset=utf-8", |
| 2586 }; | 2664 }; |
| 2587 var resp = convert.JSON.encode(buildOperation()); | 2665 var resp = convert.JSON.encode(buildOperation()); |
| 2588 return new async.Future.value(stringResponse(200, h, resp)); | 2666 return new async.Future.value(stringResponse(200, h, resp)); |
| 2589 }), true); | 2667 }), true); |
| 2590 res.monitoring(arg_request, arg_projectId, arg_zone, arg_clusterId).then(u
nittest.expectAsync1(((api.Operation response) { | 2668 res |
| 2669 .monitoring(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2670 .then(unittest.expectAsync1(((api.Operation response) { |
| 2591 checkOperation(response); | 2671 checkOperation(response); |
| 2592 }))); | 2672 }))); |
| 2593 }); | 2673 }); |
| 2594 | 2674 |
| 2595 unittest.test("method--resourceLabels", () { | 2675 unittest.test("method--resourceLabels", () { |
| 2596 | |
| 2597 var mock = new HttpServerMock(); | 2676 var mock = new HttpServerMock(); |
| 2598 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2677 api.ProjectsZonesClustersResourceApi res = |
| 2678 new api.ContainerApi(mock).projects.zones.clusters; |
| 2599 var arg_request = buildSetLabelsRequest(); | 2679 var arg_request = buildSetLabelsRequest(); |
| 2600 var arg_projectId = "foo"; | 2680 var arg_projectId = "foo"; |
| 2601 var arg_zone = "foo"; | 2681 var arg_zone = "foo"; |
| 2602 var arg_clusterId = "foo"; | 2682 var arg_clusterId = "foo"; |
| 2603 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2683 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2604 var obj = new api.SetLabelsRequest.fromJson(json); | 2684 var obj = new api.SetLabelsRequest.fromJson(json); |
| 2605 checkSetLabelsRequest(obj); | 2685 checkSetLabelsRequest(obj); |
| 2606 | 2686 |
| 2607 var path = (req.url).path; | 2687 var path = (req.url).path; |
| 2608 var pathOffset = 0; | 2688 var pathOffset = 0; |
| 2609 var index; | 2689 var index; |
| 2610 var subPart; | 2690 var subPart; |
| 2611 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2691 unittest.expect( |
| 2692 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2612 pathOffset += 1; | 2693 pathOffset += 1; |
| 2613 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2694 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2695 unittest.equals("v1/projects/")); |
| 2614 pathOffset += 12; | 2696 pathOffset += 12; |
| 2615 index = path.indexOf("/zones/", pathOffset); | 2697 index = path.indexOf("/zones/", pathOffset); |
| 2616 unittest.expect(index >= 0, unittest.isTrue); | 2698 unittest.expect(index >= 0, unittest.isTrue); |
| 2617 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2699 subPart = |
| 2700 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2618 pathOffset = index; | 2701 pathOffset = index; |
| 2619 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2702 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2620 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2703 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2704 unittest.equals("/zones/")); |
| 2621 pathOffset += 7; | 2705 pathOffset += 7; |
| 2622 index = path.indexOf("/clusters/", pathOffset); | 2706 index = path.indexOf("/clusters/", pathOffset); |
| 2623 unittest.expect(index >= 0, unittest.isTrue); | 2707 unittest.expect(index >= 0, unittest.isTrue); |
| 2624 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2708 subPart = |
| 2709 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2625 pathOffset = index; | 2710 pathOffset = index; |
| 2626 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2711 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2627 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2712 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2713 unittest.equals("/clusters/")); |
| 2628 pathOffset += 10; | 2714 pathOffset += 10; |
| 2629 index = path.indexOf("/resourceLabels", pathOffset); | 2715 index = path.indexOf("/resourceLabels", pathOffset); |
| 2630 unittest.expect(index >= 0, unittest.isTrue); | 2716 unittest.expect(index >= 0, unittest.isTrue); |
| 2631 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2717 subPart = |
| 2718 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2632 pathOffset = index; | 2719 pathOffset = index; |
| 2633 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2720 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2634 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/resourceLabels")); | 2721 unittest.expect(path.substring(pathOffset, pathOffset + 15), |
| 2722 unittest.equals("/resourceLabels")); |
| 2635 pathOffset += 15; | 2723 pathOffset += 15; |
| 2636 | 2724 |
| 2637 var query = (req.url).query; | 2725 var query = (req.url).query; |
| 2638 var queryOffset = 0; | 2726 var queryOffset = 0; |
| 2639 var queryMap = {}; | 2727 var queryMap = {}; |
| 2640 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2728 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2641 parseBool(n) { | 2729 parseBool(n) { |
| 2642 if (n == "true") return true; | 2730 if (n == "true") return true; |
| 2643 if (n == "false") return false; | 2731 if (n == "false") return false; |
| 2644 if (n == null) return null; | 2732 if (n == null) return null; |
| 2645 throw new core.ArgumentError("Invalid boolean: $n"); | 2733 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2646 } | 2734 } |
| 2735 |
| 2647 if (query.length > 0) { | 2736 if (query.length > 0) { |
| 2648 for (var part in query.split("&")) { | 2737 for (var part in query.split("&")) { |
| 2649 var keyvalue = part.split("="); | 2738 var keyvalue = part.split("="); |
| 2650 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2739 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2740 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2651 } | 2741 } |
| 2652 } | 2742 } |
| 2653 | 2743 |
| 2654 | |
| 2655 var h = { | 2744 var h = { |
| 2656 "content-type" : "application/json; charset=utf-8", | 2745 "content-type": "application/json; charset=utf-8", |
| 2657 }; | 2746 }; |
| 2658 var resp = convert.JSON.encode(buildOperation()); | 2747 var resp = convert.JSON.encode(buildOperation()); |
| 2659 return new async.Future.value(stringResponse(200, h, resp)); | 2748 return new async.Future.value(stringResponse(200, h, resp)); |
| 2660 }), true); | 2749 }), true); |
| 2661 res.resourceLabels(arg_request, arg_projectId, arg_zone, arg_clusterId).th
en(unittest.expectAsync1(((api.Operation response) { | 2750 res |
| 2751 .resourceLabels(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2752 .then(unittest.expectAsync1(((api.Operation response) { |
| 2662 checkOperation(response); | 2753 checkOperation(response); |
| 2663 }))); | 2754 }))); |
| 2664 }); | 2755 }); |
| 2665 | 2756 |
| 2666 unittest.test("method--setMasterAuth", () { | 2757 unittest.test("method--setMasterAuth", () { |
| 2667 | |
| 2668 var mock = new HttpServerMock(); | 2758 var mock = new HttpServerMock(); |
| 2669 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2759 api.ProjectsZonesClustersResourceApi res = |
| 2760 new api.ContainerApi(mock).projects.zones.clusters; |
| 2670 var arg_request = buildSetMasterAuthRequest(); | 2761 var arg_request = buildSetMasterAuthRequest(); |
| 2671 var arg_projectId = "foo"; | 2762 var arg_projectId = "foo"; |
| 2672 var arg_zone = "foo"; | 2763 var arg_zone = "foo"; |
| 2673 var arg_clusterId = "foo"; | 2764 var arg_clusterId = "foo"; |
| 2674 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2765 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2675 var obj = new api.SetMasterAuthRequest.fromJson(json); | 2766 var obj = new api.SetMasterAuthRequest.fromJson(json); |
| 2676 checkSetMasterAuthRequest(obj); | 2767 checkSetMasterAuthRequest(obj); |
| 2677 | 2768 |
| 2678 var path = (req.url).path; | 2769 var path = (req.url).path; |
| 2679 var pathOffset = 0; | 2770 var pathOffset = 0; |
| 2680 var index; | 2771 var index; |
| 2681 var subPart; | 2772 var subPart; |
| 2682 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2773 unittest.expect( |
| 2774 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2683 pathOffset += 1; | 2775 pathOffset += 1; |
| 2684 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2776 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2777 unittest.equals("v1/projects/")); |
| 2685 pathOffset += 12; | 2778 pathOffset += 12; |
| 2686 index = path.indexOf("/zones/", pathOffset); | 2779 index = path.indexOf("/zones/", pathOffset); |
| 2687 unittest.expect(index >= 0, unittest.isTrue); | 2780 unittest.expect(index >= 0, unittest.isTrue); |
| 2688 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2781 subPart = |
| 2782 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2689 pathOffset = index; | 2783 pathOffset = index; |
| 2690 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2784 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2691 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2785 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2786 unittest.equals("/zones/")); |
| 2692 pathOffset += 7; | 2787 pathOffset += 7; |
| 2693 index = path.indexOf("/clusters/", pathOffset); | 2788 index = path.indexOf("/clusters/", pathOffset); |
| 2694 unittest.expect(index >= 0, unittest.isTrue); | 2789 unittest.expect(index >= 0, unittest.isTrue); |
| 2695 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2790 subPart = |
| 2791 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2696 pathOffset = index; | 2792 pathOffset = index; |
| 2697 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2793 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2698 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2794 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2795 unittest.equals("/clusters/")); |
| 2699 pathOffset += 10; | 2796 pathOffset += 10; |
| 2700 index = path.indexOf(":setMasterAuth", pathOffset); | 2797 index = path.indexOf(":setMasterAuth", pathOffset); |
| 2701 unittest.expect(index >= 0, unittest.isTrue); | 2798 unittest.expect(index >= 0, unittest.isTrue); |
| 2702 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2799 subPart = |
| 2800 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2703 pathOffset = index; | 2801 pathOffset = index; |
| 2704 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2802 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2705 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals(":setMasterAuth")); | 2803 unittest.expect(path.substring(pathOffset, pathOffset + 14), |
| 2804 unittest.equals(":setMasterAuth")); |
| 2706 pathOffset += 14; | 2805 pathOffset += 14; |
| 2707 | 2806 |
| 2708 var query = (req.url).query; | 2807 var query = (req.url).query; |
| 2709 var queryOffset = 0; | 2808 var queryOffset = 0; |
| 2710 var queryMap = {}; | 2809 var queryMap = {}; |
| 2711 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2810 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2712 parseBool(n) { | 2811 parseBool(n) { |
| 2713 if (n == "true") return true; | 2812 if (n == "true") return true; |
| 2714 if (n == "false") return false; | 2813 if (n == "false") return false; |
| 2715 if (n == null) return null; | 2814 if (n == null) return null; |
| 2716 throw new core.ArgumentError("Invalid boolean: $n"); | 2815 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2717 } | 2816 } |
| 2817 |
| 2718 if (query.length > 0) { | 2818 if (query.length > 0) { |
| 2719 for (var part in query.split("&")) { | 2819 for (var part in query.split("&")) { |
| 2720 var keyvalue = part.split("="); | 2820 var keyvalue = part.split("="); |
| 2721 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2821 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2822 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2722 } | 2823 } |
| 2723 } | 2824 } |
| 2724 | 2825 |
| 2725 | |
| 2726 var h = { | 2826 var h = { |
| 2727 "content-type" : "application/json; charset=utf-8", | 2827 "content-type": "application/json; charset=utf-8", |
| 2728 }; | 2828 }; |
| 2729 var resp = convert.JSON.encode(buildOperation()); | 2829 var resp = convert.JSON.encode(buildOperation()); |
| 2730 return new async.Future.value(stringResponse(200, h, resp)); | 2830 return new async.Future.value(stringResponse(200, h, resp)); |
| 2731 }), true); | 2831 }), true); |
| 2732 res.setMasterAuth(arg_request, arg_projectId, arg_zone, arg_clusterId).the
n(unittest.expectAsync1(((api.Operation response) { | 2832 res |
| 2833 .setMasterAuth(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2834 .then(unittest.expectAsync1(((api.Operation response) { |
| 2733 checkOperation(response); | 2835 checkOperation(response); |
| 2734 }))); | 2836 }))); |
| 2735 }); | 2837 }); |
| 2736 | 2838 |
| 2737 unittest.test("method--setNetworkPolicy", () { | 2839 unittest.test("method--setNetworkPolicy", () { |
| 2738 | |
| 2739 var mock = new HttpServerMock(); | 2840 var mock = new HttpServerMock(); |
| 2740 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2841 api.ProjectsZonesClustersResourceApi res = |
| 2842 new api.ContainerApi(mock).projects.zones.clusters; |
| 2741 var arg_request = buildSetNetworkPolicyRequest(); | 2843 var arg_request = buildSetNetworkPolicyRequest(); |
| 2742 var arg_projectId = "foo"; | 2844 var arg_projectId = "foo"; |
| 2743 var arg_zone = "foo"; | 2845 var arg_zone = "foo"; |
| 2744 var arg_clusterId = "foo"; | 2846 var arg_clusterId = "foo"; |
| 2745 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2847 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2746 var obj = new api.SetNetworkPolicyRequest.fromJson(json); | 2848 var obj = new api.SetNetworkPolicyRequest.fromJson(json); |
| 2747 checkSetNetworkPolicyRequest(obj); | 2849 checkSetNetworkPolicyRequest(obj); |
| 2748 | 2850 |
| 2749 var path = (req.url).path; | 2851 var path = (req.url).path; |
| 2750 var pathOffset = 0; | 2852 var pathOffset = 0; |
| 2751 var index; | 2853 var index; |
| 2752 var subPart; | 2854 var subPart; |
| 2753 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2855 unittest.expect( |
| 2856 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2754 pathOffset += 1; | 2857 pathOffset += 1; |
| 2755 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2858 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2859 unittest.equals("v1/projects/")); |
| 2756 pathOffset += 12; | 2860 pathOffset += 12; |
| 2757 index = path.indexOf("/zones/", pathOffset); | 2861 index = path.indexOf("/zones/", pathOffset); |
| 2758 unittest.expect(index >= 0, unittest.isTrue); | 2862 unittest.expect(index >= 0, unittest.isTrue); |
| 2759 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2863 subPart = |
| 2864 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2760 pathOffset = index; | 2865 pathOffset = index; |
| 2761 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2866 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2762 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2867 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2868 unittest.equals("/zones/")); |
| 2763 pathOffset += 7; | 2869 pathOffset += 7; |
| 2764 index = path.indexOf("/clusters/", pathOffset); | 2870 index = path.indexOf("/clusters/", pathOffset); |
| 2765 unittest.expect(index >= 0, unittest.isTrue); | 2871 unittest.expect(index >= 0, unittest.isTrue); |
| 2766 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2872 subPart = |
| 2873 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2767 pathOffset = index; | 2874 pathOffset = index; |
| 2768 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2875 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2769 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2876 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2877 unittest.equals("/clusters/")); |
| 2770 pathOffset += 10; | 2878 pathOffset += 10; |
| 2771 index = path.indexOf(":setNetworkPolicy", pathOffset); | 2879 index = path.indexOf(":setNetworkPolicy", pathOffset); |
| 2772 unittest.expect(index >= 0, unittest.isTrue); | 2880 unittest.expect(index >= 0, unittest.isTrue); |
| 2773 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2881 subPart = |
| 2882 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2774 pathOffset = index; | 2883 pathOffset = index; |
| 2775 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2884 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2776 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals(":setNetworkPolicy")); | 2885 unittest.expect(path.substring(pathOffset, pathOffset + 17), |
| 2886 unittest.equals(":setNetworkPolicy")); |
| 2777 pathOffset += 17; | 2887 pathOffset += 17; |
| 2778 | 2888 |
| 2779 var query = (req.url).query; | 2889 var query = (req.url).query; |
| 2780 var queryOffset = 0; | 2890 var queryOffset = 0; |
| 2781 var queryMap = {}; | 2891 var queryMap = {}; |
| 2782 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2892 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2783 parseBool(n) { | 2893 parseBool(n) { |
| 2784 if (n == "true") return true; | 2894 if (n == "true") return true; |
| 2785 if (n == "false") return false; | 2895 if (n == "false") return false; |
| 2786 if (n == null) return null; | 2896 if (n == null) return null; |
| 2787 throw new core.ArgumentError("Invalid boolean: $n"); | 2897 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2788 } | 2898 } |
| 2899 |
| 2789 if (query.length > 0) { | 2900 if (query.length > 0) { |
| 2790 for (var part in query.split("&")) { | 2901 for (var part in query.split("&")) { |
| 2791 var keyvalue = part.split("="); | 2902 var keyvalue = part.split("="); |
| 2792 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2903 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2904 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2793 } | 2905 } |
| 2794 } | 2906 } |
| 2795 | 2907 |
| 2796 | |
| 2797 var h = { | 2908 var h = { |
| 2798 "content-type" : "application/json; charset=utf-8", | 2909 "content-type": "application/json; charset=utf-8", |
| 2799 }; | 2910 }; |
| 2800 var resp = convert.JSON.encode(buildOperation()); | 2911 var resp = convert.JSON.encode(buildOperation()); |
| 2801 return new async.Future.value(stringResponse(200, h, resp)); | 2912 return new async.Future.value(stringResponse(200, h, resp)); |
| 2802 }), true); | 2913 }), true); |
| 2803 res.setNetworkPolicy(arg_request, arg_projectId, arg_zone, arg_clusterId).
then(unittest.expectAsync1(((api.Operation response) { | 2914 res |
| 2915 .setNetworkPolicy(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2916 .then(unittest.expectAsync1(((api.Operation response) { |
| 2804 checkOperation(response); | 2917 checkOperation(response); |
| 2805 }))); | 2918 }))); |
| 2806 }); | 2919 }); |
| 2807 | 2920 |
| 2808 unittest.test("method--startIpRotation", () { | 2921 unittest.test("method--startIpRotation", () { |
| 2809 | |
| 2810 var mock = new HttpServerMock(); | 2922 var mock = new HttpServerMock(); |
| 2811 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 2923 api.ProjectsZonesClustersResourceApi res = |
| 2924 new api.ContainerApi(mock).projects.zones.clusters; |
| 2812 var arg_request = buildStartIPRotationRequest(); | 2925 var arg_request = buildStartIPRotationRequest(); |
| 2813 var arg_projectId = "foo"; | 2926 var arg_projectId = "foo"; |
| 2814 var arg_zone = "foo"; | 2927 var arg_zone = "foo"; |
| 2815 var arg_clusterId = "foo"; | 2928 var arg_clusterId = "foo"; |
| 2816 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2929 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2817 var obj = new api.StartIPRotationRequest.fromJson(json); | 2930 var obj = new api.StartIPRotationRequest.fromJson(json); |
| 2818 checkStartIPRotationRequest(obj); | 2931 checkStartIPRotationRequest(obj); |
| 2819 | 2932 |
| 2820 var path = (req.url).path; | 2933 var path = (req.url).path; |
| 2821 var pathOffset = 0; | 2934 var pathOffset = 0; |
| 2822 var index; | 2935 var index; |
| 2823 var subPart; | 2936 var subPart; |
| 2824 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2937 unittest.expect( |
| 2938 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2825 pathOffset += 1; | 2939 pathOffset += 1; |
| 2826 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2940 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2941 unittest.equals("v1/projects/")); |
| 2827 pathOffset += 12; | 2942 pathOffset += 12; |
| 2828 index = path.indexOf("/zones/", pathOffset); | 2943 index = path.indexOf("/zones/", pathOffset); |
| 2829 unittest.expect(index >= 0, unittest.isTrue); | 2944 unittest.expect(index >= 0, unittest.isTrue); |
| 2830 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2945 subPart = |
| 2946 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2831 pathOffset = index; | 2947 pathOffset = index; |
| 2832 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2948 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2833 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 2949 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2950 unittest.equals("/zones/")); |
| 2834 pathOffset += 7; | 2951 pathOffset += 7; |
| 2835 index = path.indexOf("/clusters/", pathOffset); | 2952 index = path.indexOf("/clusters/", pathOffset); |
| 2836 unittest.expect(index >= 0, unittest.isTrue); | 2953 unittest.expect(index >= 0, unittest.isTrue); |
| 2837 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2954 subPart = |
| 2955 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2838 pathOffset = index; | 2956 pathOffset = index; |
| 2839 unittest.expect(subPart, unittest.equals("$arg_zone")); | 2957 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2840 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 2958 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2959 unittest.equals("/clusters/")); |
| 2841 pathOffset += 10; | 2960 pathOffset += 10; |
| 2842 index = path.indexOf(":startIpRotation", pathOffset); | 2961 index = path.indexOf(":startIpRotation", pathOffset); |
| 2843 unittest.expect(index >= 0, unittest.isTrue); | 2962 unittest.expect(index >= 0, unittest.isTrue); |
| 2844 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2963 subPart = |
| 2964 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2845 pathOffset = index; | 2965 pathOffset = index; |
| 2846 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 2966 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2847 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals(":startIpRotation")); | 2967 unittest.expect(path.substring(pathOffset, pathOffset + 16), |
| 2968 unittest.equals(":startIpRotation")); |
| 2848 pathOffset += 16; | 2969 pathOffset += 16; |
| 2849 | 2970 |
| 2850 var query = (req.url).query; | 2971 var query = (req.url).query; |
| 2851 var queryOffset = 0; | 2972 var queryOffset = 0; |
| 2852 var queryMap = {}; | 2973 var queryMap = {}; |
| 2853 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2974 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2854 parseBool(n) { | 2975 parseBool(n) { |
| 2855 if (n == "true") return true; | 2976 if (n == "true") return true; |
| 2856 if (n == "false") return false; | 2977 if (n == "false") return false; |
| 2857 if (n == null) return null; | 2978 if (n == null) return null; |
| 2858 throw new core.ArgumentError("Invalid boolean: $n"); | 2979 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2859 } | 2980 } |
| 2981 |
| 2860 if (query.length > 0) { | 2982 if (query.length > 0) { |
| 2861 for (var part in query.split("&")) { | 2983 for (var part in query.split("&")) { |
| 2862 var keyvalue = part.split("="); | 2984 var keyvalue = part.split("="); |
| 2863 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2985 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2986 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2864 } | 2987 } |
| 2865 } | 2988 } |
| 2866 | 2989 |
| 2867 | |
| 2868 var h = { | 2990 var h = { |
| 2869 "content-type" : "application/json; charset=utf-8", | 2991 "content-type": "application/json; charset=utf-8", |
| 2870 }; | 2992 }; |
| 2871 var resp = convert.JSON.encode(buildOperation()); | 2993 var resp = convert.JSON.encode(buildOperation()); |
| 2872 return new async.Future.value(stringResponse(200, h, resp)); | 2994 return new async.Future.value(stringResponse(200, h, resp)); |
| 2873 }), true); | 2995 }), true); |
| 2874 res.startIpRotation(arg_request, arg_projectId, arg_zone, arg_clusterId).t
hen(unittest.expectAsync1(((api.Operation response) { | 2996 res |
| 2997 .startIpRotation(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 2998 .then(unittest.expectAsync1(((api.Operation response) { |
| 2875 checkOperation(response); | 2999 checkOperation(response); |
| 2876 }))); | 3000 }))); |
| 2877 }); | 3001 }); |
| 2878 | 3002 |
| 2879 unittest.test("method--update", () { | 3003 unittest.test("method--update", () { |
| 2880 | |
| 2881 var mock = new HttpServerMock(); | 3004 var mock = new HttpServerMock(); |
| 2882 api.ProjectsZonesClustersResourceApi res = new api.ContainerApi(mock).proj
ects.zones.clusters; | 3005 api.ProjectsZonesClustersResourceApi res = |
| 3006 new api.ContainerApi(mock).projects.zones.clusters; |
| 2883 var arg_request = buildUpdateClusterRequest(); | 3007 var arg_request = buildUpdateClusterRequest(); |
| 2884 var arg_projectId = "foo"; | 3008 var arg_projectId = "foo"; |
| 2885 var arg_zone = "foo"; | 3009 var arg_zone = "foo"; |
| 2886 var arg_clusterId = "foo"; | 3010 var arg_clusterId = "foo"; |
| 2887 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3011 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2888 var obj = new api.UpdateClusterRequest.fromJson(json); | 3012 var obj = new api.UpdateClusterRequest.fromJson(json); |
| 2889 checkUpdateClusterRequest(obj); | 3013 checkUpdateClusterRequest(obj); |
| 2890 | 3014 |
| 2891 var path = (req.url).path; | 3015 var path = (req.url).path; |
| 2892 var pathOffset = 0; | 3016 var pathOffset = 0; |
| 2893 var index; | 3017 var index; |
| 2894 var subPart; | 3018 var subPart; |
| 2895 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3019 unittest.expect( |
| 3020 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2896 pathOffset += 1; | 3021 pathOffset += 1; |
| 2897 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3022 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3023 unittest.equals("v1/projects/")); |
| 2898 pathOffset += 12; | 3024 pathOffset += 12; |
| 2899 index = path.indexOf("/zones/", pathOffset); | 3025 index = path.indexOf("/zones/", pathOffset); |
| 2900 unittest.expect(index >= 0, unittest.isTrue); | 3026 unittest.expect(index >= 0, unittest.isTrue); |
| 2901 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3027 subPart = |
| 3028 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2902 pathOffset = index; | 3029 pathOffset = index; |
| 2903 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3030 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2904 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3031 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3032 unittest.equals("/zones/")); |
| 2905 pathOffset += 7; | 3033 pathOffset += 7; |
| 2906 index = path.indexOf("/clusters/", pathOffset); | 3034 index = path.indexOf("/clusters/", pathOffset); |
| 2907 unittest.expect(index >= 0, unittest.isTrue); | 3035 unittest.expect(index >= 0, unittest.isTrue); |
| 2908 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3036 subPart = |
| 3037 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2909 pathOffset = index; | 3038 pathOffset = index; |
| 2910 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3039 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2911 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3040 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3041 unittest.equals("/clusters/")); |
| 2912 pathOffset += 10; | 3042 pathOffset += 10; |
| 2913 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3043 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2914 pathOffset = path.length; | 3044 pathOffset = path.length; |
| 2915 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3045 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2916 | 3046 |
| 2917 var query = (req.url).query; | 3047 var query = (req.url).query; |
| 2918 var queryOffset = 0; | 3048 var queryOffset = 0; |
| 2919 var queryMap = {}; | 3049 var queryMap = {}; |
| 2920 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3050 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2921 parseBool(n) { | 3051 parseBool(n) { |
| 2922 if (n == "true") return true; | 3052 if (n == "true") return true; |
| 2923 if (n == "false") return false; | 3053 if (n == "false") return false; |
| 2924 if (n == null) return null; | 3054 if (n == null) return null; |
| 2925 throw new core.ArgumentError("Invalid boolean: $n"); | 3055 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2926 } | 3056 } |
| 3057 |
| 2927 if (query.length > 0) { | 3058 if (query.length > 0) { |
| 2928 for (var part in query.split("&")) { | 3059 for (var part in query.split("&")) { |
| 2929 var keyvalue = part.split("="); | 3060 var keyvalue = part.split("="); |
| 2930 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3061 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3062 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2931 } | 3063 } |
| 2932 } | 3064 } |
| 2933 | 3065 |
| 2934 | |
| 2935 var h = { | 3066 var h = { |
| 2936 "content-type" : "application/json; charset=utf-8", | 3067 "content-type": "application/json; charset=utf-8", |
| 2937 }; | 3068 }; |
| 2938 var resp = convert.JSON.encode(buildOperation()); | 3069 var resp = convert.JSON.encode(buildOperation()); |
| 2939 return new async.Future.value(stringResponse(200, h, resp)); | 3070 return new async.Future.value(stringResponse(200, h, resp)); |
| 2940 }), true); | 3071 }), true); |
| 2941 res.update(arg_request, arg_projectId, arg_zone, arg_clusterId).then(unitt
est.expectAsync1(((api.Operation response) { | 3072 res |
| 3073 .update(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 3074 .then(unittest.expectAsync1(((api.Operation response) { |
| 2942 checkOperation(response); | 3075 checkOperation(response); |
| 2943 }))); | 3076 }))); |
| 2944 }); | 3077 }); |
| 2945 | |
| 2946 }); | 3078 }); |
| 2947 | 3079 |
| 2948 | |
| 2949 unittest.group("resource-ProjectsZonesClustersNodePoolsResourceApi", () { | 3080 unittest.group("resource-ProjectsZonesClustersNodePoolsResourceApi", () { |
| 2950 unittest.test("method--autoscaling", () { | 3081 unittest.test("method--autoscaling", () { |
| 2951 | |
| 2952 var mock = new HttpServerMock(); | 3082 var mock = new HttpServerMock(); |
| 2953 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3083 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3084 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 2954 var arg_request = buildSetNodePoolAutoscalingRequest(); | 3085 var arg_request = buildSetNodePoolAutoscalingRequest(); |
| 2955 var arg_projectId = "foo"; | 3086 var arg_projectId = "foo"; |
| 2956 var arg_zone = "foo"; | 3087 var arg_zone = "foo"; |
| 2957 var arg_clusterId = "foo"; | 3088 var arg_clusterId = "foo"; |
| 2958 var arg_nodePoolId = "foo"; | 3089 var arg_nodePoolId = "foo"; |
| 2959 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3090 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2960 var obj = new api.SetNodePoolAutoscalingRequest.fromJson(json); | 3091 var obj = new api.SetNodePoolAutoscalingRequest.fromJson(json); |
| 2961 checkSetNodePoolAutoscalingRequest(obj); | 3092 checkSetNodePoolAutoscalingRequest(obj); |
| 2962 | 3093 |
| 2963 var path = (req.url).path; | 3094 var path = (req.url).path; |
| 2964 var pathOffset = 0; | 3095 var pathOffset = 0; |
| 2965 var index; | 3096 var index; |
| 2966 var subPart; | 3097 var subPart; |
| 2967 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3098 unittest.expect( |
| 3099 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2968 pathOffset += 1; | 3100 pathOffset += 1; |
| 2969 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3101 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3102 unittest.equals("v1/projects/")); |
| 2970 pathOffset += 12; | 3103 pathOffset += 12; |
| 2971 index = path.indexOf("/zones/", pathOffset); | 3104 index = path.indexOf("/zones/", pathOffset); |
| 2972 unittest.expect(index >= 0, unittest.isTrue); | 3105 unittest.expect(index >= 0, unittest.isTrue); |
| 2973 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3106 subPart = |
| 3107 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2974 pathOffset = index; | 3108 pathOffset = index; |
| 2975 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3109 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2976 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3110 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3111 unittest.equals("/zones/")); |
| 2977 pathOffset += 7; | 3112 pathOffset += 7; |
| 2978 index = path.indexOf("/clusters/", pathOffset); | 3113 index = path.indexOf("/clusters/", pathOffset); |
| 2979 unittest.expect(index >= 0, unittest.isTrue); | 3114 unittest.expect(index >= 0, unittest.isTrue); |
| 2980 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3115 subPart = |
| 3116 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2981 pathOffset = index; | 3117 pathOffset = index; |
| 2982 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3118 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 2983 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3119 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3120 unittest.equals("/clusters/")); |
| 2984 pathOffset += 10; | 3121 pathOffset += 10; |
| 2985 index = path.indexOf("/nodePools/", pathOffset); | 3122 index = path.indexOf("/nodePools/", pathOffset); |
| 2986 unittest.expect(index >= 0, unittest.isTrue); | 3123 unittest.expect(index >= 0, unittest.isTrue); |
| 2987 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3124 subPart = |
| 3125 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2988 pathOffset = index; | 3126 pathOffset = index; |
| 2989 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3127 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 2990 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3128 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3129 unittest.equals("/nodePools/")); |
| 2991 pathOffset += 11; | 3130 pathOffset += 11; |
| 2992 index = path.indexOf("/autoscaling", pathOffset); | 3131 index = path.indexOf("/autoscaling", pathOffset); |
| 2993 unittest.expect(index >= 0, unittest.isTrue); | 3132 unittest.expect(index >= 0, unittest.isTrue); |
| 2994 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3133 subPart = |
| 3134 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2995 pathOffset = index; | 3135 pathOffset = index; |
| 2996 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3136 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 2997 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/autoscaling")); | 3137 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3138 unittest.equals("/autoscaling")); |
| 2998 pathOffset += 12; | 3139 pathOffset += 12; |
| 2999 | 3140 |
| 3000 var query = (req.url).query; | 3141 var query = (req.url).query; |
| 3001 var queryOffset = 0; | 3142 var queryOffset = 0; |
| 3002 var queryMap = {}; | 3143 var queryMap = {}; |
| 3003 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3144 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3004 parseBool(n) { | 3145 parseBool(n) { |
| 3005 if (n == "true") return true; | 3146 if (n == "true") return true; |
| 3006 if (n == "false") return false; | 3147 if (n == "false") return false; |
| 3007 if (n == null) return null; | 3148 if (n == null) return null; |
| 3008 throw new core.ArgumentError("Invalid boolean: $n"); | 3149 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3009 } | 3150 } |
| 3151 |
| 3010 if (query.length > 0) { | 3152 if (query.length > 0) { |
| 3011 for (var part in query.split("&")) { | 3153 for (var part in query.split("&")) { |
| 3012 var keyvalue = part.split("="); | 3154 var keyvalue = part.split("="); |
| 3013 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3155 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3156 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3014 } | 3157 } |
| 3015 } | 3158 } |
| 3016 | 3159 |
| 3017 | |
| 3018 var h = { | 3160 var h = { |
| 3019 "content-type" : "application/json; charset=utf-8", | 3161 "content-type": "application/json; charset=utf-8", |
| 3020 }; | 3162 }; |
| 3021 var resp = convert.JSON.encode(buildOperation()); | 3163 var resp = convert.JSON.encode(buildOperation()); |
| 3022 return new async.Future.value(stringResponse(200, h, resp)); | 3164 return new async.Future.value(stringResponse(200, h, resp)); |
| 3023 }), true); | 3165 }), true); |
| 3024 res.autoscaling(arg_request, arg_projectId, arg_zone, arg_clusterId, arg_n
odePoolId).then(unittest.expectAsync1(((api.Operation response) { | 3166 res |
| 3167 .autoscaling(arg_request, arg_projectId, arg_zone, arg_clusterId, |
| 3168 arg_nodePoolId) |
| 3169 .then(unittest.expectAsync1(((api.Operation response) { |
| 3025 checkOperation(response); | 3170 checkOperation(response); |
| 3026 }))); | 3171 }))); |
| 3027 }); | 3172 }); |
| 3028 | 3173 |
| 3029 unittest.test("method--create", () { | 3174 unittest.test("method--create", () { |
| 3030 | |
| 3031 var mock = new HttpServerMock(); | 3175 var mock = new HttpServerMock(); |
| 3032 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3176 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3177 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3033 var arg_request = buildCreateNodePoolRequest(); | 3178 var arg_request = buildCreateNodePoolRequest(); |
| 3034 var arg_projectId = "foo"; | 3179 var arg_projectId = "foo"; |
| 3035 var arg_zone = "foo"; | 3180 var arg_zone = "foo"; |
| 3036 var arg_clusterId = "foo"; | 3181 var arg_clusterId = "foo"; |
| 3037 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3182 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3038 var obj = new api.CreateNodePoolRequest.fromJson(json); | 3183 var obj = new api.CreateNodePoolRequest.fromJson(json); |
| 3039 checkCreateNodePoolRequest(obj); | 3184 checkCreateNodePoolRequest(obj); |
| 3040 | 3185 |
| 3041 var path = (req.url).path; | 3186 var path = (req.url).path; |
| 3042 var pathOffset = 0; | 3187 var pathOffset = 0; |
| 3043 var index; | 3188 var index; |
| 3044 var subPart; | 3189 var subPart; |
| 3045 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3190 unittest.expect( |
| 3191 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3046 pathOffset += 1; | 3192 pathOffset += 1; |
| 3047 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3193 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3194 unittest.equals("v1/projects/")); |
| 3048 pathOffset += 12; | 3195 pathOffset += 12; |
| 3049 index = path.indexOf("/zones/", pathOffset); | 3196 index = path.indexOf("/zones/", pathOffset); |
| 3050 unittest.expect(index >= 0, unittest.isTrue); | 3197 unittest.expect(index >= 0, unittest.isTrue); |
| 3051 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3198 subPart = |
| 3199 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3052 pathOffset = index; | 3200 pathOffset = index; |
| 3053 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3201 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3054 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3202 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3203 unittest.equals("/zones/")); |
| 3055 pathOffset += 7; | 3204 pathOffset += 7; |
| 3056 index = path.indexOf("/clusters/", pathOffset); | 3205 index = path.indexOf("/clusters/", pathOffset); |
| 3057 unittest.expect(index >= 0, unittest.isTrue); | 3206 unittest.expect(index >= 0, unittest.isTrue); |
| 3058 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3207 subPart = |
| 3208 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3059 pathOffset = index; | 3209 pathOffset = index; |
| 3060 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3210 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3061 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3211 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3212 unittest.equals("/clusters/")); |
| 3062 pathOffset += 10; | 3213 pathOffset += 10; |
| 3063 index = path.indexOf("/nodePools", pathOffset); | 3214 index = path.indexOf("/nodePools", pathOffset); |
| 3064 unittest.expect(index >= 0, unittest.isTrue); | 3215 unittest.expect(index >= 0, unittest.isTrue); |
| 3065 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3216 subPart = |
| 3217 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3066 pathOffset = index; | 3218 pathOffset = index; |
| 3067 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3219 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3068 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/nodePools")); | 3220 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3221 unittest.equals("/nodePools")); |
| 3069 pathOffset += 10; | 3222 pathOffset += 10; |
| 3070 | 3223 |
| 3071 var query = (req.url).query; | 3224 var query = (req.url).query; |
| 3072 var queryOffset = 0; | 3225 var queryOffset = 0; |
| 3073 var queryMap = {}; | 3226 var queryMap = {}; |
| 3074 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3227 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3075 parseBool(n) { | 3228 parseBool(n) { |
| 3076 if (n == "true") return true; | 3229 if (n == "true") return true; |
| 3077 if (n == "false") return false; | 3230 if (n == "false") return false; |
| 3078 if (n == null) return null; | 3231 if (n == null) return null; |
| 3079 throw new core.ArgumentError("Invalid boolean: $n"); | 3232 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3080 } | 3233 } |
| 3234 |
| 3081 if (query.length > 0) { | 3235 if (query.length > 0) { |
| 3082 for (var part in query.split("&")) { | 3236 for (var part in query.split("&")) { |
| 3083 var keyvalue = part.split("="); | 3237 var keyvalue = part.split("="); |
| 3084 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3238 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3239 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3085 } | 3240 } |
| 3086 } | 3241 } |
| 3087 | 3242 |
| 3088 | |
| 3089 var h = { | 3243 var h = { |
| 3090 "content-type" : "application/json; charset=utf-8", | 3244 "content-type": "application/json; charset=utf-8", |
| 3091 }; | 3245 }; |
| 3092 var resp = convert.JSON.encode(buildOperation()); | 3246 var resp = convert.JSON.encode(buildOperation()); |
| 3093 return new async.Future.value(stringResponse(200, h, resp)); | 3247 return new async.Future.value(stringResponse(200, h, resp)); |
| 3094 }), true); | 3248 }), true); |
| 3095 res.create(arg_request, arg_projectId, arg_zone, arg_clusterId).then(unitt
est.expectAsync1(((api.Operation response) { | 3249 res |
| 3250 .create(arg_request, arg_projectId, arg_zone, arg_clusterId) |
| 3251 .then(unittest.expectAsync1(((api.Operation response) { |
| 3096 checkOperation(response); | 3252 checkOperation(response); |
| 3097 }))); | 3253 }))); |
| 3098 }); | 3254 }); |
| 3099 | 3255 |
| 3100 unittest.test("method--delete", () { | 3256 unittest.test("method--delete", () { |
| 3101 | |
| 3102 var mock = new HttpServerMock(); | 3257 var mock = new HttpServerMock(); |
| 3103 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3258 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3259 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3104 var arg_projectId = "foo"; | 3260 var arg_projectId = "foo"; |
| 3105 var arg_zone = "foo"; | 3261 var arg_zone = "foo"; |
| 3106 var arg_clusterId = "foo"; | 3262 var arg_clusterId = "foo"; |
| 3107 var arg_nodePoolId = "foo"; | 3263 var arg_nodePoolId = "foo"; |
| 3108 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3264 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3109 var path = (req.url).path; | 3265 var path = (req.url).path; |
| 3110 var pathOffset = 0; | 3266 var pathOffset = 0; |
| 3111 var index; | 3267 var index; |
| 3112 var subPart; | 3268 var subPart; |
| 3113 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3269 unittest.expect( |
| 3270 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3114 pathOffset += 1; | 3271 pathOffset += 1; |
| 3115 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3272 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3273 unittest.equals("v1/projects/")); |
| 3116 pathOffset += 12; | 3274 pathOffset += 12; |
| 3117 index = path.indexOf("/zones/", pathOffset); | 3275 index = path.indexOf("/zones/", pathOffset); |
| 3118 unittest.expect(index >= 0, unittest.isTrue); | 3276 unittest.expect(index >= 0, unittest.isTrue); |
| 3119 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3277 subPart = |
| 3278 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3120 pathOffset = index; | 3279 pathOffset = index; |
| 3121 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3280 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3122 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3281 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3282 unittest.equals("/zones/")); |
| 3123 pathOffset += 7; | 3283 pathOffset += 7; |
| 3124 index = path.indexOf("/clusters/", pathOffset); | 3284 index = path.indexOf("/clusters/", pathOffset); |
| 3125 unittest.expect(index >= 0, unittest.isTrue); | 3285 unittest.expect(index >= 0, unittest.isTrue); |
| 3126 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3286 subPart = |
| 3287 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3127 pathOffset = index; | 3288 pathOffset = index; |
| 3128 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3289 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3129 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3290 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3291 unittest.equals("/clusters/")); |
| 3130 pathOffset += 10; | 3292 pathOffset += 10; |
| 3131 index = path.indexOf("/nodePools/", pathOffset); | 3293 index = path.indexOf("/nodePools/", pathOffset); |
| 3132 unittest.expect(index >= 0, unittest.isTrue); | 3294 unittest.expect(index >= 0, unittest.isTrue); |
| 3133 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3295 subPart = |
| 3296 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3134 pathOffset = index; | 3297 pathOffset = index; |
| 3135 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3298 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3136 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3299 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3300 unittest.equals("/nodePools/")); |
| 3137 pathOffset += 11; | 3301 pathOffset += 11; |
| 3138 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3302 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3139 pathOffset = path.length; | 3303 pathOffset = path.length; |
| 3140 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3304 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 3141 | 3305 |
| 3142 var query = (req.url).query; | 3306 var query = (req.url).query; |
| 3143 var queryOffset = 0; | 3307 var queryOffset = 0; |
| 3144 var queryMap = {}; | 3308 var queryMap = {}; |
| 3145 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3309 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3146 parseBool(n) { | 3310 parseBool(n) { |
| 3147 if (n == "true") return true; | 3311 if (n == "true") return true; |
| 3148 if (n == "false") return false; | 3312 if (n == "false") return false; |
| 3149 if (n == null) return null; | 3313 if (n == null) return null; |
| 3150 throw new core.ArgumentError("Invalid boolean: $n"); | 3314 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3151 } | 3315 } |
| 3316 |
| 3152 if (query.length > 0) { | 3317 if (query.length > 0) { |
| 3153 for (var part in query.split("&")) { | 3318 for (var part in query.split("&")) { |
| 3154 var keyvalue = part.split("="); | 3319 var keyvalue = part.split("="); |
| 3155 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3320 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3321 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3156 } | 3322 } |
| 3157 } | 3323 } |
| 3158 | 3324 |
| 3159 | |
| 3160 var h = { | 3325 var h = { |
| 3161 "content-type" : "application/json; charset=utf-8", | 3326 "content-type": "application/json; charset=utf-8", |
| 3162 }; | 3327 }; |
| 3163 var resp = convert.JSON.encode(buildOperation()); | 3328 var resp = convert.JSON.encode(buildOperation()); |
| 3164 return new async.Future.value(stringResponse(200, h, resp)); | 3329 return new async.Future.value(stringResponse(200, h, resp)); |
| 3165 }), true); | 3330 }), true); |
| 3166 res.delete(arg_projectId, arg_zone, arg_clusterId, arg_nodePoolId).then(un
ittest.expectAsync1(((api.Operation response) { | 3331 res |
| 3332 .delete(arg_projectId, arg_zone, arg_clusterId, arg_nodePoolId) |
| 3333 .then(unittest.expectAsync1(((api.Operation response) { |
| 3167 checkOperation(response); | 3334 checkOperation(response); |
| 3168 }))); | 3335 }))); |
| 3169 }); | 3336 }); |
| 3170 | 3337 |
| 3171 unittest.test("method--get", () { | 3338 unittest.test("method--get", () { |
| 3172 | |
| 3173 var mock = new HttpServerMock(); | 3339 var mock = new HttpServerMock(); |
| 3174 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3340 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3341 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3175 var arg_projectId = "foo"; | 3342 var arg_projectId = "foo"; |
| 3176 var arg_zone = "foo"; | 3343 var arg_zone = "foo"; |
| 3177 var arg_clusterId = "foo"; | 3344 var arg_clusterId = "foo"; |
| 3178 var arg_nodePoolId = "foo"; | 3345 var arg_nodePoolId = "foo"; |
| 3179 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3346 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3180 var path = (req.url).path; | 3347 var path = (req.url).path; |
| 3181 var pathOffset = 0; | 3348 var pathOffset = 0; |
| 3182 var index; | 3349 var index; |
| 3183 var subPart; | 3350 var subPart; |
| 3184 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3351 unittest.expect( |
| 3352 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3185 pathOffset += 1; | 3353 pathOffset += 1; |
| 3186 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3354 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3355 unittest.equals("v1/projects/")); |
| 3187 pathOffset += 12; | 3356 pathOffset += 12; |
| 3188 index = path.indexOf("/zones/", pathOffset); | 3357 index = path.indexOf("/zones/", pathOffset); |
| 3189 unittest.expect(index >= 0, unittest.isTrue); | 3358 unittest.expect(index >= 0, unittest.isTrue); |
| 3190 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3359 subPart = |
| 3360 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3191 pathOffset = index; | 3361 pathOffset = index; |
| 3192 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3362 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3193 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3363 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3364 unittest.equals("/zones/")); |
| 3194 pathOffset += 7; | 3365 pathOffset += 7; |
| 3195 index = path.indexOf("/clusters/", pathOffset); | 3366 index = path.indexOf("/clusters/", pathOffset); |
| 3196 unittest.expect(index >= 0, unittest.isTrue); | 3367 unittest.expect(index >= 0, unittest.isTrue); |
| 3197 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3368 subPart = |
| 3369 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3198 pathOffset = index; | 3370 pathOffset = index; |
| 3199 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3371 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3200 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3372 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3373 unittest.equals("/clusters/")); |
| 3201 pathOffset += 10; | 3374 pathOffset += 10; |
| 3202 index = path.indexOf("/nodePools/", pathOffset); | 3375 index = path.indexOf("/nodePools/", pathOffset); |
| 3203 unittest.expect(index >= 0, unittest.isTrue); | 3376 unittest.expect(index >= 0, unittest.isTrue); |
| 3204 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3377 subPart = |
| 3378 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3205 pathOffset = index; | 3379 pathOffset = index; |
| 3206 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3380 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3207 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3381 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3382 unittest.equals("/nodePools/")); |
| 3208 pathOffset += 11; | 3383 pathOffset += 11; |
| 3209 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3384 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3210 pathOffset = path.length; | 3385 pathOffset = path.length; |
| 3211 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3386 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 3212 | 3387 |
| 3213 var query = (req.url).query; | 3388 var query = (req.url).query; |
| 3214 var queryOffset = 0; | 3389 var queryOffset = 0; |
| 3215 var queryMap = {}; | 3390 var queryMap = {}; |
| 3216 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3391 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3217 parseBool(n) { | 3392 parseBool(n) { |
| 3218 if (n == "true") return true; | 3393 if (n == "true") return true; |
| 3219 if (n == "false") return false; | 3394 if (n == "false") return false; |
| 3220 if (n == null) return null; | 3395 if (n == null) return null; |
| 3221 throw new core.ArgumentError("Invalid boolean: $n"); | 3396 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3222 } | 3397 } |
| 3398 |
| 3223 if (query.length > 0) { | 3399 if (query.length > 0) { |
| 3224 for (var part in query.split("&")) { | 3400 for (var part in query.split("&")) { |
| 3225 var keyvalue = part.split("="); | 3401 var keyvalue = part.split("="); |
| 3226 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3402 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3403 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3227 } | 3404 } |
| 3228 } | 3405 } |
| 3229 | 3406 |
| 3230 | |
| 3231 var h = { | 3407 var h = { |
| 3232 "content-type" : "application/json; charset=utf-8", | 3408 "content-type": "application/json; charset=utf-8", |
| 3233 }; | 3409 }; |
| 3234 var resp = convert.JSON.encode(buildNodePool()); | 3410 var resp = convert.JSON.encode(buildNodePool()); |
| 3235 return new async.Future.value(stringResponse(200, h, resp)); | 3411 return new async.Future.value(stringResponse(200, h, resp)); |
| 3236 }), true); | 3412 }), true); |
| 3237 res.get(arg_projectId, arg_zone, arg_clusterId, arg_nodePoolId).then(unitt
est.expectAsync1(((api.NodePool response) { | 3413 res |
| 3414 .get(arg_projectId, arg_zone, arg_clusterId, arg_nodePoolId) |
| 3415 .then(unittest.expectAsync1(((api.NodePool response) { |
| 3238 checkNodePool(response); | 3416 checkNodePool(response); |
| 3239 }))); | 3417 }))); |
| 3240 }); | 3418 }); |
| 3241 | 3419 |
| 3242 unittest.test("method--list", () { | 3420 unittest.test("method--list", () { |
| 3243 | |
| 3244 var mock = new HttpServerMock(); | 3421 var mock = new HttpServerMock(); |
| 3245 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3422 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3423 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3246 var arg_projectId = "foo"; | 3424 var arg_projectId = "foo"; |
| 3247 var arg_zone = "foo"; | 3425 var arg_zone = "foo"; |
| 3248 var arg_clusterId = "foo"; | 3426 var arg_clusterId = "foo"; |
| 3249 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3427 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3250 var path = (req.url).path; | 3428 var path = (req.url).path; |
| 3251 var pathOffset = 0; | 3429 var pathOffset = 0; |
| 3252 var index; | 3430 var index; |
| 3253 var subPart; | 3431 var subPart; |
| 3254 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3432 unittest.expect( |
| 3433 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3255 pathOffset += 1; | 3434 pathOffset += 1; |
| 3256 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3435 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3436 unittest.equals("v1/projects/")); |
| 3257 pathOffset += 12; | 3437 pathOffset += 12; |
| 3258 index = path.indexOf("/zones/", pathOffset); | 3438 index = path.indexOf("/zones/", pathOffset); |
| 3259 unittest.expect(index >= 0, unittest.isTrue); | 3439 unittest.expect(index >= 0, unittest.isTrue); |
| 3260 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3440 subPart = |
| 3441 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3261 pathOffset = index; | 3442 pathOffset = index; |
| 3262 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3443 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3263 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3444 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3445 unittest.equals("/zones/")); |
| 3264 pathOffset += 7; | 3446 pathOffset += 7; |
| 3265 index = path.indexOf("/clusters/", pathOffset); | 3447 index = path.indexOf("/clusters/", pathOffset); |
| 3266 unittest.expect(index >= 0, unittest.isTrue); | 3448 unittest.expect(index >= 0, unittest.isTrue); |
| 3267 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3449 subPart = |
| 3450 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3268 pathOffset = index; | 3451 pathOffset = index; |
| 3269 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3452 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3270 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3453 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3454 unittest.equals("/clusters/")); |
| 3271 pathOffset += 10; | 3455 pathOffset += 10; |
| 3272 index = path.indexOf("/nodePools", pathOffset); | 3456 index = path.indexOf("/nodePools", pathOffset); |
| 3273 unittest.expect(index >= 0, unittest.isTrue); | 3457 unittest.expect(index >= 0, unittest.isTrue); |
| 3274 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3458 subPart = |
| 3459 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3275 pathOffset = index; | 3460 pathOffset = index; |
| 3276 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3461 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3277 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/nodePools")); | 3462 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3463 unittest.equals("/nodePools")); |
| 3278 pathOffset += 10; | 3464 pathOffset += 10; |
| 3279 | 3465 |
| 3280 var query = (req.url).query; | 3466 var query = (req.url).query; |
| 3281 var queryOffset = 0; | 3467 var queryOffset = 0; |
| 3282 var queryMap = {}; | 3468 var queryMap = {}; |
| 3283 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3469 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3284 parseBool(n) { | 3470 parseBool(n) { |
| 3285 if (n == "true") return true; | 3471 if (n == "true") return true; |
| 3286 if (n == "false") return false; | 3472 if (n == "false") return false; |
| 3287 if (n == null) return null; | 3473 if (n == null) return null; |
| 3288 throw new core.ArgumentError("Invalid boolean: $n"); | 3474 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3289 } | 3475 } |
| 3476 |
| 3290 if (query.length > 0) { | 3477 if (query.length > 0) { |
| 3291 for (var part in query.split("&")) { | 3478 for (var part in query.split("&")) { |
| 3292 var keyvalue = part.split("="); | 3479 var keyvalue = part.split("="); |
| 3293 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3480 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3481 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3294 } | 3482 } |
| 3295 } | 3483 } |
| 3296 | 3484 |
| 3297 | |
| 3298 var h = { | 3485 var h = { |
| 3299 "content-type" : "application/json; charset=utf-8", | 3486 "content-type": "application/json; charset=utf-8", |
| 3300 }; | 3487 }; |
| 3301 var resp = convert.JSON.encode(buildListNodePoolsResponse()); | 3488 var resp = convert.JSON.encode(buildListNodePoolsResponse()); |
| 3302 return new async.Future.value(stringResponse(200, h, resp)); | 3489 return new async.Future.value(stringResponse(200, h, resp)); |
| 3303 }), true); | 3490 }), true); |
| 3304 res.list(arg_projectId, arg_zone, arg_clusterId).then(unittest.expectAsync
1(((api.ListNodePoolsResponse response) { | 3491 res |
| 3492 .list(arg_projectId, arg_zone, arg_clusterId) |
| 3493 .then(unittest.expectAsync1(((api.ListNodePoolsResponse response) { |
| 3305 checkListNodePoolsResponse(response); | 3494 checkListNodePoolsResponse(response); |
| 3306 }))); | 3495 }))); |
| 3307 }); | 3496 }); |
| 3308 | 3497 |
| 3309 unittest.test("method--rollback", () { | 3498 unittest.test("method--rollback", () { |
| 3310 | |
| 3311 var mock = new HttpServerMock(); | 3499 var mock = new HttpServerMock(); |
| 3312 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3500 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3501 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3313 var arg_request = buildRollbackNodePoolUpgradeRequest(); | 3502 var arg_request = buildRollbackNodePoolUpgradeRequest(); |
| 3314 var arg_projectId = "foo"; | 3503 var arg_projectId = "foo"; |
| 3315 var arg_zone = "foo"; | 3504 var arg_zone = "foo"; |
| 3316 var arg_clusterId = "foo"; | 3505 var arg_clusterId = "foo"; |
| 3317 var arg_nodePoolId = "foo"; | 3506 var arg_nodePoolId = "foo"; |
| 3318 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3507 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3319 var obj = new api.RollbackNodePoolUpgradeRequest.fromJson(json); | 3508 var obj = new api.RollbackNodePoolUpgradeRequest.fromJson(json); |
| 3320 checkRollbackNodePoolUpgradeRequest(obj); | 3509 checkRollbackNodePoolUpgradeRequest(obj); |
| 3321 | 3510 |
| 3322 var path = (req.url).path; | 3511 var path = (req.url).path; |
| 3323 var pathOffset = 0; | 3512 var pathOffset = 0; |
| 3324 var index; | 3513 var index; |
| 3325 var subPart; | 3514 var subPart; |
| 3326 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3515 unittest.expect( |
| 3516 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3327 pathOffset += 1; | 3517 pathOffset += 1; |
| 3328 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3518 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3519 unittest.equals("v1/projects/")); |
| 3329 pathOffset += 12; | 3520 pathOffset += 12; |
| 3330 index = path.indexOf("/zones/", pathOffset); | 3521 index = path.indexOf("/zones/", pathOffset); |
| 3331 unittest.expect(index >= 0, unittest.isTrue); | 3522 unittest.expect(index >= 0, unittest.isTrue); |
| 3332 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3523 subPart = |
| 3524 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3333 pathOffset = index; | 3525 pathOffset = index; |
| 3334 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3526 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3335 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3527 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3528 unittest.equals("/zones/")); |
| 3336 pathOffset += 7; | 3529 pathOffset += 7; |
| 3337 index = path.indexOf("/clusters/", pathOffset); | 3530 index = path.indexOf("/clusters/", pathOffset); |
| 3338 unittest.expect(index >= 0, unittest.isTrue); | 3531 unittest.expect(index >= 0, unittest.isTrue); |
| 3339 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3532 subPart = |
| 3533 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3340 pathOffset = index; | 3534 pathOffset = index; |
| 3341 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3535 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3342 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3536 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3537 unittest.equals("/clusters/")); |
| 3343 pathOffset += 10; | 3538 pathOffset += 10; |
| 3344 index = path.indexOf("/nodePools/", pathOffset); | 3539 index = path.indexOf("/nodePools/", pathOffset); |
| 3345 unittest.expect(index >= 0, unittest.isTrue); | 3540 unittest.expect(index >= 0, unittest.isTrue); |
| 3346 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3541 subPart = |
| 3542 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3347 pathOffset = index; | 3543 pathOffset = index; |
| 3348 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3544 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3349 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3545 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3546 unittest.equals("/nodePools/")); |
| 3350 pathOffset += 11; | 3547 pathOffset += 11; |
| 3351 index = path.indexOf(":rollback", pathOffset); | 3548 index = path.indexOf(":rollback", pathOffset); |
| 3352 unittest.expect(index >= 0, unittest.isTrue); | 3549 unittest.expect(index >= 0, unittest.isTrue); |
| 3353 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3550 subPart = |
| 3551 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3354 pathOffset = index; | 3552 pathOffset = index; |
| 3355 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3553 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 3356 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als(":rollback")); | 3554 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3555 unittest.equals(":rollback")); |
| 3357 pathOffset += 9; | 3556 pathOffset += 9; |
| 3358 | 3557 |
| 3359 var query = (req.url).query; | 3558 var query = (req.url).query; |
| 3360 var queryOffset = 0; | 3559 var queryOffset = 0; |
| 3361 var queryMap = {}; | 3560 var queryMap = {}; |
| 3362 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3561 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3363 parseBool(n) { | 3562 parseBool(n) { |
| 3364 if (n == "true") return true; | 3563 if (n == "true") return true; |
| 3365 if (n == "false") return false; | 3564 if (n == "false") return false; |
| 3366 if (n == null) return null; | 3565 if (n == null) return null; |
| 3367 throw new core.ArgumentError("Invalid boolean: $n"); | 3566 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3368 } | 3567 } |
| 3568 |
| 3369 if (query.length > 0) { | 3569 if (query.length > 0) { |
| 3370 for (var part in query.split("&")) { | 3570 for (var part in query.split("&")) { |
| 3371 var keyvalue = part.split("="); | 3571 var keyvalue = part.split("="); |
| 3372 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3572 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3573 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3373 } | 3574 } |
| 3374 } | 3575 } |
| 3375 | 3576 |
| 3376 | |
| 3377 var h = { | 3577 var h = { |
| 3378 "content-type" : "application/json; charset=utf-8", | 3578 "content-type": "application/json; charset=utf-8", |
| 3379 }; | 3579 }; |
| 3380 var resp = convert.JSON.encode(buildOperation()); | 3580 var resp = convert.JSON.encode(buildOperation()); |
| 3381 return new async.Future.value(stringResponse(200, h, resp)); | 3581 return new async.Future.value(stringResponse(200, h, resp)); |
| 3382 }), true); | 3582 }), true); |
| 3383 res.rollback(arg_request, arg_projectId, arg_zone, arg_clusterId, arg_node
PoolId).then(unittest.expectAsync1(((api.Operation response) { | 3583 res |
| 3584 .rollback(arg_request, arg_projectId, arg_zone, arg_clusterId, |
| 3585 arg_nodePoolId) |
| 3586 .then(unittest.expectAsync1(((api.Operation response) { |
| 3384 checkOperation(response); | 3587 checkOperation(response); |
| 3385 }))); | 3588 }))); |
| 3386 }); | 3589 }); |
| 3387 | 3590 |
| 3388 unittest.test("method--setManagement", () { | 3591 unittest.test("method--setManagement", () { |
| 3389 | |
| 3390 var mock = new HttpServerMock(); | 3592 var mock = new HttpServerMock(); |
| 3391 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3593 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3594 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3392 var arg_request = buildSetNodePoolManagementRequest(); | 3595 var arg_request = buildSetNodePoolManagementRequest(); |
| 3393 var arg_projectId = "foo"; | 3596 var arg_projectId = "foo"; |
| 3394 var arg_zone = "foo"; | 3597 var arg_zone = "foo"; |
| 3395 var arg_clusterId = "foo"; | 3598 var arg_clusterId = "foo"; |
| 3396 var arg_nodePoolId = "foo"; | 3599 var arg_nodePoolId = "foo"; |
| 3397 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3600 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3398 var obj = new api.SetNodePoolManagementRequest.fromJson(json); | 3601 var obj = new api.SetNodePoolManagementRequest.fromJson(json); |
| 3399 checkSetNodePoolManagementRequest(obj); | 3602 checkSetNodePoolManagementRequest(obj); |
| 3400 | 3603 |
| 3401 var path = (req.url).path; | 3604 var path = (req.url).path; |
| 3402 var pathOffset = 0; | 3605 var pathOffset = 0; |
| 3403 var index; | 3606 var index; |
| 3404 var subPart; | 3607 var subPart; |
| 3405 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3608 unittest.expect( |
| 3609 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3406 pathOffset += 1; | 3610 pathOffset += 1; |
| 3407 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3611 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3612 unittest.equals("v1/projects/")); |
| 3408 pathOffset += 12; | 3613 pathOffset += 12; |
| 3409 index = path.indexOf("/zones/", pathOffset); | 3614 index = path.indexOf("/zones/", pathOffset); |
| 3410 unittest.expect(index >= 0, unittest.isTrue); | 3615 unittest.expect(index >= 0, unittest.isTrue); |
| 3411 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3616 subPart = |
| 3617 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3412 pathOffset = index; | 3618 pathOffset = index; |
| 3413 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3619 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3414 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3620 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3621 unittest.equals("/zones/")); |
| 3415 pathOffset += 7; | 3622 pathOffset += 7; |
| 3416 index = path.indexOf("/clusters/", pathOffset); | 3623 index = path.indexOf("/clusters/", pathOffset); |
| 3417 unittest.expect(index >= 0, unittest.isTrue); | 3624 unittest.expect(index >= 0, unittest.isTrue); |
| 3418 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3625 subPart = |
| 3626 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3419 pathOffset = index; | 3627 pathOffset = index; |
| 3420 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3628 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3421 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3629 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3630 unittest.equals("/clusters/")); |
| 3422 pathOffset += 10; | 3631 pathOffset += 10; |
| 3423 index = path.indexOf("/nodePools/", pathOffset); | 3632 index = path.indexOf("/nodePools/", pathOffset); |
| 3424 unittest.expect(index >= 0, unittest.isTrue); | 3633 unittest.expect(index >= 0, unittest.isTrue); |
| 3425 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3634 subPart = |
| 3635 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3426 pathOffset = index; | 3636 pathOffset = index; |
| 3427 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3637 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3428 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3638 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3639 unittest.equals("/nodePools/")); |
| 3429 pathOffset += 11; | 3640 pathOffset += 11; |
| 3430 index = path.indexOf("/setManagement", pathOffset); | 3641 index = path.indexOf("/setManagement", pathOffset); |
| 3431 unittest.expect(index >= 0, unittest.isTrue); | 3642 unittest.expect(index >= 0, unittest.isTrue); |
| 3432 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3643 subPart = |
| 3644 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3433 pathOffset = index; | 3645 pathOffset = index; |
| 3434 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3646 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 3435 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/setManagement")); | 3647 unittest.expect(path.substring(pathOffset, pathOffset + 14), |
| 3648 unittest.equals("/setManagement")); |
| 3436 pathOffset += 14; | 3649 pathOffset += 14; |
| 3437 | 3650 |
| 3438 var query = (req.url).query; | 3651 var query = (req.url).query; |
| 3439 var queryOffset = 0; | 3652 var queryOffset = 0; |
| 3440 var queryMap = {}; | 3653 var queryMap = {}; |
| 3441 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3654 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3442 parseBool(n) { | 3655 parseBool(n) { |
| 3443 if (n == "true") return true; | 3656 if (n == "true") return true; |
| 3444 if (n == "false") return false; | 3657 if (n == "false") return false; |
| 3445 if (n == null) return null; | 3658 if (n == null) return null; |
| 3446 throw new core.ArgumentError("Invalid boolean: $n"); | 3659 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3447 } | 3660 } |
| 3661 |
| 3448 if (query.length > 0) { | 3662 if (query.length > 0) { |
| 3449 for (var part in query.split("&")) { | 3663 for (var part in query.split("&")) { |
| 3450 var keyvalue = part.split("="); | 3664 var keyvalue = part.split("="); |
| 3451 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3665 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3666 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3452 } | 3667 } |
| 3453 } | 3668 } |
| 3454 | 3669 |
| 3455 | |
| 3456 var h = { | 3670 var h = { |
| 3457 "content-type" : "application/json; charset=utf-8", | 3671 "content-type": "application/json; charset=utf-8", |
| 3458 }; | 3672 }; |
| 3459 var resp = convert.JSON.encode(buildOperation()); | 3673 var resp = convert.JSON.encode(buildOperation()); |
| 3460 return new async.Future.value(stringResponse(200, h, resp)); | 3674 return new async.Future.value(stringResponse(200, h, resp)); |
| 3461 }), true); | 3675 }), true); |
| 3462 res.setManagement(arg_request, arg_projectId, arg_zone, arg_clusterId, arg
_nodePoolId).then(unittest.expectAsync1(((api.Operation response) { | 3676 res |
| 3677 .setManagement(arg_request, arg_projectId, arg_zone, arg_clusterId, |
| 3678 arg_nodePoolId) |
| 3679 .then(unittest.expectAsync1(((api.Operation response) { |
| 3463 checkOperation(response); | 3680 checkOperation(response); |
| 3464 }))); | 3681 }))); |
| 3465 }); | 3682 }); |
| 3466 | 3683 |
| 3467 unittest.test("method--setSize", () { | 3684 unittest.test("method--setSize", () { |
| 3468 | |
| 3469 var mock = new HttpServerMock(); | 3685 var mock = new HttpServerMock(); |
| 3470 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3686 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3687 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3471 var arg_request = buildSetNodePoolSizeRequest(); | 3688 var arg_request = buildSetNodePoolSizeRequest(); |
| 3472 var arg_projectId = "foo"; | 3689 var arg_projectId = "foo"; |
| 3473 var arg_zone = "foo"; | 3690 var arg_zone = "foo"; |
| 3474 var arg_clusterId = "foo"; | 3691 var arg_clusterId = "foo"; |
| 3475 var arg_nodePoolId = "foo"; | 3692 var arg_nodePoolId = "foo"; |
| 3476 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3693 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3477 var obj = new api.SetNodePoolSizeRequest.fromJson(json); | 3694 var obj = new api.SetNodePoolSizeRequest.fromJson(json); |
| 3478 checkSetNodePoolSizeRequest(obj); | 3695 checkSetNodePoolSizeRequest(obj); |
| 3479 | 3696 |
| 3480 var path = (req.url).path; | 3697 var path = (req.url).path; |
| 3481 var pathOffset = 0; | 3698 var pathOffset = 0; |
| 3482 var index; | 3699 var index; |
| 3483 var subPart; | 3700 var subPart; |
| 3484 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3701 unittest.expect( |
| 3702 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3485 pathOffset += 1; | 3703 pathOffset += 1; |
| 3486 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3704 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3705 unittest.equals("v1/projects/")); |
| 3487 pathOffset += 12; | 3706 pathOffset += 12; |
| 3488 index = path.indexOf("/zones/", pathOffset); | 3707 index = path.indexOf("/zones/", pathOffset); |
| 3489 unittest.expect(index >= 0, unittest.isTrue); | 3708 unittest.expect(index >= 0, unittest.isTrue); |
| 3490 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3709 subPart = |
| 3710 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3491 pathOffset = index; | 3711 pathOffset = index; |
| 3492 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3712 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3493 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3713 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3714 unittest.equals("/zones/")); |
| 3494 pathOffset += 7; | 3715 pathOffset += 7; |
| 3495 index = path.indexOf("/clusters/", pathOffset); | 3716 index = path.indexOf("/clusters/", pathOffset); |
| 3496 unittest.expect(index >= 0, unittest.isTrue); | 3717 unittest.expect(index >= 0, unittest.isTrue); |
| 3497 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3718 subPart = |
| 3719 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3498 pathOffset = index; | 3720 pathOffset = index; |
| 3499 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3721 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3500 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3722 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3723 unittest.equals("/clusters/")); |
| 3501 pathOffset += 10; | 3724 pathOffset += 10; |
| 3502 index = path.indexOf("/nodePools/", pathOffset); | 3725 index = path.indexOf("/nodePools/", pathOffset); |
| 3503 unittest.expect(index >= 0, unittest.isTrue); | 3726 unittest.expect(index >= 0, unittest.isTrue); |
| 3504 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3727 subPart = |
| 3728 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3505 pathOffset = index; | 3729 pathOffset = index; |
| 3506 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3730 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3507 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3731 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3732 unittest.equals("/nodePools/")); |
| 3508 pathOffset += 11; | 3733 pathOffset += 11; |
| 3509 index = path.indexOf("/setSize", pathOffset); | 3734 index = path.indexOf("/setSize", pathOffset); |
| 3510 unittest.expect(index >= 0, unittest.isTrue); | 3735 unittest.expect(index >= 0, unittest.isTrue); |
| 3511 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3736 subPart = |
| 3737 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3512 pathOffset = index; | 3738 pathOffset = index; |
| 3513 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3739 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 3514 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/setSize")); | 3740 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 3741 unittest.equals("/setSize")); |
| 3515 pathOffset += 8; | 3742 pathOffset += 8; |
| 3516 | 3743 |
| 3517 var query = (req.url).query; | 3744 var query = (req.url).query; |
| 3518 var queryOffset = 0; | 3745 var queryOffset = 0; |
| 3519 var queryMap = {}; | 3746 var queryMap = {}; |
| 3520 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3747 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3521 parseBool(n) { | 3748 parseBool(n) { |
| 3522 if (n == "true") return true; | 3749 if (n == "true") return true; |
| 3523 if (n == "false") return false; | 3750 if (n == "false") return false; |
| 3524 if (n == null) return null; | 3751 if (n == null) return null; |
| 3525 throw new core.ArgumentError("Invalid boolean: $n"); | 3752 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3526 } | 3753 } |
| 3754 |
| 3527 if (query.length > 0) { | 3755 if (query.length > 0) { |
| 3528 for (var part in query.split("&")) { | 3756 for (var part in query.split("&")) { |
| 3529 var keyvalue = part.split("="); | 3757 var keyvalue = part.split("="); |
| 3530 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3758 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3759 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3531 } | 3760 } |
| 3532 } | 3761 } |
| 3533 | 3762 |
| 3534 | |
| 3535 var h = { | 3763 var h = { |
| 3536 "content-type" : "application/json; charset=utf-8", | 3764 "content-type": "application/json; charset=utf-8", |
| 3537 }; | 3765 }; |
| 3538 var resp = convert.JSON.encode(buildOperation()); | 3766 var resp = convert.JSON.encode(buildOperation()); |
| 3539 return new async.Future.value(stringResponse(200, h, resp)); | 3767 return new async.Future.value(stringResponse(200, h, resp)); |
| 3540 }), true); | 3768 }), true); |
| 3541 res.setSize(arg_request, arg_projectId, arg_zone, arg_clusterId, arg_nodeP
oolId).then(unittest.expectAsync1(((api.Operation response) { | 3769 res |
| 3770 .setSize(arg_request, arg_projectId, arg_zone, arg_clusterId, |
| 3771 arg_nodePoolId) |
| 3772 .then(unittest.expectAsync1(((api.Operation response) { |
| 3542 checkOperation(response); | 3773 checkOperation(response); |
| 3543 }))); | 3774 }))); |
| 3544 }); | 3775 }); |
| 3545 | 3776 |
| 3546 unittest.test("method--update", () { | 3777 unittest.test("method--update", () { |
| 3547 | |
| 3548 var mock = new HttpServerMock(); | 3778 var mock = new HttpServerMock(); |
| 3549 api.ProjectsZonesClustersNodePoolsResourceApi res = new api.ContainerApi(m
ock).projects.zones.clusters.nodePools; | 3779 api.ProjectsZonesClustersNodePoolsResourceApi res = |
| 3780 new api.ContainerApi(mock).projects.zones.clusters.nodePools; |
| 3550 var arg_request = buildUpdateNodePoolRequest(); | 3781 var arg_request = buildUpdateNodePoolRequest(); |
| 3551 var arg_projectId = "foo"; | 3782 var arg_projectId = "foo"; |
| 3552 var arg_zone = "foo"; | 3783 var arg_zone = "foo"; |
| 3553 var arg_clusterId = "foo"; | 3784 var arg_clusterId = "foo"; |
| 3554 var arg_nodePoolId = "foo"; | 3785 var arg_nodePoolId = "foo"; |
| 3555 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3786 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3556 var obj = new api.UpdateNodePoolRequest.fromJson(json); | 3787 var obj = new api.UpdateNodePoolRequest.fromJson(json); |
| 3557 checkUpdateNodePoolRequest(obj); | 3788 checkUpdateNodePoolRequest(obj); |
| 3558 | 3789 |
| 3559 var path = (req.url).path; | 3790 var path = (req.url).path; |
| 3560 var pathOffset = 0; | 3791 var pathOffset = 0; |
| 3561 var index; | 3792 var index; |
| 3562 var subPart; | 3793 var subPart; |
| 3563 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3794 unittest.expect( |
| 3795 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3564 pathOffset += 1; | 3796 pathOffset += 1; |
| 3565 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3797 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3798 unittest.equals("v1/projects/")); |
| 3566 pathOffset += 12; | 3799 pathOffset += 12; |
| 3567 index = path.indexOf("/zones/", pathOffset); | 3800 index = path.indexOf("/zones/", pathOffset); |
| 3568 unittest.expect(index >= 0, unittest.isTrue); | 3801 unittest.expect(index >= 0, unittest.isTrue); |
| 3569 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3802 subPart = |
| 3803 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3570 pathOffset = index; | 3804 pathOffset = index; |
| 3571 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3805 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3572 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3806 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3807 unittest.equals("/zones/")); |
| 3573 pathOffset += 7; | 3808 pathOffset += 7; |
| 3574 index = path.indexOf("/clusters/", pathOffset); | 3809 index = path.indexOf("/clusters/", pathOffset); |
| 3575 unittest.expect(index >= 0, unittest.isTrue); | 3810 unittest.expect(index >= 0, unittest.isTrue); |
| 3576 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3811 subPart = |
| 3812 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3577 pathOffset = index; | 3813 pathOffset = index; |
| 3578 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3814 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3579 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/clusters/")); | 3815 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3816 unittest.equals("/clusters/")); |
| 3580 pathOffset += 10; | 3817 pathOffset += 10; |
| 3581 index = path.indexOf("/nodePools/", pathOffset); | 3818 index = path.indexOf("/nodePools/", pathOffset); |
| 3582 unittest.expect(index >= 0, unittest.isTrue); | 3819 unittest.expect(index >= 0, unittest.isTrue); |
| 3583 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3820 subPart = |
| 3821 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3584 pathOffset = index; | 3822 pathOffset = index; |
| 3585 unittest.expect(subPart, unittest.equals("$arg_clusterId")); | 3823 unittest.expect(subPart, unittest.equals("$arg_clusterId")); |
| 3586 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/nodePools/")); | 3824 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3825 unittest.equals("/nodePools/")); |
| 3587 pathOffset += 11; | 3826 pathOffset += 11; |
| 3588 index = path.indexOf("/update", pathOffset); | 3827 index = path.indexOf("/update", pathOffset); |
| 3589 unittest.expect(index >= 0, unittest.isTrue); | 3828 unittest.expect(index >= 0, unittest.isTrue); |
| 3590 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3829 subPart = |
| 3830 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3591 pathOffset = index; | 3831 pathOffset = index; |
| 3592 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); | 3832 unittest.expect(subPart, unittest.equals("$arg_nodePoolId")); |
| 3593 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/update")); | 3833 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3834 unittest.equals("/update")); |
| 3594 pathOffset += 7; | 3835 pathOffset += 7; |
| 3595 | 3836 |
| 3596 var query = (req.url).query; | 3837 var query = (req.url).query; |
| 3597 var queryOffset = 0; | 3838 var queryOffset = 0; |
| 3598 var queryMap = {}; | 3839 var queryMap = {}; |
| 3599 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3840 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3600 parseBool(n) { | 3841 parseBool(n) { |
| 3601 if (n == "true") return true; | 3842 if (n == "true") return true; |
| 3602 if (n == "false") return false; | 3843 if (n == "false") return false; |
| 3603 if (n == null) return null; | 3844 if (n == null) return null; |
| 3604 throw new core.ArgumentError("Invalid boolean: $n"); | 3845 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3605 } | 3846 } |
| 3847 |
| 3606 if (query.length > 0) { | 3848 if (query.length > 0) { |
| 3607 for (var part in query.split("&")) { | 3849 for (var part in query.split("&")) { |
| 3608 var keyvalue = part.split("="); | 3850 var keyvalue = part.split("="); |
| 3609 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3851 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3852 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3610 } | 3853 } |
| 3611 } | 3854 } |
| 3612 | 3855 |
| 3613 | |
| 3614 var h = { | 3856 var h = { |
| 3615 "content-type" : "application/json; charset=utf-8", | 3857 "content-type": "application/json; charset=utf-8", |
| 3616 }; | 3858 }; |
| 3617 var resp = convert.JSON.encode(buildOperation()); | 3859 var resp = convert.JSON.encode(buildOperation()); |
| 3618 return new async.Future.value(stringResponse(200, h, resp)); | 3860 return new async.Future.value(stringResponse(200, h, resp)); |
| 3619 }), true); | 3861 }), true); |
| 3620 res.update(arg_request, arg_projectId, arg_zone, arg_clusterId, arg_nodePo
olId).then(unittest.expectAsync1(((api.Operation response) { | 3862 res |
| 3863 .update(arg_request, arg_projectId, arg_zone, arg_clusterId, |
| 3864 arg_nodePoolId) |
| 3865 .then(unittest.expectAsync1(((api.Operation response) { |
| 3621 checkOperation(response); | 3866 checkOperation(response); |
| 3622 }))); | 3867 }))); |
| 3623 }); | 3868 }); |
| 3624 | |
| 3625 }); | 3869 }); |
| 3626 | 3870 |
| 3627 | |
| 3628 unittest.group("resource-ProjectsZonesOperationsResourceApi", () { | 3871 unittest.group("resource-ProjectsZonesOperationsResourceApi", () { |
| 3629 unittest.test("method--cancel", () { | 3872 unittest.test("method--cancel", () { |
| 3630 | |
| 3631 var mock = new HttpServerMock(); | 3873 var mock = new HttpServerMock(); |
| 3632 api.ProjectsZonesOperationsResourceApi res = new api.ContainerApi(mock).pr
ojects.zones.operations; | 3874 api.ProjectsZonesOperationsResourceApi res = |
| 3875 new api.ContainerApi(mock).projects.zones.operations; |
| 3633 var arg_request = buildCancelOperationRequest(); | 3876 var arg_request = buildCancelOperationRequest(); |
| 3634 var arg_projectId = "foo"; | 3877 var arg_projectId = "foo"; |
| 3635 var arg_zone = "foo"; | 3878 var arg_zone = "foo"; |
| 3636 var arg_operationId = "foo"; | 3879 var arg_operationId = "foo"; |
| 3637 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3880 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3638 var obj = new api.CancelOperationRequest.fromJson(json); | 3881 var obj = new api.CancelOperationRequest.fromJson(json); |
| 3639 checkCancelOperationRequest(obj); | 3882 checkCancelOperationRequest(obj); |
| 3640 | 3883 |
| 3641 var path = (req.url).path; | 3884 var path = (req.url).path; |
| 3642 var pathOffset = 0; | 3885 var pathOffset = 0; |
| 3643 var index; | 3886 var index; |
| 3644 var subPart; | 3887 var subPart; |
| 3645 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3888 unittest.expect( |
| 3889 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3646 pathOffset += 1; | 3890 pathOffset += 1; |
| 3647 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3891 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3892 unittest.equals("v1/projects/")); |
| 3648 pathOffset += 12; | 3893 pathOffset += 12; |
| 3649 index = path.indexOf("/zones/", pathOffset); | 3894 index = path.indexOf("/zones/", pathOffset); |
| 3650 unittest.expect(index >= 0, unittest.isTrue); | 3895 unittest.expect(index >= 0, unittest.isTrue); |
| 3651 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3896 subPart = |
| 3897 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3652 pathOffset = index; | 3898 pathOffset = index; |
| 3653 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3899 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3654 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3900 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3901 unittest.equals("/zones/")); |
| 3655 pathOffset += 7; | 3902 pathOffset += 7; |
| 3656 index = path.indexOf("/operations/", pathOffset); | 3903 index = path.indexOf("/operations/", pathOffset); |
| 3657 unittest.expect(index >= 0, unittest.isTrue); | 3904 unittest.expect(index >= 0, unittest.isTrue); |
| 3658 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3905 subPart = |
| 3906 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3659 pathOffset = index; | 3907 pathOffset = index; |
| 3660 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3908 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3661 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/operations/")); | 3909 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3910 unittest.equals("/operations/")); |
| 3662 pathOffset += 12; | 3911 pathOffset += 12; |
| 3663 index = path.indexOf(":cancel", pathOffset); | 3912 index = path.indexOf(":cancel", pathOffset); |
| 3664 unittest.expect(index >= 0, unittest.isTrue); | 3913 unittest.expect(index >= 0, unittest.isTrue); |
| 3665 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3914 subPart = |
| 3915 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3666 pathOffset = index; | 3916 pathOffset = index; |
| 3667 unittest.expect(subPart, unittest.equals("$arg_operationId")); | 3917 unittest.expect(subPart, unittest.equals("$arg_operationId")); |
| 3668 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als(":cancel")); | 3918 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3919 unittest.equals(":cancel")); |
| 3669 pathOffset += 7; | 3920 pathOffset += 7; |
| 3670 | 3921 |
| 3671 var query = (req.url).query; | 3922 var query = (req.url).query; |
| 3672 var queryOffset = 0; | 3923 var queryOffset = 0; |
| 3673 var queryMap = {}; | 3924 var queryMap = {}; |
| 3674 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3925 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3675 parseBool(n) { | 3926 parseBool(n) { |
| 3676 if (n == "true") return true; | 3927 if (n == "true") return true; |
| 3677 if (n == "false") return false; | 3928 if (n == "false") return false; |
| 3678 if (n == null) return null; | 3929 if (n == null) return null; |
| 3679 throw new core.ArgumentError("Invalid boolean: $n"); | 3930 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3680 } | 3931 } |
| 3932 |
| 3681 if (query.length > 0) { | 3933 if (query.length > 0) { |
| 3682 for (var part in query.split("&")) { | 3934 for (var part in query.split("&")) { |
| 3683 var keyvalue = part.split("="); | 3935 var keyvalue = part.split("="); |
| 3684 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3936 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3937 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3685 } | 3938 } |
| 3686 } | 3939 } |
| 3687 | 3940 |
| 3688 | |
| 3689 var h = { | 3941 var h = { |
| 3690 "content-type" : "application/json; charset=utf-8", | 3942 "content-type": "application/json; charset=utf-8", |
| 3691 }; | 3943 }; |
| 3692 var resp = convert.JSON.encode(buildEmpty()); | 3944 var resp = convert.JSON.encode(buildEmpty()); |
| 3693 return new async.Future.value(stringResponse(200, h, resp)); | 3945 return new async.Future.value(stringResponse(200, h, resp)); |
| 3694 }), true); | 3946 }), true); |
| 3695 res.cancel(arg_request, arg_projectId, arg_zone, arg_operationId).then(uni
ttest.expectAsync1(((api.Empty response) { | 3947 res |
| 3948 .cancel(arg_request, arg_projectId, arg_zone, arg_operationId) |
| 3949 .then(unittest.expectAsync1(((api.Empty response) { |
| 3696 checkEmpty(response); | 3950 checkEmpty(response); |
| 3697 }))); | 3951 }))); |
| 3698 }); | 3952 }); |
| 3699 | 3953 |
| 3700 unittest.test("method--get", () { | 3954 unittest.test("method--get", () { |
| 3701 | |
| 3702 var mock = new HttpServerMock(); | 3955 var mock = new HttpServerMock(); |
| 3703 api.ProjectsZonesOperationsResourceApi res = new api.ContainerApi(mock).pr
ojects.zones.operations; | 3956 api.ProjectsZonesOperationsResourceApi res = |
| 3957 new api.ContainerApi(mock).projects.zones.operations; |
| 3704 var arg_projectId = "foo"; | 3958 var arg_projectId = "foo"; |
| 3705 var arg_zone = "foo"; | 3959 var arg_zone = "foo"; |
| 3706 var arg_operationId = "foo"; | 3960 var arg_operationId = "foo"; |
| 3707 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3961 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3708 var path = (req.url).path; | 3962 var path = (req.url).path; |
| 3709 var pathOffset = 0; | 3963 var pathOffset = 0; |
| 3710 var index; | 3964 var index; |
| 3711 var subPart; | 3965 var subPart; |
| 3712 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3966 unittest.expect( |
| 3967 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3713 pathOffset += 1; | 3968 pathOffset += 1; |
| 3714 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3969 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3970 unittest.equals("v1/projects/")); |
| 3715 pathOffset += 12; | 3971 pathOffset += 12; |
| 3716 index = path.indexOf("/zones/", pathOffset); | 3972 index = path.indexOf("/zones/", pathOffset); |
| 3717 unittest.expect(index >= 0, unittest.isTrue); | 3973 unittest.expect(index >= 0, unittest.isTrue); |
| 3718 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3974 subPart = |
| 3975 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3719 pathOffset = index; | 3976 pathOffset = index; |
| 3720 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3977 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3721 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 3978 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3979 unittest.equals("/zones/")); |
| 3722 pathOffset += 7; | 3980 pathOffset += 7; |
| 3723 index = path.indexOf("/operations/", pathOffset); | 3981 index = path.indexOf("/operations/", pathOffset); |
| 3724 unittest.expect(index >= 0, unittest.isTrue); | 3982 unittest.expect(index >= 0, unittest.isTrue); |
| 3725 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3983 subPart = |
| 3984 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3726 pathOffset = index; | 3985 pathOffset = index; |
| 3727 unittest.expect(subPart, unittest.equals("$arg_zone")); | 3986 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3728 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/operations/")); | 3987 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3988 unittest.equals("/operations/")); |
| 3729 pathOffset += 12; | 3989 pathOffset += 12; |
| 3730 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3990 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3731 pathOffset = path.length; | 3991 pathOffset = path.length; |
| 3732 unittest.expect(subPart, unittest.equals("$arg_operationId")); | 3992 unittest.expect(subPart, unittest.equals("$arg_operationId")); |
| 3733 | 3993 |
| 3734 var query = (req.url).query; | 3994 var query = (req.url).query; |
| 3735 var queryOffset = 0; | 3995 var queryOffset = 0; |
| 3736 var queryMap = {}; | 3996 var queryMap = {}; |
| 3737 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3997 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3738 parseBool(n) { | 3998 parseBool(n) { |
| 3739 if (n == "true") return true; | 3999 if (n == "true") return true; |
| 3740 if (n == "false") return false; | 4000 if (n == "false") return false; |
| 3741 if (n == null) return null; | 4001 if (n == null) return null; |
| 3742 throw new core.ArgumentError("Invalid boolean: $n"); | 4002 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3743 } | 4003 } |
| 4004 |
| 3744 if (query.length > 0) { | 4005 if (query.length > 0) { |
| 3745 for (var part in query.split("&")) { | 4006 for (var part in query.split("&")) { |
| 3746 var keyvalue = part.split("="); | 4007 var keyvalue = part.split("="); |
| 3747 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4008 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4009 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3748 } | 4010 } |
| 3749 } | 4011 } |
| 3750 | 4012 |
| 3751 | |
| 3752 var h = { | 4013 var h = { |
| 3753 "content-type" : "application/json; charset=utf-8", | 4014 "content-type": "application/json; charset=utf-8", |
| 3754 }; | 4015 }; |
| 3755 var resp = convert.JSON.encode(buildOperation()); | 4016 var resp = convert.JSON.encode(buildOperation()); |
| 3756 return new async.Future.value(stringResponse(200, h, resp)); | 4017 return new async.Future.value(stringResponse(200, h, resp)); |
| 3757 }), true); | 4018 }), true); |
| 3758 res.get(arg_projectId, arg_zone, arg_operationId).then(unittest.expectAsyn
c1(((api.Operation response) { | 4019 res |
| 4020 .get(arg_projectId, arg_zone, arg_operationId) |
| 4021 .then(unittest.expectAsync1(((api.Operation response) { |
| 3759 checkOperation(response); | 4022 checkOperation(response); |
| 3760 }))); | 4023 }))); |
| 3761 }); | 4024 }); |
| 3762 | 4025 |
| 3763 unittest.test("method--list", () { | 4026 unittest.test("method--list", () { |
| 3764 | |
| 3765 var mock = new HttpServerMock(); | 4027 var mock = new HttpServerMock(); |
| 3766 api.ProjectsZonesOperationsResourceApi res = new api.ContainerApi(mock).pr
ojects.zones.operations; | 4028 api.ProjectsZonesOperationsResourceApi res = |
| 4029 new api.ContainerApi(mock).projects.zones.operations; |
| 3767 var arg_projectId = "foo"; | 4030 var arg_projectId = "foo"; |
| 3768 var arg_zone = "foo"; | 4031 var arg_zone = "foo"; |
| 3769 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4032 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3770 var path = (req.url).path; | 4033 var path = (req.url).path; |
| 3771 var pathOffset = 0; | 4034 var pathOffset = 0; |
| 3772 var index; | 4035 var index; |
| 3773 var subPart; | 4036 var subPart; |
| 3774 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4037 unittest.expect( |
| 4038 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3775 pathOffset += 1; | 4039 pathOffset += 1; |
| 3776 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 4040 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4041 unittest.equals("v1/projects/")); |
| 3777 pathOffset += 12; | 4042 pathOffset += 12; |
| 3778 index = path.indexOf("/zones/", pathOffset); | 4043 index = path.indexOf("/zones/", pathOffset); |
| 3779 unittest.expect(index >= 0, unittest.isTrue); | 4044 unittest.expect(index >= 0, unittest.isTrue); |
| 3780 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4045 subPart = |
| 4046 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3781 pathOffset = index; | 4047 pathOffset = index; |
| 3782 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 4048 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3783 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/zones/")); | 4049 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 4050 unittest.equals("/zones/")); |
| 3784 pathOffset += 7; | 4051 pathOffset += 7; |
| 3785 index = path.indexOf("/operations", pathOffset); | 4052 index = path.indexOf("/operations", pathOffset); |
| 3786 unittest.expect(index >= 0, unittest.isTrue); | 4053 unittest.expect(index >= 0, unittest.isTrue); |
| 3787 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4054 subPart = |
| 4055 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3788 pathOffset = index; | 4056 pathOffset = index; |
| 3789 unittest.expect(subPart, unittest.equals("$arg_zone")); | 4057 unittest.expect(subPart, unittest.equals("$arg_zone")); |
| 3790 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/operations")); | 4058 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4059 unittest.equals("/operations")); |
| 3791 pathOffset += 11; | 4060 pathOffset += 11; |
| 3792 | 4061 |
| 3793 var query = (req.url).query; | 4062 var query = (req.url).query; |
| 3794 var queryOffset = 0; | 4063 var queryOffset = 0; |
| 3795 var queryMap = {}; | 4064 var queryMap = {}; |
| 3796 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4065 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3797 parseBool(n) { | 4066 parseBool(n) { |
| 3798 if (n == "true") return true; | 4067 if (n == "true") return true; |
| 3799 if (n == "false") return false; | 4068 if (n == "false") return false; |
| 3800 if (n == null) return null; | 4069 if (n == null) return null; |
| 3801 throw new core.ArgumentError("Invalid boolean: $n"); | 4070 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3802 } | 4071 } |
| 4072 |
| 3803 if (query.length > 0) { | 4073 if (query.length > 0) { |
| 3804 for (var part in query.split("&")) { | 4074 for (var part in query.split("&")) { |
| 3805 var keyvalue = part.split("="); | 4075 var keyvalue = part.split("="); |
| 3806 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4076 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4077 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3807 } | 4078 } |
| 3808 } | 4079 } |
| 3809 | 4080 |
| 3810 | |
| 3811 var h = { | 4081 var h = { |
| 3812 "content-type" : "application/json; charset=utf-8", | 4082 "content-type": "application/json; charset=utf-8", |
| 3813 }; | 4083 }; |
| 3814 var resp = convert.JSON.encode(buildListOperationsResponse()); | 4084 var resp = convert.JSON.encode(buildListOperationsResponse()); |
| 3815 return new async.Future.value(stringResponse(200, h, resp)); | 4085 return new async.Future.value(stringResponse(200, h, resp)); |
| 3816 }), true); | 4086 }), true); |
| 3817 res.list(arg_projectId, arg_zone).then(unittest.expectAsync1(((api.ListOpe
rationsResponse response) { | 4087 res |
| 4088 .list(arg_projectId, arg_zone) |
| 4089 .then(unittest.expectAsync1(((api.ListOperationsResponse response) { |
| 3818 checkListOperationsResponse(response); | 4090 checkListOperationsResponse(response); |
| 3819 }))); | 4091 }))); |
| 3820 }); | 4092 }); |
| 3821 | |
| 3822 }); | 4093 }); |
| 3823 | |
| 3824 | |
| 3825 } | 4094 } |
| 3826 | |
| OLD | NEW |