| OLD | NEW |
| 1 library googleapis.logging.v2.test; | 1 library googleapis.logging.v2.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:test/test.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 core.int buildCounterHttpRequest = 0; | 71 core.int buildCounterHttpRequest = 0; |
| 72 buildHttpRequest() { | 72 buildHttpRequest() { |
| 73 var o = new api.HttpRequest(); | 73 var o = new api.HttpRequest(); |
| 74 buildCounterHttpRequest++; | 74 buildCounterHttpRequest++; |
| 75 if (buildCounterHttpRequest < 3) { | 75 if (buildCounterHttpRequest < 3) { |
| 76 o.cacheFillBytes = "foo"; | 76 o.cacheFillBytes = "foo"; |
| 77 o.cacheHit = true; | 77 o.cacheHit = true; |
| 78 o.cacheLookup = true; | 78 o.cacheLookup = true; |
| 79 o.cacheValidatedWithOriginServer = true; | 79 o.cacheValidatedWithOriginServer = true; |
| 80 o.latency = "foo"; | 80 o.latency = "foo"; |
| 81 o.protocol = "foo"; |
| 81 o.referer = "foo"; | 82 o.referer = "foo"; |
| 82 o.remoteIp = "foo"; | 83 o.remoteIp = "foo"; |
| 83 o.requestMethod = "foo"; | 84 o.requestMethod = "foo"; |
| 84 o.requestSize = "foo"; | 85 o.requestSize = "foo"; |
| 85 o.requestUrl = "foo"; | 86 o.requestUrl = "foo"; |
| 86 o.responseSize = "foo"; | 87 o.responseSize = "foo"; |
| 87 o.serverIp = "foo"; | 88 o.serverIp = "foo"; |
| 88 o.status = 42; | 89 o.status = 42; |
| 89 o.userAgent = "foo"; | 90 o.userAgent = "foo"; |
| 90 } | 91 } |
| 91 buildCounterHttpRequest--; | 92 buildCounterHttpRequest--; |
| 92 return o; | 93 return o; |
| 93 } | 94 } |
| 94 | 95 |
| 95 checkHttpRequest(api.HttpRequest o) { | 96 checkHttpRequest(api.HttpRequest o) { |
| 96 buildCounterHttpRequest++; | 97 buildCounterHttpRequest++; |
| 97 if (buildCounterHttpRequest < 3) { | 98 if (buildCounterHttpRequest < 3) { |
| 98 unittest.expect(o.cacheFillBytes, unittest.equals('foo')); | 99 unittest.expect(o.cacheFillBytes, unittest.equals('foo')); |
| 99 unittest.expect(o.cacheHit, unittest.isTrue); | 100 unittest.expect(o.cacheHit, unittest.isTrue); |
| 100 unittest.expect(o.cacheLookup, unittest.isTrue); | 101 unittest.expect(o.cacheLookup, unittest.isTrue); |
| 101 unittest.expect(o.cacheValidatedWithOriginServer, unittest.isTrue); | 102 unittest.expect(o.cacheValidatedWithOriginServer, unittest.isTrue); |
| 102 unittest.expect(o.latency, unittest.equals('foo')); | 103 unittest.expect(o.latency, unittest.equals('foo')); |
| 104 unittest.expect(o.protocol, unittest.equals('foo')); |
| 103 unittest.expect(o.referer, unittest.equals('foo')); | 105 unittest.expect(o.referer, unittest.equals('foo')); |
| 104 unittest.expect(o.remoteIp, unittest.equals('foo')); | 106 unittest.expect(o.remoteIp, unittest.equals('foo')); |
| 105 unittest.expect(o.requestMethod, unittest.equals('foo')); | 107 unittest.expect(o.requestMethod, unittest.equals('foo')); |
| 106 unittest.expect(o.requestSize, unittest.equals('foo')); | 108 unittest.expect(o.requestSize, unittest.equals('foo')); |
| 107 unittest.expect(o.requestUrl, unittest.equals('foo')); | 109 unittest.expect(o.requestUrl, unittest.equals('foo')); |
| 108 unittest.expect(o.responseSize, unittest.equals('foo')); | 110 unittest.expect(o.responseSize, unittest.equals('foo')); |
| 109 unittest.expect(o.serverIp, unittest.equals('foo')); | 111 unittest.expect(o.serverIp, unittest.equals('foo')); |
| 110 unittest.expect(o.status, unittest.equals(42)); | 112 unittest.expect(o.status, unittest.equals(42)); |
| 111 unittest.expect(o.userAgent, unittest.equals('foo')); | 113 unittest.expect(o.userAgent, unittest.equals('foo')); |
| 112 } | 114 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 129 checkLabelDescriptor(api.LabelDescriptor o) { | 131 checkLabelDescriptor(api.LabelDescriptor o) { |
| 130 buildCounterLabelDescriptor++; | 132 buildCounterLabelDescriptor++; |
| 131 if (buildCounterLabelDescriptor < 3) { | 133 if (buildCounterLabelDescriptor < 3) { |
| 132 unittest.expect(o.description, unittest.equals('foo')); | 134 unittest.expect(o.description, unittest.equals('foo')); |
| 133 unittest.expect(o.key, unittest.equals('foo')); | 135 unittest.expect(o.key, unittest.equals('foo')); |
| 134 unittest.expect(o.valueType, unittest.equals('foo')); | 136 unittest.expect(o.valueType, unittest.equals('foo')); |
| 135 } | 137 } |
| 136 buildCounterLabelDescriptor--; | 138 buildCounterLabelDescriptor--; |
| 137 } | 139 } |
| 138 | 140 |
| 139 buildUnnamed250() { | 141 buildUnnamed255() { |
| 140 var o = new core.List<core.String>(); | 142 var o = new core.List<core.String>(); |
| 141 o.add("foo"); | 143 o.add("foo"); |
| 142 o.add("foo"); | 144 o.add("foo"); |
| 143 return o; | 145 return o; |
| 144 } | 146 } |
| 145 | 147 |
| 146 checkUnnamed250(core.List<core.String> o) { | 148 checkUnnamed255(core.List<core.String> o) { |
| 147 unittest.expect(o, unittest.hasLength(2)); | 149 unittest.expect(o, unittest.hasLength(2)); |
| 148 unittest.expect(o[0], unittest.equals('foo')); | 150 unittest.expect(o[0], unittest.equals('foo')); |
| 149 unittest.expect(o[1], unittest.equals('foo')); | 151 unittest.expect(o[1], unittest.equals('foo')); |
| 150 } | 152 } |
| 151 | 153 |
| 152 buildUnnamed251() { | 154 buildUnnamed256() { |
| 153 var o = new core.List<core.String>(); | 155 var o = new core.List<core.String>(); |
| 154 o.add("foo"); | 156 o.add("foo"); |
| 155 o.add("foo"); | 157 o.add("foo"); |
| 156 return o; | 158 return o; |
| 157 } | 159 } |
| 158 | 160 |
| 159 checkUnnamed251(core.List<core.String> o) { | 161 checkUnnamed256(core.List<core.String> o) { |
| 160 unittest.expect(o, unittest.hasLength(2)); | 162 unittest.expect(o, unittest.hasLength(2)); |
| 161 unittest.expect(o[0], unittest.equals('foo')); | 163 unittest.expect(o[0], unittest.equals('foo')); |
| 162 unittest.expect(o[1], unittest.equals('foo')); | 164 unittest.expect(o[1], unittest.equals('foo')); |
| 163 } | 165 } |
| 164 | 166 |
| 165 core.int buildCounterListLogEntriesRequest = 0; | 167 core.int buildCounterListLogEntriesRequest = 0; |
| 166 buildListLogEntriesRequest() { | 168 buildListLogEntriesRequest() { |
| 167 var o = new api.ListLogEntriesRequest(); | 169 var o = new api.ListLogEntriesRequest(); |
| 168 buildCounterListLogEntriesRequest++; | 170 buildCounterListLogEntriesRequest++; |
| 169 if (buildCounterListLogEntriesRequest < 3) { | 171 if (buildCounterListLogEntriesRequest < 3) { |
| 170 o.filter = "foo"; | 172 o.filter = "foo"; |
| 171 o.orderBy = "foo"; | 173 o.orderBy = "foo"; |
| 172 o.pageSize = 42; | 174 o.pageSize = 42; |
| 173 o.pageToken = "foo"; | 175 o.pageToken = "foo"; |
| 174 o.projectIds = buildUnnamed250(); | 176 o.projectIds = buildUnnamed255(); |
| 175 o.resourceNames = buildUnnamed251(); | 177 o.resourceNames = buildUnnamed256(); |
| 176 } | 178 } |
| 177 buildCounterListLogEntriesRequest--; | 179 buildCounterListLogEntriesRequest--; |
| 178 return o; | 180 return o; |
| 179 } | 181 } |
| 180 | 182 |
| 181 checkListLogEntriesRequest(api.ListLogEntriesRequest o) { | 183 checkListLogEntriesRequest(api.ListLogEntriesRequest o) { |
| 182 buildCounterListLogEntriesRequest++; | 184 buildCounterListLogEntriesRequest++; |
| 183 if (buildCounterListLogEntriesRequest < 3) { | 185 if (buildCounterListLogEntriesRequest < 3) { |
| 184 unittest.expect(o.filter, unittest.equals('foo')); | 186 unittest.expect(o.filter, unittest.equals('foo')); |
| 185 unittest.expect(o.orderBy, unittest.equals('foo')); | 187 unittest.expect(o.orderBy, unittest.equals('foo')); |
| 186 unittest.expect(o.pageSize, unittest.equals(42)); | 188 unittest.expect(o.pageSize, unittest.equals(42)); |
| 187 unittest.expect(o.pageToken, unittest.equals('foo')); | 189 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 188 checkUnnamed250(o.projectIds); | 190 checkUnnamed255(o.projectIds); |
| 189 checkUnnamed251(o.resourceNames); | 191 checkUnnamed256(o.resourceNames); |
| 190 } | 192 } |
| 191 buildCounterListLogEntriesRequest--; | 193 buildCounterListLogEntriesRequest--; |
| 192 } | 194 } |
| 193 | 195 |
| 194 buildUnnamed252() { | 196 buildUnnamed257() { |
| 195 var o = new core.List<api.LogEntry>(); | 197 var o = new core.List<api.LogEntry>(); |
| 196 o.add(buildLogEntry()); | 198 o.add(buildLogEntry()); |
| 197 o.add(buildLogEntry()); | 199 o.add(buildLogEntry()); |
| 198 return o; | 200 return o; |
| 199 } | 201 } |
| 200 | 202 |
| 201 checkUnnamed252(core.List<api.LogEntry> o) { | 203 checkUnnamed257(core.List<api.LogEntry> o) { |
| 202 unittest.expect(o, unittest.hasLength(2)); | 204 unittest.expect(o, unittest.hasLength(2)); |
| 203 checkLogEntry(o[0]); | 205 checkLogEntry(o[0]); |
| 204 checkLogEntry(o[1]); | 206 checkLogEntry(o[1]); |
| 205 } | 207 } |
| 206 | 208 |
| 207 core.int buildCounterListLogEntriesResponse = 0; | 209 core.int buildCounterListLogEntriesResponse = 0; |
| 208 buildListLogEntriesResponse() { | 210 buildListLogEntriesResponse() { |
| 209 var o = new api.ListLogEntriesResponse(); | 211 var o = new api.ListLogEntriesResponse(); |
| 210 buildCounterListLogEntriesResponse++; | 212 buildCounterListLogEntriesResponse++; |
| 211 if (buildCounterListLogEntriesResponse < 3) { | 213 if (buildCounterListLogEntriesResponse < 3) { |
| 212 o.entries = buildUnnamed252(); | 214 o.entries = buildUnnamed257(); |
| 213 o.nextPageToken = "foo"; | 215 o.nextPageToken = "foo"; |
| 214 } | 216 } |
| 215 buildCounterListLogEntriesResponse--; | 217 buildCounterListLogEntriesResponse--; |
| 216 return o; | 218 return o; |
| 217 } | 219 } |
| 218 | 220 |
| 219 checkListLogEntriesResponse(api.ListLogEntriesResponse o) { | 221 checkListLogEntriesResponse(api.ListLogEntriesResponse o) { |
| 220 buildCounterListLogEntriesResponse++; | 222 buildCounterListLogEntriesResponse++; |
| 221 if (buildCounterListLogEntriesResponse < 3) { | 223 if (buildCounterListLogEntriesResponse < 3) { |
| 222 checkUnnamed252(o.entries); | 224 checkUnnamed257(o.entries); |
| 223 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 225 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 224 } | 226 } |
| 225 buildCounterListLogEntriesResponse--; | 227 buildCounterListLogEntriesResponse--; |
| 226 } | 228 } |
| 227 | 229 |
| 228 buildUnnamed253() { | 230 buildUnnamed258() { |
| 229 var o = new core.List<api.LogMetric>(); | 231 var o = new core.List<api.LogMetric>(); |
| 230 o.add(buildLogMetric()); | 232 o.add(buildLogMetric()); |
| 231 o.add(buildLogMetric()); | 233 o.add(buildLogMetric()); |
| 232 return o; | 234 return o; |
| 233 } | 235 } |
| 234 | 236 |
| 235 checkUnnamed253(core.List<api.LogMetric> o) { | 237 checkUnnamed258(core.List<api.LogMetric> o) { |
| 236 unittest.expect(o, unittest.hasLength(2)); | 238 unittest.expect(o, unittest.hasLength(2)); |
| 237 checkLogMetric(o[0]); | 239 checkLogMetric(o[0]); |
| 238 checkLogMetric(o[1]); | 240 checkLogMetric(o[1]); |
| 239 } | 241 } |
| 240 | 242 |
| 241 core.int buildCounterListLogMetricsResponse = 0; | 243 core.int buildCounterListLogMetricsResponse = 0; |
| 242 buildListLogMetricsResponse() { | 244 buildListLogMetricsResponse() { |
| 243 var o = new api.ListLogMetricsResponse(); | 245 var o = new api.ListLogMetricsResponse(); |
| 244 buildCounterListLogMetricsResponse++; | 246 buildCounterListLogMetricsResponse++; |
| 245 if (buildCounterListLogMetricsResponse < 3) { | 247 if (buildCounterListLogMetricsResponse < 3) { |
| 246 o.metrics = buildUnnamed253(); | 248 o.metrics = buildUnnamed258(); |
| 247 o.nextPageToken = "foo"; | 249 o.nextPageToken = "foo"; |
| 248 } | 250 } |
| 249 buildCounterListLogMetricsResponse--; | 251 buildCounterListLogMetricsResponse--; |
| 250 return o; | 252 return o; |
| 251 } | 253 } |
| 252 | 254 |
| 253 checkListLogMetricsResponse(api.ListLogMetricsResponse o) { | 255 checkListLogMetricsResponse(api.ListLogMetricsResponse o) { |
| 254 buildCounterListLogMetricsResponse++; | 256 buildCounterListLogMetricsResponse++; |
| 255 if (buildCounterListLogMetricsResponse < 3) { | 257 if (buildCounterListLogMetricsResponse < 3) { |
| 256 checkUnnamed253(o.metrics); | 258 checkUnnamed258(o.metrics); |
| 257 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 259 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 258 } | 260 } |
| 259 buildCounterListLogMetricsResponse--; | 261 buildCounterListLogMetricsResponse--; |
| 260 } | 262 } |
| 261 | 263 |
| 262 buildUnnamed254() { | 264 buildUnnamed259() { |
| 263 var o = new core.List<core.String>(); | 265 var o = new core.List<core.String>(); |
| 264 o.add("foo"); | 266 o.add("foo"); |
| 265 o.add("foo"); | 267 o.add("foo"); |
| 266 return o; | 268 return o; |
| 267 } | 269 } |
| 268 | 270 |
| 269 checkUnnamed254(core.List<core.String> o) { | 271 checkUnnamed259(core.List<core.String> o) { |
| 270 unittest.expect(o, unittest.hasLength(2)); | 272 unittest.expect(o, unittest.hasLength(2)); |
| 271 unittest.expect(o[0], unittest.equals('foo')); | 273 unittest.expect(o[0], unittest.equals('foo')); |
| 272 unittest.expect(o[1], unittest.equals('foo')); | 274 unittest.expect(o[1], unittest.equals('foo')); |
| 273 } | 275 } |
| 274 | 276 |
| 275 core.int buildCounterListLogsResponse = 0; | 277 core.int buildCounterListLogsResponse = 0; |
| 276 buildListLogsResponse() { | 278 buildListLogsResponse() { |
| 277 var o = new api.ListLogsResponse(); | 279 var o = new api.ListLogsResponse(); |
| 278 buildCounterListLogsResponse++; | 280 buildCounterListLogsResponse++; |
| 279 if (buildCounterListLogsResponse < 3) { | 281 if (buildCounterListLogsResponse < 3) { |
| 280 o.logNames = buildUnnamed254(); | 282 o.logNames = buildUnnamed259(); |
| 281 o.nextPageToken = "foo"; | 283 o.nextPageToken = "foo"; |
| 282 } | 284 } |
| 283 buildCounterListLogsResponse--; | 285 buildCounterListLogsResponse--; |
| 284 return o; | 286 return o; |
| 285 } | 287 } |
| 286 | 288 |
| 287 checkListLogsResponse(api.ListLogsResponse o) { | 289 checkListLogsResponse(api.ListLogsResponse o) { |
| 288 buildCounterListLogsResponse++; | 290 buildCounterListLogsResponse++; |
| 289 if (buildCounterListLogsResponse < 3) { | 291 if (buildCounterListLogsResponse < 3) { |
| 290 checkUnnamed254(o.logNames); | 292 checkUnnamed259(o.logNames); |
| 291 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 293 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 292 } | 294 } |
| 293 buildCounterListLogsResponse--; | 295 buildCounterListLogsResponse--; |
| 294 } | 296 } |
| 295 | 297 |
| 296 buildUnnamed255() { | 298 buildUnnamed260() { |
| 297 var o = new core.List<api.MonitoredResourceDescriptor>(); | 299 var o = new core.List<api.MonitoredResourceDescriptor>(); |
| 298 o.add(buildMonitoredResourceDescriptor()); | 300 o.add(buildMonitoredResourceDescriptor()); |
| 299 o.add(buildMonitoredResourceDescriptor()); | 301 o.add(buildMonitoredResourceDescriptor()); |
| 300 return o; | 302 return o; |
| 301 } | 303 } |
| 302 | 304 |
| 303 checkUnnamed255(core.List<api.MonitoredResourceDescriptor> o) { | 305 checkUnnamed260(core.List<api.MonitoredResourceDescriptor> o) { |
| 304 unittest.expect(o, unittest.hasLength(2)); | 306 unittest.expect(o, unittest.hasLength(2)); |
| 305 checkMonitoredResourceDescriptor(o[0]); | 307 checkMonitoredResourceDescriptor(o[0]); |
| 306 checkMonitoredResourceDescriptor(o[1]); | 308 checkMonitoredResourceDescriptor(o[1]); |
| 307 } | 309 } |
| 308 | 310 |
| 309 core.int buildCounterListMonitoredResourceDescriptorsResponse = 0; | 311 core.int buildCounterListMonitoredResourceDescriptorsResponse = 0; |
| 310 buildListMonitoredResourceDescriptorsResponse() { | 312 buildListMonitoredResourceDescriptorsResponse() { |
| 311 var o = new api.ListMonitoredResourceDescriptorsResponse(); | 313 var o = new api.ListMonitoredResourceDescriptorsResponse(); |
| 312 buildCounterListMonitoredResourceDescriptorsResponse++; | 314 buildCounterListMonitoredResourceDescriptorsResponse++; |
| 313 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { | 315 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { |
| 314 o.nextPageToken = "foo"; | 316 o.nextPageToken = "foo"; |
| 315 o.resourceDescriptors = buildUnnamed255(); | 317 o.resourceDescriptors = buildUnnamed260(); |
| 316 } | 318 } |
| 317 buildCounterListMonitoredResourceDescriptorsResponse--; | 319 buildCounterListMonitoredResourceDescriptorsResponse--; |
| 318 return o; | 320 return o; |
| 319 } | 321 } |
| 320 | 322 |
| 321 checkListMonitoredResourceDescriptorsResponse(api.ListMonitoredResourceDescripto
rsResponse o) { | 323 checkListMonitoredResourceDescriptorsResponse(api.ListMonitoredResourceDescripto
rsResponse o) { |
| 322 buildCounterListMonitoredResourceDescriptorsResponse++; | 324 buildCounterListMonitoredResourceDescriptorsResponse++; |
| 323 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { | 325 if (buildCounterListMonitoredResourceDescriptorsResponse < 3) { |
| 324 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 326 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 325 checkUnnamed255(o.resourceDescriptors); | 327 checkUnnamed260(o.resourceDescriptors); |
| 326 } | 328 } |
| 327 buildCounterListMonitoredResourceDescriptorsResponse--; | 329 buildCounterListMonitoredResourceDescriptorsResponse--; |
| 328 } | 330 } |
| 329 | 331 |
| 330 buildUnnamed256() { | 332 buildUnnamed261() { |
| 331 var o = new core.List<api.LogSink>(); | 333 var o = new core.List<api.LogSink>(); |
| 332 o.add(buildLogSink()); | 334 o.add(buildLogSink()); |
| 333 o.add(buildLogSink()); | 335 o.add(buildLogSink()); |
| 334 return o; | 336 return o; |
| 335 } | 337 } |
| 336 | 338 |
| 337 checkUnnamed256(core.List<api.LogSink> o) { | 339 checkUnnamed261(core.List<api.LogSink> o) { |
| 338 unittest.expect(o, unittest.hasLength(2)); | 340 unittest.expect(o, unittest.hasLength(2)); |
| 339 checkLogSink(o[0]); | 341 checkLogSink(o[0]); |
| 340 checkLogSink(o[1]); | 342 checkLogSink(o[1]); |
| 341 } | 343 } |
| 342 | 344 |
| 343 core.int buildCounterListSinksResponse = 0; | 345 core.int buildCounterListSinksResponse = 0; |
| 344 buildListSinksResponse() { | 346 buildListSinksResponse() { |
| 345 var o = new api.ListSinksResponse(); | 347 var o = new api.ListSinksResponse(); |
| 346 buildCounterListSinksResponse++; | 348 buildCounterListSinksResponse++; |
| 347 if (buildCounterListSinksResponse < 3) { | 349 if (buildCounterListSinksResponse < 3) { |
| 348 o.nextPageToken = "foo"; | 350 o.nextPageToken = "foo"; |
| 349 o.sinks = buildUnnamed256(); | 351 o.sinks = buildUnnamed261(); |
| 350 } | 352 } |
| 351 buildCounterListSinksResponse--; | 353 buildCounterListSinksResponse--; |
| 352 return o; | 354 return o; |
| 353 } | 355 } |
| 354 | 356 |
| 355 checkListSinksResponse(api.ListSinksResponse o) { | 357 checkListSinksResponse(api.ListSinksResponse o) { |
| 356 buildCounterListSinksResponse++; | 358 buildCounterListSinksResponse++; |
| 357 if (buildCounterListSinksResponse < 3) { | 359 if (buildCounterListSinksResponse < 3) { |
| 358 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 360 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 359 checkUnnamed256(o.sinks); | 361 checkUnnamed261(o.sinks); |
| 360 } | 362 } |
| 361 buildCounterListSinksResponse--; | 363 buildCounterListSinksResponse--; |
| 362 } | 364 } |
| 363 | 365 |
| 364 buildUnnamed257() { | 366 buildUnnamed262() { |
| 365 var o = new core.Map<core.String, core.Object>(); | 367 var o = new core.Map<core.String, core.Object>(); |
| 366 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 368 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 367 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 369 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 368 return o; | 370 return o; |
| 369 } | 371 } |
| 370 | 372 |
| 371 checkUnnamed257(core.Map<core.String, core.Object> o) { | 373 checkUnnamed262(core.Map<core.String, core.Object> o) { |
| 372 unittest.expect(o, unittest.hasLength(2)); | 374 unittest.expect(o, unittest.hasLength(2)); |
| 373 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 375 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
| 374 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 376 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
| 375 } | 377 } |
| 376 | 378 |
| 377 buildUnnamed258() { | 379 buildUnnamed263() { |
| 378 var o = new core.Map<core.String, core.String>(); | 380 var o = new core.Map<core.String, core.String>(); |
| 379 o["x"] = "foo"; | 381 o["x"] = "foo"; |
| 380 o["y"] = "foo"; | 382 o["y"] = "foo"; |
| 381 return o; | 383 return o; |
| 382 } | 384 } |
| 383 | 385 |
| 384 checkUnnamed258(core.Map<core.String, core.String> o) { | 386 checkUnnamed263(core.Map<core.String, core.String> o) { |
| 385 unittest.expect(o, unittest.hasLength(2)); | 387 unittest.expect(o, unittest.hasLength(2)); |
| 386 unittest.expect(o["x"], unittest.equals('foo')); | 388 unittest.expect(o["x"], unittest.equals('foo')); |
| 387 unittest.expect(o["y"], unittest.equals('foo')); | 389 unittest.expect(o["y"], unittest.equals('foo')); |
| 388 } | 390 } |
| 389 | 391 |
| 390 buildUnnamed259() { | 392 buildUnnamed264() { |
| 391 var o = new core.Map<core.String, core.Object>(); | 393 var o = new core.Map<core.String, core.Object>(); |
| 392 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 394 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 393 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 395 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 394 return o; | 396 return o; |
| 395 } | 397 } |
| 396 | 398 |
| 397 checkUnnamed259(core.Map<core.String, core.Object> o) { | 399 checkUnnamed264(core.Map<core.String, core.Object> o) { |
| 398 unittest.expect(o, unittest.hasLength(2)); | 400 unittest.expect(o, unittest.hasLength(2)); |
| 399 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 401 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
| 400 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 402 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
| 401 } | 403 } |
| 402 | 404 |
| 403 core.int buildCounterLogEntry = 0; | 405 core.int buildCounterLogEntry = 0; |
| 404 buildLogEntry() { | 406 buildLogEntry() { |
| 405 var o = new api.LogEntry(); | 407 var o = new api.LogEntry(); |
| 406 buildCounterLogEntry++; | 408 buildCounterLogEntry++; |
| 407 if (buildCounterLogEntry < 3) { | 409 if (buildCounterLogEntry < 3) { |
| 408 o.httpRequest = buildHttpRequest(); | 410 o.httpRequest = buildHttpRequest(); |
| 409 o.insertId = "foo"; | 411 o.insertId = "foo"; |
| 410 o.jsonPayload = buildUnnamed257(); | 412 o.jsonPayload = buildUnnamed262(); |
| 411 o.labels = buildUnnamed258(); | 413 o.labels = buildUnnamed263(); |
| 412 o.logName = "foo"; | 414 o.logName = "foo"; |
| 413 o.operation = buildLogEntryOperation(); | 415 o.operation = buildLogEntryOperation(); |
| 414 o.protoPayload = buildUnnamed259(); | 416 o.protoPayload = buildUnnamed264(); |
| 415 o.receiveTimestamp = "foo"; | 417 o.receiveTimestamp = "foo"; |
| 416 o.resource = buildMonitoredResource(); | 418 o.resource = buildMonitoredResource(); |
| 417 o.severity = "foo"; | 419 o.severity = "foo"; |
| 418 o.sourceLocation = buildLogEntrySourceLocation(); | 420 o.sourceLocation = buildLogEntrySourceLocation(); |
| 419 o.textPayload = "foo"; | 421 o.textPayload = "foo"; |
| 420 o.timestamp = "foo"; | 422 o.timestamp = "foo"; |
| 421 o.trace = "foo"; | 423 o.trace = "foo"; |
| 422 } | 424 } |
| 423 buildCounterLogEntry--; | 425 buildCounterLogEntry--; |
| 424 return o; | 426 return o; |
| 425 } | 427 } |
| 426 | 428 |
| 427 checkLogEntry(api.LogEntry o) { | 429 checkLogEntry(api.LogEntry o) { |
| 428 buildCounterLogEntry++; | 430 buildCounterLogEntry++; |
| 429 if (buildCounterLogEntry < 3) { | 431 if (buildCounterLogEntry < 3) { |
| 430 checkHttpRequest(o.httpRequest); | 432 checkHttpRequest(o.httpRequest); |
| 431 unittest.expect(o.insertId, unittest.equals('foo')); | 433 unittest.expect(o.insertId, unittest.equals('foo')); |
| 432 checkUnnamed257(o.jsonPayload); | 434 checkUnnamed262(o.jsonPayload); |
| 433 checkUnnamed258(o.labels); | 435 checkUnnamed263(o.labels); |
| 434 unittest.expect(o.logName, unittest.equals('foo')); | 436 unittest.expect(o.logName, unittest.equals('foo')); |
| 435 checkLogEntryOperation(o.operation); | 437 checkLogEntryOperation(o.operation); |
| 436 checkUnnamed259(o.protoPayload); | 438 checkUnnamed264(o.protoPayload); |
| 437 unittest.expect(o.receiveTimestamp, unittest.equals('foo')); | 439 unittest.expect(o.receiveTimestamp, unittest.equals('foo')); |
| 438 checkMonitoredResource(o.resource); | 440 checkMonitoredResource(o.resource); |
| 439 unittest.expect(o.severity, unittest.equals('foo')); | 441 unittest.expect(o.severity, unittest.equals('foo')); |
| 440 checkLogEntrySourceLocation(o.sourceLocation); | 442 checkLogEntrySourceLocation(o.sourceLocation); |
| 441 unittest.expect(o.textPayload, unittest.equals('foo')); | 443 unittest.expect(o.textPayload, unittest.equals('foo')); |
| 442 unittest.expect(o.timestamp, unittest.equals('foo')); | 444 unittest.expect(o.timestamp, unittest.equals('foo')); |
| 443 unittest.expect(o.trace, unittest.equals('foo')); | 445 unittest.expect(o.trace, unittest.equals('foo')); |
| 444 } | 446 } |
| 445 buildCounterLogEntry--; | 447 buildCounterLogEntry--; |
| 446 } | 448 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 unittest.expect(o.filter, unittest.equals('foo')); | 571 unittest.expect(o.filter, unittest.equals('foo')); |
| 570 unittest.expect(o.includeChildren, unittest.isTrue); | 572 unittest.expect(o.includeChildren, unittest.isTrue); |
| 571 unittest.expect(o.name, unittest.equals('foo')); | 573 unittest.expect(o.name, unittest.equals('foo')); |
| 572 unittest.expect(o.outputVersionFormat, unittest.equals('foo')); | 574 unittest.expect(o.outputVersionFormat, unittest.equals('foo')); |
| 573 unittest.expect(o.startTime, unittest.equals('foo')); | 575 unittest.expect(o.startTime, unittest.equals('foo')); |
| 574 unittest.expect(o.writerIdentity, unittest.equals('foo')); | 576 unittest.expect(o.writerIdentity, unittest.equals('foo')); |
| 575 } | 577 } |
| 576 buildCounterLogSink--; | 578 buildCounterLogSink--; |
| 577 } | 579 } |
| 578 | 580 |
| 579 buildUnnamed260() { | 581 buildUnnamed265() { |
| 580 var o = new core.Map<core.String, core.String>(); | 582 var o = new core.Map<core.String, core.String>(); |
| 581 o["x"] = "foo"; | 583 o["x"] = "foo"; |
| 582 o["y"] = "foo"; | 584 o["y"] = "foo"; |
| 583 return o; | 585 return o; |
| 584 } | 586 } |
| 585 | 587 |
| 586 checkUnnamed260(core.Map<core.String, core.String> o) { | 588 checkUnnamed265(core.Map<core.String, core.String> o) { |
| 587 unittest.expect(o, unittest.hasLength(2)); | 589 unittest.expect(o, unittest.hasLength(2)); |
| 588 unittest.expect(o["x"], unittest.equals('foo')); | 590 unittest.expect(o["x"], unittest.equals('foo')); |
| 589 unittest.expect(o["y"], unittest.equals('foo')); | 591 unittest.expect(o["y"], unittest.equals('foo')); |
| 590 } | 592 } |
| 591 | 593 |
| 592 core.int buildCounterMonitoredResource = 0; | 594 core.int buildCounterMonitoredResource = 0; |
| 593 buildMonitoredResource() { | 595 buildMonitoredResource() { |
| 594 var o = new api.MonitoredResource(); | 596 var o = new api.MonitoredResource(); |
| 595 buildCounterMonitoredResource++; | 597 buildCounterMonitoredResource++; |
| 596 if (buildCounterMonitoredResource < 3) { | 598 if (buildCounterMonitoredResource < 3) { |
| 597 o.labels = buildUnnamed260(); | 599 o.labels = buildUnnamed265(); |
| 598 o.type = "foo"; | 600 o.type = "foo"; |
| 599 } | 601 } |
| 600 buildCounterMonitoredResource--; | 602 buildCounterMonitoredResource--; |
| 601 return o; | 603 return o; |
| 602 } | 604 } |
| 603 | 605 |
| 604 checkMonitoredResource(api.MonitoredResource o) { | 606 checkMonitoredResource(api.MonitoredResource o) { |
| 605 buildCounterMonitoredResource++; | 607 buildCounterMonitoredResource++; |
| 606 if (buildCounterMonitoredResource < 3) { | 608 if (buildCounterMonitoredResource < 3) { |
| 607 checkUnnamed260(o.labels); | 609 checkUnnamed265(o.labels); |
| 608 unittest.expect(o.type, unittest.equals('foo')); | 610 unittest.expect(o.type, unittest.equals('foo')); |
| 609 } | 611 } |
| 610 buildCounterMonitoredResource--; | 612 buildCounterMonitoredResource--; |
| 611 } | 613 } |
| 612 | 614 |
| 613 buildUnnamed261() { | 615 buildUnnamed266() { |
| 614 var o = new core.List<api.LabelDescriptor>(); | 616 var o = new core.List<api.LabelDescriptor>(); |
| 615 o.add(buildLabelDescriptor()); | 617 o.add(buildLabelDescriptor()); |
| 616 o.add(buildLabelDescriptor()); | 618 o.add(buildLabelDescriptor()); |
| 617 return o; | 619 return o; |
| 618 } | 620 } |
| 619 | 621 |
| 620 checkUnnamed261(core.List<api.LabelDescriptor> o) { | 622 checkUnnamed266(core.List<api.LabelDescriptor> o) { |
| 621 unittest.expect(o, unittest.hasLength(2)); | 623 unittest.expect(o, unittest.hasLength(2)); |
| 622 checkLabelDescriptor(o[0]); | 624 checkLabelDescriptor(o[0]); |
| 623 checkLabelDescriptor(o[1]); | 625 checkLabelDescriptor(o[1]); |
| 624 } | 626 } |
| 625 | 627 |
| 626 core.int buildCounterMonitoredResourceDescriptor = 0; | 628 core.int buildCounterMonitoredResourceDescriptor = 0; |
| 627 buildMonitoredResourceDescriptor() { | 629 buildMonitoredResourceDescriptor() { |
| 628 var o = new api.MonitoredResourceDescriptor(); | 630 var o = new api.MonitoredResourceDescriptor(); |
| 629 buildCounterMonitoredResourceDescriptor++; | 631 buildCounterMonitoredResourceDescriptor++; |
| 630 if (buildCounterMonitoredResourceDescriptor < 3) { | 632 if (buildCounterMonitoredResourceDescriptor < 3) { |
| 631 o.description = "foo"; | 633 o.description = "foo"; |
| 632 o.displayName = "foo"; | 634 o.displayName = "foo"; |
| 633 o.labels = buildUnnamed261(); | 635 o.labels = buildUnnamed266(); |
| 634 o.name = "foo"; | 636 o.name = "foo"; |
| 635 o.type = "foo"; | 637 o.type = "foo"; |
| 636 } | 638 } |
| 637 buildCounterMonitoredResourceDescriptor--; | 639 buildCounterMonitoredResourceDescriptor--; |
| 638 return o; | 640 return o; |
| 639 } | 641 } |
| 640 | 642 |
| 641 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { | 643 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { |
| 642 buildCounterMonitoredResourceDescriptor++; | 644 buildCounterMonitoredResourceDescriptor++; |
| 643 if (buildCounterMonitoredResourceDescriptor < 3) { | 645 if (buildCounterMonitoredResourceDescriptor < 3) { |
| 644 unittest.expect(o.description, unittest.equals('foo')); | 646 unittest.expect(o.description, unittest.equals('foo')); |
| 645 unittest.expect(o.displayName, unittest.equals('foo')); | 647 unittest.expect(o.displayName, unittest.equals('foo')); |
| 646 checkUnnamed261(o.labels); | 648 checkUnnamed266(o.labels); |
| 647 unittest.expect(o.name, unittest.equals('foo')); | 649 unittest.expect(o.name, unittest.equals('foo')); |
| 648 unittest.expect(o.type, unittest.equals('foo')); | 650 unittest.expect(o.type, unittest.equals('foo')); |
| 649 } | 651 } |
| 650 buildCounterMonitoredResourceDescriptor--; | 652 buildCounterMonitoredResourceDescriptor--; |
| 651 } | 653 } |
| 652 | 654 |
| 653 buildUnnamed262() { | 655 buildUnnamed267() { |
| 654 var o = new core.List<api.LogLine>(); | 656 var o = new core.List<api.LogLine>(); |
| 655 o.add(buildLogLine()); | 657 o.add(buildLogLine()); |
| 656 o.add(buildLogLine()); | 658 o.add(buildLogLine()); |
| 657 return o; | 659 return o; |
| 658 } | 660 } |
| 659 | 661 |
| 660 checkUnnamed262(core.List<api.LogLine> o) { | 662 checkUnnamed267(core.List<api.LogLine> o) { |
| 661 unittest.expect(o, unittest.hasLength(2)); | 663 unittest.expect(o, unittest.hasLength(2)); |
| 662 checkLogLine(o[0]); | 664 checkLogLine(o[0]); |
| 663 checkLogLine(o[1]); | 665 checkLogLine(o[1]); |
| 664 } | 666 } |
| 665 | 667 |
| 666 buildUnnamed263() { | 668 buildUnnamed268() { |
| 667 var o = new core.List<api.SourceReference>(); | 669 var o = new core.List<api.SourceReference>(); |
| 668 o.add(buildSourceReference()); | 670 o.add(buildSourceReference()); |
| 669 o.add(buildSourceReference()); | 671 o.add(buildSourceReference()); |
| 670 return o; | 672 return o; |
| 671 } | 673 } |
| 672 | 674 |
| 673 checkUnnamed263(core.List<api.SourceReference> o) { | 675 checkUnnamed268(core.List<api.SourceReference> o) { |
| 674 unittest.expect(o, unittest.hasLength(2)); | 676 unittest.expect(o, unittest.hasLength(2)); |
| 675 checkSourceReference(o[0]); | 677 checkSourceReference(o[0]); |
| 676 checkSourceReference(o[1]); | 678 checkSourceReference(o[1]); |
| 677 } | 679 } |
| 678 | 680 |
| 679 core.int buildCounterRequestLog = 0; | 681 core.int buildCounterRequestLog = 0; |
| 680 buildRequestLog() { | 682 buildRequestLog() { |
| 681 var o = new api.RequestLog(); | 683 var o = new api.RequestLog(); |
| 682 buildCounterRequestLog++; | 684 buildCounterRequestLog++; |
| 683 if (buildCounterRequestLog < 3) { | 685 if (buildCounterRequestLog < 3) { |
| 684 o.appEngineRelease = "foo"; | 686 o.appEngineRelease = "foo"; |
| 685 o.appId = "foo"; | 687 o.appId = "foo"; |
| 686 o.cost = 42.0; | 688 o.cost = 42.0; |
| 687 o.endTime = "foo"; | 689 o.endTime = "foo"; |
| 688 o.finished = true; | 690 o.finished = true; |
| 689 o.first = true; | 691 o.first = true; |
| 690 o.host = "foo"; | 692 o.host = "foo"; |
| 691 o.httpVersion = "foo"; | 693 o.httpVersion = "foo"; |
| 692 o.instanceId = "foo"; | 694 o.instanceId = "foo"; |
| 693 o.instanceIndex = 42; | 695 o.instanceIndex = 42; |
| 694 o.ip = "foo"; | 696 o.ip = "foo"; |
| 695 o.latency = "foo"; | 697 o.latency = "foo"; |
| 696 o.line = buildUnnamed262(); | 698 o.line = buildUnnamed267(); |
| 697 o.megaCycles = "foo"; | 699 o.megaCycles = "foo"; |
| 698 o.method = "foo"; | 700 o.method = "foo"; |
| 699 o.moduleId = "foo"; | 701 o.moduleId = "foo"; |
| 700 o.nickname = "foo"; | 702 o.nickname = "foo"; |
| 701 o.pendingTime = "foo"; | 703 o.pendingTime = "foo"; |
| 702 o.referrer = "foo"; | 704 o.referrer = "foo"; |
| 703 o.requestId = "foo"; | 705 o.requestId = "foo"; |
| 704 o.resource = "foo"; | 706 o.resource = "foo"; |
| 705 o.responseSize = "foo"; | 707 o.responseSize = "foo"; |
| 706 o.sourceReference = buildUnnamed263(); | 708 o.sourceReference = buildUnnamed268(); |
| 707 o.startTime = "foo"; | 709 o.startTime = "foo"; |
| 708 o.status = 42; | 710 o.status = 42; |
| 709 o.taskName = "foo"; | 711 o.taskName = "foo"; |
| 710 o.taskQueueName = "foo"; | 712 o.taskQueueName = "foo"; |
| 711 o.traceId = "foo"; | 713 o.traceId = "foo"; |
| 712 o.urlMapEntry = "foo"; | 714 o.urlMapEntry = "foo"; |
| 713 o.userAgent = "foo"; | 715 o.userAgent = "foo"; |
| 714 o.versionId = "foo"; | 716 o.versionId = "foo"; |
| 715 o.wasLoadingRequest = true; | 717 o.wasLoadingRequest = true; |
| 716 } | 718 } |
| 717 buildCounterRequestLog--; | 719 buildCounterRequestLog--; |
| 718 return o; | 720 return o; |
| 719 } | 721 } |
| 720 | 722 |
| 721 checkRequestLog(api.RequestLog o) { | 723 checkRequestLog(api.RequestLog o) { |
| 722 buildCounterRequestLog++; | 724 buildCounterRequestLog++; |
| 723 if (buildCounterRequestLog < 3) { | 725 if (buildCounterRequestLog < 3) { |
| 724 unittest.expect(o.appEngineRelease, unittest.equals('foo')); | 726 unittest.expect(o.appEngineRelease, unittest.equals('foo')); |
| 725 unittest.expect(o.appId, unittest.equals('foo')); | 727 unittest.expect(o.appId, unittest.equals('foo')); |
| 726 unittest.expect(o.cost, unittest.equals(42.0)); | 728 unittest.expect(o.cost, unittest.equals(42.0)); |
| 727 unittest.expect(o.endTime, unittest.equals('foo')); | 729 unittest.expect(o.endTime, unittest.equals('foo')); |
| 728 unittest.expect(o.finished, unittest.isTrue); | 730 unittest.expect(o.finished, unittest.isTrue); |
| 729 unittest.expect(o.first, unittest.isTrue); | 731 unittest.expect(o.first, unittest.isTrue); |
| 730 unittest.expect(o.host, unittest.equals('foo')); | 732 unittest.expect(o.host, unittest.equals('foo')); |
| 731 unittest.expect(o.httpVersion, unittest.equals('foo')); | 733 unittest.expect(o.httpVersion, unittest.equals('foo')); |
| 732 unittest.expect(o.instanceId, unittest.equals('foo')); | 734 unittest.expect(o.instanceId, unittest.equals('foo')); |
| 733 unittest.expect(o.instanceIndex, unittest.equals(42)); | 735 unittest.expect(o.instanceIndex, unittest.equals(42)); |
| 734 unittest.expect(o.ip, unittest.equals('foo')); | 736 unittest.expect(o.ip, unittest.equals('foo')); |
| 735 unittest.expect(o.latency, unittest.equals('foo')); | 737 unittest.expect(o.latency, unittest.equals('foo')); |
| 736 checkUnnamed262(o.line); | 738 checkUnnamed267(o.line); |
| 737 unittest.expect(o.megaCycles, unittest.equals('foo')); | 739 unittest.expect(o.megaCycles, unittest.equals('foo')); |
| 738 unittest.expect(o.method, unittest.equals('foo')); | 740 unittest.expect(o.method, unittest.equals('foo')); |
| 739 unittest.expect(o.moduleId, unittest.equals('foo')); | 741 unittest.expect(o.moduleId, unittest.equals('foo')); |
| 740 unittest.expect(o.nickname, unittest.equals('foo')); | 742 unittest.expect(o.nickname, unittest.equals('foo')); |
| 741 unittest.expect(o.pendingTime, unittest.equals('foo')); | 743 unittest.expect(o.pendingTime, unittest.equals('foo')); |
| 742 unittest.expect(o.referrer, unittest.equals('foo')); | 744 unittest.expect(o.referrer, unittest.equals('foo')); |
| 743 unittest.expect(o.requestId, unittest.equals('foo')); | 745 unittest.expect(o.requestId, unittest.equals('foo')); |
| 744 unittest.expect(o.resource, unittest.equals('foo')); | 746 unittest.expect(o.resource, unittest.equals('foo')); |
| 745 unittest.expect(o.responseSize, unittest.equals('foo')); | 747 unittest.expect(o.responseSize, unittest.equals('foo')); |
| 746 checkUnnamed263(o.sourceReference); | 748 checkUnnamed268(o.sourceReference); |
| 747 unittest.expect(o.startTime, unittest.equals('foo')); | 749 unittest.expect(o.startTime, unittest.equals('foo')); |
| 748 unittest.expect(o.status, unittest.equals(42)); | 750 unittest.expect(o.status, unittest.equals(42)); |
| 749 unittest.expect(o.taskName, unittest.equals('foo')); | 751 unittest.expect(o.taskName, unittest.equals('foo')); |
| 750 unittest.expect(o.taskQueueName, unittest.equals('foo')); | 752 unittest.expect(o.taskQueueName, unittest.equals('foo')); |
| 751 unittest.expect(o.traceId, unittest.equals('foo')); | 753 unittest.expect(o.traceId, unittest.equals('foo')); |
| 752 unittest.expect(o.urlMapEntry, unittest.equals('foo')); | 754 unittest.expect(o.urlMapEntry, unittest.equals('foo')); |
| 753 unittest.expect(o.userAgent, unittest.equals('foo')); | 755 unittest.expect(o.userAgent, unittest.equals('foo')); |
| 754 unittest.expect(o.versionId, unittest.equals('foo')); | 756 unittest.expect(o.versionId, unittest.equals('foo')); |
| 755 unittest.expect(o.wasLoadingRequest, unittest.isTrue); | 757 unittest.expect(o.wasLoadingRequest, unittest.isTrue); |
| 756 } | 758 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 | 796 |
| 795 checkSourceReference(api.SourceReference o) { | 797 checkSourceReference(api.SourceReference o) { |
| 796 buildCounterSourceReference++; | 798 buildCounterSourceReference++; |
| 797 if (buildCounterSourceReference < 3) { | 799 if (buildCounterSourceReference < 3) { |
| 798 unittest.expect(o.repository, unittest.equals('foo')); | 800 unittest.expect(o.repository, unittest.equals('foo')); |
| 799 unittest.expect(o.revisionId, unittest.equals('foo')); | 801 unittest.expect(o.revisionId, unittest.equals('foo')); |
| 800 } | 802 } |
| 801 buildCounterSourceReference--; | 803 buildCounterSourceReference--; |
| 802 } | 804 } |
| 803 | 805 |
| 804 buildUnnamed264() { | 806 buildUnnamed269() { |
| 805 var o = new core.List<api.LogEntry>(); | 807 var o = new core.List<api.LogEntry>(); |
| 806 o.add(buildLogEntry()); | 808 o.add(buildLogEntry()); |
| 807 o.add(buildLogEntry()); | 809 o.add(buildLogEntry()); |
| 808 return o; | 810 return o; |
| 809 } | 811 } |
| 810 | 812 |
| 811 checkUnnamed264(core.List<api.LogEntry> o) { | 813 checkUnnamed269(core.List<api.LogEntry> o) { |
| 812 unittest.expect(o, unittest.hasLength(2)); | 814 unittest.expect(o, unittest.hasLength(2)); |
| 813 checkLogEntry(o[0]); | 815 checkLogEntry(o[0]); |
| 814 checkLogEntry(o[1]); | 816 checkLogEntry(o[1]); |
| 815 } | 817 } |
| 816 | 818 |
| 817 buildUnnamed265() { | 819 buildUnnamed270() { |
| 818 var o = new core.Map<core.String, core.String>(); | 820 var o = new core.Map<core.String, core.String>(); |
| 819 o["x"] = "foo"; | 821 o["x"] = "foo"; |
| 820 o["y"] = "foo"; | 822 o["y"] = "foo"; |
| 821 return o; | 823 return o; |
| 822 } | 824 } |
| 823 | 825 |
| 824 checkUnnamed265(core.Map<core.String, core.String> o) { | 826 checkUnnamed270(core.Map<core.String, core.String> o) { |
| 825 unittest.expect(o, unittest.hasLength(2)); | 827 unittest.expect(o, unittest.hasLength(2)); |
| 826 unittest.expect(o["x"], unittest.equals('foo')); | 828 unittest.expect(o["x"], unittest.equals('foo')); |
| 827 unittest.expect(o["y"], unittest.equals('foo')); | 829 unittest.expect(o["y"], unittest.equals('foo')); |
| 828 } | 830 } |
| 829 | 831 |
| 830 core.int buildCounterWriteLogEntriesRequest = 0; | 832 core.int buildCounterWriteLogEntriesRequest = 0; |
| 831 buildWriteLogEntriesRequest() { | 833 buildWriteLogEntriesRequest() { |
| 832 var o = new api.WriteLogEntriesRequest(); | 834 var o = new api.WriteLogEntriesRequest(); |
| 833 buildCounterWriteLogEntriesRequest++; | 835 buildCounterWriteLogEntriesRequest++; |
| 834 if (buildCounterWriteLogEntriesRequest < 3) { | 836 if (buildCounterWriteLogEntriesRequest < 3) { |
| 835 o.entries = buildUnnamed264(); | 837 o.entries = buildUnnamed269(); |
| 836 o.labels = buildUnnamed265(); | 838 o.labels = buildUnnamed270(); |
| 837 o.logName = "foo"; | 839 o.logName = "foo"; |
| 838 o.partialSuccess = true; | 840 o.partialSuccess = true; |
| 839 o.resource = buildMonitoredResource(); | 841 o.resource = buildMonitoredResource(); |
| 840 } | 842 } |
| 841 buildCounterWriteLogEntriesRequest--; | 843 buildCounterWriteLogEntriesRequest--; |
| 842 return o; | 844 return o; |
| 843 } | 845 } |
| 844 | 846 |
| 845 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { | 847 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { |
| 846 buildCounterWriteLogEntriesRequest++; | 848 buildCounterWriteLogEntriesRequest++; |
| 847 if (buildCounterWriteLogEntriesRequest < 3) { | 849 if (buildCounterWriteLogEntriesRequest < 3) { |
| 848 checkUnnamed264(o.entries); | 850 checkUnnamed269(o.entries); |
| 849 checkUnnamed265(o.labels); | 851 checkUnnamed270(o.labels); |
| 850 unittest.expect(o.logName, unittest.equals('foo')); | 852 unittest.expect(o.logName, unittest.equals('foo')); |
| 851 unittest.expect(o.partialSuccess, unittest.isTrue); | 853 unittest.expect(o.partialSuccess, unittest.isTrue); |
| 852 checkMonitoredResource(o.resource); | 854 checkMonitoredResource(o.resource); |
| 853 } | 855 } |
| 854 buildCounterWriteLogEntriesRequest--; | 856 buildCounterWriteLogEntriesRequest--; |
| 855 } | 857 } |
| 856 | 858 |
| 857 core.int buildCounterWriteLogEntriesResponse = 0; | 859 core.int buildCounterWriteLogEntriesResponse = 0; |
| 858 buildWriteLogEntriesResponse() { | 860 buildWriteLogEntriesResponse() { |
| 859 var o = new api.WriteLogEntriesResponse(); | 861 var o = new api.WriteLogEntriesResponse(); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 res.delete(arg_logName).then(unittest.expectAsync1(((api.Empty response) { | 1117 res.delete(arg_logName).then(unittest.expectAsync1(((api.Empty response) { |
| 1116 checkEmpty(response); | 1118 checkEmpty(response); |
| 1117 }))); | 1119 }))); |
| 1118 }); | 1120 }); |
| 1119 | 1121 |
| 1120 unittest.test("method--list", () { | 1122 unittest.test("method--list", () { |
| 1121 | 1123 |
| 1122 var mock = new HttpServerMock(); | 1124 var mock = new HttpServerMock(); |
| 1123 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; | 1125 api.BillingAccountsLogsResourceApi res = new api.LoggingApi(mock).billingA
ccounts.logs; |
| 1124 var arg_parent = "foo"; | 1126 var arg_parent = "foo"; |
| 1127 var arg_pageToken = "foo"; |
| 1125 var arg_pageSize = 42; | 1128 var arg_pageSize = 42; |
| 1126 var arg_pageToken = "foo"; | |
| 1127 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1129 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1128 var path = (req.url).path; | 1130 var path = (req.url).path; |
| 1129 var pathOffset = 0; | 1131 var pathOffset = 0; |
| 1130 var index; | 1132 var index; |
| 1131 var subPart; | 1133 var subPart; |
| 1132 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1134 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1133 pathOffset += 1; | 1135 pathOffset += 1; |
| 1134 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1136 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1135 pathOffset += 3; | 1137 pathOffset += 3; |
| 1136 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1138 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1137 | 1139 |
| 1138 var query = (req.url).query; | 1140 var query = (req.url).query; |
| 1139 var queryOffset = 0; | 1141 var queryOffset = 0; |
| 1140 var queryMap = {}; | 1142 var queryMap = {}; |
| 1141 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1143 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1142 parseBool(n) { | 1144 parseBool(n) { |
| 1143 if (n == "true") return true; | 1145 if (n == "true") return true; |
| 1144 if (n == "false") return false; | 1146 if (n == "false") return false; |
| 1145 if (n == null) return null; | 1147 if (n == null) return null; |
| 1146 throw new core.ArgumentError("Invalid boolean: $n"); | 1148 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1147 } | 1149 } |
| 1148 if (query.length > 0) { | 1150 if (query.length > 0) { |
| 1149 for (var part in query.split("&")) { | 1151 for (var part in query.split("&")) { |
| 1150 var keyvalue = part.split("="); | 1152 var keyvalue = part.split("="); |
| 1151 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1153 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1152 } | 1154 } |
| 1153 } | 1155 } |
| 1156 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1154 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1157 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1155 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1156 | 1158 |
| 1157 | 1159 |
| 1158 var h = { | 1160 var h = { |
| 1159 "content-type" : "application/json; charset=utf-8", | 1161 "content-type" : "application/json; charset=utf-8", |
| 1160 }; | 1162 }; |
| 1161 var resp = convert.JSON.encode(buildListLogsResponse()); | 1163 var resp = convert.JSON.encode(buildListLogsResponse()); |
| 1162 return new async.Future.value(stringResponse(200, h, resp)); | 1164 return new async.Future.value(stringResponse(200, h, resp)); |
| 1163 }), true); | 1165 }), true); |
| 1164 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListLogsResponse response) { | 1166 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListLogsResponse response) { |
| 1165 checkListLogsResponse(response); | 1167 checkListLogsResponse(response); |
| 1166 }))); | 1168 }))); |
| 1167 }); | 1169 }); |
| 1168 | 1170 |
| 1169 }); | 1171 }); |
| 1170 | 1172 |
| 1171 | 1173 |
| 1172 unittest.group("resource-BillingAccountsSinksResourceApi", () { | 1174 unittest.group("resource-BillingAccountsSinksResourceApi", () { |
| 1173 unittest.test("method--create", () { | 1175 unittest.test("method--create", () { |
| 1174 | 1176 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { | 1311 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { |
| 1310 checkLogSink(response); | 1312 checkLogSink(response); |
| 1311 }))); | 1313 }))); |
| 1312 }); | 1314 }); |
| 1313 | 1315 |
| 1314 unittest.test("method--list", () { | 1316 unittest.test("method--list", () { |
| 1315 | 1317 |
| 1316 var mock = new HttpServerMock(); | 1318 var mock = new HttpServerMock(); |
| 1317 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1319 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
| 1318 var arg_parent = "foo"; | 1320 var arg_parent = "foo"; |
| 1321 var arg_pageToken = "foo"; |
| 1319 var arg_pageSize = 42; | 1322 var arg_pageSize = 42; |
| 1320 var arg_pageToken = "foo"; | |
| 1321 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1323 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1322 var path = (req.url).path; | 1324 var path = (req.url).path; |
| 1323 var pathOffset = 0; | 1325 var pathOffset = 0; |
| 1324 var index; | 1326 var index; |
| 1325 var subPart; | 1327 var subPart; |
| 1326 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1328 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1327 pathOffset += 1; | 1329 pathOffset += 1; |
| 1328 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1330 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1329 pathOffset += 3; | 1331 pathOffset += 3; |
| 1330 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1332 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1331 | 1333 |
| 1332 var query = (req.url).query; | 1334 var query = (req.url).query; |
| 1333 var queryOffset = 0; | 1335 var queryOffset = 0; |
| 1334 var queryMap = {}; | 1336 var queryMap = {}; |
| 1335 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1337 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1336 parseBool(n) { | 1338 parseBool(n) { |
| 1337 if (n == "true") return true; | 1339 if (n == "true") return true; |
| 1338 if (n == "false") return false; | 1340 if (n == "false") return false; |
| 1339 if (n == null) return null; | 1341 if (n == null) return null; |
| 1340 throw new core.ArgumentError("Invalid boolean: $n"); | 1342 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1341 } | 1343 } |
| 1342 if (query.length > 0) { | 1344 if (query.length > 0) { |
| 1343 for (var part in query.split("&")) { | 1345 for (var part in query.split("&")) { |
| 1344 var keyvalue = part.split("="); | 1346 var keyvalue = part.split("="); |
| 1345 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1347 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1346 } | 1348 } |
| 1347 } | 1349 } |
| 1350 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1348 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1351 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1349 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1350 | 1352 |
| 1351 | 1353 |
| 1352 var h = { | 1354 var h = { |
| 1353 "content-type" : "application/json; charset=utf-8", | 1355 "content-type" : "application/json; charset=utf-8", |
| 1354 }; | 1356 }; |
| 1355 var resp = convert.JSON.encode(buildListSinksResponse()); | 1357 var resp = convert.JSON.encode(buildListSinksResponse()); |
| 1356 return new async.Future.value(stringResponse(200, h, resp)); | 1358 return new async.Future.value(stringResponse(200, h, resp)); |
| 1357 }), true); | 1359 }), true); |
| 1358 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { | 1360 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
| 1359 checkListSinksResponse(response); | 1361 checkListSinksResponse(response); |
| 1360 }))); | 1362 }))); |
| 1361 }); | 1363 }); |
| 1362 | 1364 |
| 1365 unittest.test("method--patch", () { |
| 1366 |
| 1367 var mock = new HttpServerMock(); |
| 1368 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
| 1369 var arg_request = buildLogSink(); |
| 1370 var arg_sinkName = "foo"; |
| 1371 var arg_uniqueWriterIdentity = true; |
| 1372 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1373 var obj = new api.LogSink.fromJson(json); |
| 1374 checkLogSink(obj); |
| 1375 |
| 1376 var path = (req.url).path; |
| 1377 var pathOffset = 0; |
| 1378 var index; |
| 1379 var subPart; |
| 1380 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1381 pathOffset += 1; |
| 1382 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1383 pathOffset += 3; |
| 1384 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1385 |
| 1386 var query = (req.url).query; |
| 1387 var queryOffset = 0; |
| 1388 var queryMap = {}; |
| 1389 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1390 parseBool(n) { |
| 1391 if (n == "true") return true; |
| 1392 if (n == "false") return false; |
| 1393 if (n == null) return null; |
| 1394 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1395 } |
| 1396 if (query.length > 0) { |
| 1397 for (var part in query.split("&")) { |
| 1398 var keyvalue = part.split("="); |
| 1399 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1400 } |
| 1401 } |
| 1402 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
| 1403 |
| 1404 |
| 1405 var h = { |
| 1406 "content-type" : "application/json; charset=utf-8", |
| 1407 }; |
| 1408 var resp = convert.JSON.encode(buildLogSink()); |
| 1409 return new async.Future.value(stringResponse(200, h, resp)); |
| 1410 }), true); |
| 1411 res.patch(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrite
rIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
| 1412 checkLogSink(response); |
| 1413 }))); |
| 1414 }); |
| 1415 |
| 1363 unittest.test("method--update", () { | 1416 unittest.test("method--update", () { |
| 1364 | 1417 |
| 1365 var mock = new HttpServerMock(); | 1418 var mock = new HttpServerMock(); |
| 1366 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; | 1419 api.BillingAccountsSinksResourceApi res = new api.LoggingApi(mock).billing
Accounts.sinks; |
| 1367 var arg_request = buildLogSink(); | 1420 var arg_request = buildLogSink(); |
| 1368 var arg_sinkName = "foo"; | 1421 var arg_sinkName = "foo"; |
| 1369 var arg_uniqueWriterIdentity = true; | 1422 var arg_uniqueWriterIdentity = true; |
| 1370 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1423 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1371 var obj = new api.LogSink.fromJson(json); | 1424 var obj = new api.LogSink.fromJson(json); |
| 1372 checkLogSink(obj); | 1425 checkLogSink(obj); |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { | 1803 res.get(arg_sinkName).then(unittest.expectAsync1(((api.LogSink response) { |
| 1751 checkLogSink(response); | 1804 checkLogSink(response); |
| 1752 }))); | 1805 }))); |
| 1753 }); | 1806 }); |
| 1754 | 1807 |
| 1755 unittest.test("method--list", () { | 1808 unittest.test("method--list", () { |
| 1756 | 1809 |
| 1757 var mock = new HttpServerMock(); | 1810 var mock = new HttpServerMock(); |
| 1758 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1811 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1759 var arg_parent = "foo"; | 1812 var arg_parent = "foo"; |
| 1813 var arg_pageToken = "foo"; |
| 1760 var arg_pageSize = 42; | 1814 var arg_pageSize = 42; |
| 1761 var arg_pageToken = "foo"; | |
| 1762 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1815 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1763 var path = (req.url).path; | 1816 var path = (req.url).path; |
| 1764 var pathOffset = 0; | 1817 var pathOffset = 0; |
| 1765 var index; | 1818 var index; |
| 1766 var subPart; | 1819 var subPart; |
| 1767 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1820 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1768 pathOffset += 1; | 1821 pathOffset += 1; |
| 1769 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 1822 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1770 pathOffset += 3; | 1823 pathOffset += 3; |
| 1771 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1824 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1772 | 1825 |
| 1773 var query = (req.url).query; | 1826 var query = (req.url).query; |
| 1774 var queryOffset = 0; | 1827 var queryOffset = 0; |
| 1775 var queryMap = {}; | 1828 var queryMap = {}; |
| 1776 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1829 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1777 parseBool(n) { | 1830 parseBool(n) { |
| 1778 if (n == "true") return true; | 1831 if (n == "true") return true; |
| 1779 if (n == "false") return false; | 1832 if (n == "false") return false; |
| 1780 if (n == null) return null; | 1833 if (n == null) return null; |
| 1781 throw new core.ArgumentError("Invalid boolean: $n"); | 1834 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1782 } | 1835 } |
| 1783 if (query.length > 0) { | 1836 if (query.length > 0) { |
| 1784 for (var part in query.split("&")) { | 1837 for (var part in query.split("&")) { |
| 1785 var keyvalue = part.split("="); | 1838 var keyvalue = part.split("="); |
| 1786 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1839 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1787 } | 1840 } |
| 1788 } | 1841 } |
| 1842 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1789 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1843 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1790 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1791 | 1844 |
| 1792 | 1845 |
| 1793 var h = { | 1846 var h = { |
| 1794 "content-type" : "application/json; charset=utf-8", | 1847 "content-type" : "application/json; charset=utf-8", |
| 1795 }; | 1848 }; |
| 1796 var resp = convert.JSON.encode(buildListSinksResponse()); | 1849 var resp = convert.JSON.encode(buildListSinksResponse()); |
| 1797 return new async.Future.value(stringResponse(200, h, resp)); | 1850 return new async.Future.value(stringResponse(200, h, resp)); |
| 1798 }), true); | 1851 }), true); |
| 1799 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { | 1852 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
| 1800 checkListSinksResponse(response); | 1853 checkListSinksResponse(response); |
| 1801 }))); | 1854 }))); |
| 1802 }); | 1855 }); |
| 1803 | 1856 |
| 1857 unittest.test("method--patch", () { |
| 1858 |
| 1859 var mock = new HttpServerMock(); |
| 1860 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1861 var arg_request = buildLogSink(); |
| 1862 var arg_sinkName = "foo"; |
| 1863 var arg_uniqueWriterIdentity = true; |
| 1864 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1865 var obj = new api.LogSink.fromJson(json); |
| 1866 checkLogSink(obj); |
| 1867 |
| 1868 var path = (req.url).path; |
| 1869 var pathOffset = 0; |
| 1870 var index; |
| 1871 var subPart; |
| 1872 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1873 pathOffset += 1; |
| 1874 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 1875 pathOffset += 3; |
| 1876 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1877 |
| 1878 var query = (req.url).query; |
| 1879 var queryOffset = 0; |
| 1880 var queryMap = {}; |
| 1881 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1882 parseBool(n) { |
| 1883 if (n == "true") return true; |
| 1884 if (n == "false") return false; |
| 1885 if (n == null) return null; |
| 1886 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1887 } |
| 1888 if (query.length > 0) { |
| 1889 for (var part in query.split("&")) { |
| 1890 var keyvalue = part.split("="); |
| 1891 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1892 } |
| 1893 } |
| 1894 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
| 1895 |
| 1896 |
| 1897 var h = { |
| 1898 "content-type" : "application/json; charset=utf-8", |
| 1899 }; |
| 1900 var resp = convert.JSON.encode(buildLogSink()); |
| 1901 return new async.Future.value(stringResponse(200, h, resp)); |
| 1902 }), true); |
| 1903 res.patch(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrite
rIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
| 1904 checkLogSink(response); |
| 1905 }))); |
| 1906 }); |
| 1907 |
| 1804 unittest.test("method--update", () { | 1908 unittest.test("method--update", () { |
| 1805 | 1909 |
| 1806 var mock = new HttpServerMock(); | 1910 var mock = new HttpServerMock(); |
| 1807 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; | 1911 api.FoldersSinksResourceApi res = new api.LoggingApi(mock).folders.sinks; |
| 1808 var arg_request = buildLogSink(); | 1912 var arg_request = buildLogSink(); |
| 1809 var arg_sinkName = "foo"; | 1913 var arg_sinkName = "foo"; |
| 1810 var arg_uniqueWriterIdentity = true; | 1914 var arg_uniqueWriterIdentity = true; |
| 1811 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1915 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1812 var obj = new api.LogSink.fromJson(json); | 1916 var obj = new api.LogSink.fromJson(json); |
| 1813 checkLogSink(obj); | 1917 checkLogSink(obj); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1853 }); | 1957 }); |
| 1854 | 1958 |
| 1855 }); | 1959 }); |
| 1856 | 1960 |
| 1857 | 1961 |
| 1858 unittest.group("resource-MonitoredResourceDescriptorsResourceApi", () { | 1962 unittest.group("resource-MonitoredResourceDescriptorsResourceApi", () { |
| 1859 unittest.test("method--list", () { | 1963 unittest.test("method--list", () { |
| 1860 | 1964 |
| 1861 var mock = new HttpServerMock(); | 1965 var mock = new HttpServerMock(); |
| 1862 api.MonitoredResourceDescriptorsResourceApi res = new api.LoggingApi(mock)
.monitoredResourceDescriptors; | 1966 api.MonitoredResourceDescriptorsResourceApi res = new api.LoggingApi(mock)
.monitoredResourceDescriptors; |
| 1967 var arg_pageToken = "foo"; |
| 1863 var arg_pageSize = 42; | 1968 var arg_pageSize = 42; |
| 1864 var arg_pageToken = "foo"; | |
| 1865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1969 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1866 var path = (req.url).path; | 1970 var path = (req.url).path; |
| 1867 var pathOffset = 0; | 1971 var pathOffset = 0; |
| 1868 var index; | 1972 var index; |
| 1869 var subPart; | 1973 var subPart; |
| 1870 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1974 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1871 pathOffset += 1; | 1975 pathOffset += 1; |
| 1872 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("v2/monitoredResourceDescriptors")); | 1976 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("v2/monitoredResourceDescriptors")); |
| 1873 pathOffset += 31; | 1977 pathOffset += 31; |
| 1874 | 1978 |
| 1875 var query = (req.url).query; | 1979 var query = (req.url).query; |
| 1876 var queryOffset = 0; | 1980 var queryOffset = 0; |
| 1877 var queryMap = {}; | 1981 var queryMap = {}; |
| 1878 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1982 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1879 parseBool(n) { | 1983 parseBool(n) { |
| 1880 if (n == "true") return true; | 1984 if (n == "true") return true; |
| 1881 if (n == "false") return false; | 1985 if (n == "false") return false; |
| 1882 if (n == null) return null; | 1986 if (n == null) return null; |
| 1883 throw new core.ArgumentError("Invalid boolean: $n"); | 1987 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1884 } | 1988 } |
| 1885 if (query.length > 0) { | 1989 if (query.length > 0) { |
| 1886 for (var part in query.split("&")) { | 1990 for (var part in query.split("&")) { |
| 1887 var keyvalue = part.split("="); | 1991 var keyvalue = part.split("="); |
| 1888 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1992 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1889 } | 1993 } |
| 1890 } | 1994 } |
| 1995 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1891 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1996 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1892 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 1893 | 1997 |
| 1894 | 1998 |
| 1895 var h = { | 1999 var h = { |
| 1896 "content-type" : "application/json; charset=utf-8", | 2000 "content-type" : "application/json; charset=utf-8", |
| 1897 }; | 2001 }; |
| 1898 var resp = convert.JSON.encode(buildListMonitoredResourceDescriptorsResp
onse()); | 2002 var resp = convert.JSON.encode(buildListMonitoredResourceDescriptorsResp
onse()); |
| 1899 return new async.Future.value(stringResponse(200, h, resp)); | 2003 return new async.Future.value(stringResponse(200, h, resp)); |
| 1900 }), true); | 2004 }), true); |
| 1901 res.list(pageSize: arg_pageSize, pageToken: arg_pageToken).then(unittest.e
xpectAsync1(((api.ListMonitoredResourceDescriptorsResponse response) { | 2005 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize).then(unittest.e
xpectAsync1(((api.ListMonitoredResourceDescriptorsResponse response) { |
| 1902 checkListMonitoredResourceDescriptorsResponse(response); | 2006 checkListMonitoredResourceDescriptorsResponse(response); |
| 1903 }))); | 2007 }))); |
| 1904 }); | 2008 }); |
| 1905 | 2009 |
| 1906 }); | 2010 }); |
| 1907 | 2011 |
| 1908 | 2012 |
| 1909 unittest.group("resource-OrganizationsLogsResourceApi", () { | 2013 unittest.group("resource-OrganizationsLogsResourceApi", () { |
| 1910 unittest.test("method--delete", () { | 2014 unittest.test("method--delete", () { |
| 1911 | 2015 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2188 "content-type" : "application/json; charset=utf-8", | 2292 "content-type" : "application/json; charset=utf-8", |
| 2189 }; | 2293 }; |
| 2190 var resp = convert.JSON.encode(buildListSinksResponse()); | 2294 var resp = convert.JSON.encode(buildListSinksResponse()); |
| 2191 return new async.Future.value(stringResponse(200, h, resp)); | 2295 return new async.Future.value(stringResponse(200, h, resp)); |
| 2192 }), true); | 2296 }), true); |
| 2193 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { | 2297 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
| 2194 checkListSinksResponse(response); | 2298 checkListSinksResponse(response); |
| 2195 }))); | 2299 }))); |
| 2196 }); | 2300 }); |
| 2197 | 2301 |
| 2302 unittest.test("method--patch", () { |
| 2303 |
| 2304 var mock = new HttpServerMock(); |
| 2305 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2306 var arg_request = buildLogSink(); |
| 2307 var arg_sinkName = "foo"; |
| 2308 var arg_uniqueWriterIdentity = true; |
| 2309 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2310 var obj = new api.LogSink.fromJson(json); |
| 2311 checkLogSink(obj); |
| 2312 |
| 2313 var path = (req.url).path; |
| 2314 var pathOffset = 0; |
| 2315 var index; |
| 2316 var subPart; |
| 2317 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2318 pathOffset += 1; |
| 2319 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2320 pathOffset += 3; |
| 2321 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2322 |
| 2323 var query = (req.url).query; |
| 2324 var queryOffset = 0; |
| 2325 var queryMap = {}; |
| 2326 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2327 parseBool(n) { |
| 2328 if (n == "true") return true; |
| 2329 if (n == "false") return false; |
| 2330 if (n == null) return null; |
| 2331 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2332 } |
| 2333 if (query.length > 0) { |
| 2334 for (var part in query.split("&")) { |
| 2335 var keyvalue = part.split("="); |
| 2336 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2337 } |
| 2338 } |
| 2339 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
| 2340 |
| 2341 |
| 2342 var h = { |
| 2343 "content-type" : "application/json; charset=utf-8", |
| 2344 }; |
| 2345 var resp = convert.JSON.encode(buildLogSink()); |
| 2346 return new async.Future.value(stringResponse(200, h, resp)); |
| 2347 }), true); |
| 2348 res.patch(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrite
rIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
| 2349 checkLogSink(response); |
| 2350 }))); |
| 2351 }); |
| 2352 |
| 2198 unittest.test("method--update", () { | 2353 unittest.test("method--update", () { |
| 2199 | 2354 |
| 2200 var mock = new HttpServerMock(); | 2355 var mock = new HttpServerMock(); |
| 2201 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; | 2356 api.OrganizationsSinksResourceApi res = new api.LoggingApi(mock).organizat
ions.sinks; |
| 2202 var arg_request = buildLogSink(); | 2357 var arg_request = buildLogSink(); |
| 2203 var arg_sinkName = "foo"; | 2358 var arg_sinkName = "foo"; |
| 2204 var arg_uniqueWriterIdentity = true; | 2359 var arg_uniqueWriterIdentity = true; |
| 2205 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2360 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2206 var obj = new api.LogSink.fromJson(json); | 2361 var obj = new api.LogSink.fromJson(json); |
| 2207 checkLogSink(obj); | 2362 checkLogSink(obj); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2485 res.get(arg_metricName).then(unittest.expectAsync1(((api.LogMetric respons
e) { | 2640 res.get(arg_metricName).then(unittest.expectAsync1(((api.LogMetric respons
e) { |
| 2486 checkLogMetric(response); | 2641 checkLogMetric(response); |
| 2487 }))); | 2642 }))); |
| 2488 }); | 2643 }); |
| 2489 | 2644 |
| 2490 unittest.test("method--list", () { | 2645 unittest.test("method--list", () { |
| 2491 | 2646 |
| 2492 var mock = new HttpServerMock(); | 2647 var mock = new HttpServerMock(); |
| 2493 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2648 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
| 2494 var arg_parent = "foo"; | 2649 var arg_parent = "foo"; |
| 2650 var arg_pageToken = "foo"; |
| 2495 var arg_pageSize = 42; | 2651 var arg_pageSize = 42; |
| 2496 var arg_pageToken = "foo"; | |
| 2497 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2652 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2498 var path = (req.url).path; | 2653 var path = (req.url).path; |
| 2499 var pathOffset = 0; | 2654 var pathOffset = 0; |
| 2500 var index; | 2655 var index; |
| 2501 var subPart; | 2656 var subPart; |
| 2502 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2657 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2503 pathOffset += 1; | 2658 pathOffset += 1; |
| 2504 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); | 2659 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2505 pathOffset += 3; | 2660 pathOffset += 3; |
| 2506 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2661 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2507 | 2662 |
| 2508 var query = (req.url).query; | 2663 var query = (req.url).query; |
| 2509 var queryOffset = 0; | 2664 var queryOffset = 0; |
| 2510 var queryMap = {}; | 2665 var queryMap = {}; |
| 2511 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2666 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2512 parseBool(n) { | 2667 parseBool(n) { |
| 2513 if (n == "true") return true; | 2668 if (n == "true") return true; |
| 2514 if (n == "false") return false; | 2669 if (n == "false") return false; |
| 2515 if (n == null) return null; | 2670 if (n == null) return null; |
| 2516 throw new core.ArgumentError("Invalid boolean: $n"); | 2671 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2517 } | 2672 } |
| 2518 if (query.length > 0) { | 2673 if (query.length > 0) { |
| 2519 for (var part in query.split("&")) { | 2674 for (var part in query.split("&")) { |
| 2520 var keyvalue = part.split("="); | 2675 var keyvalue = part.split("="); |
| 2521 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2676 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2522 } | 2677 } |
| 2523 } | 2678 } |
| 2679 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2524 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2680 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2525 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 2526 | 2681 |
| 2527 | 2682 |
| 2528 var h = { | 2683 var h = { |
| 2529 "content-type" : "application/json; charset=utf-8", | 2684 "content-type" : "application/json; charset=utf-8", |
| 2530 }; | 2685 }; |
| 2531 var resp = convert.JSON.encode(buildListLogMetricsResponse()); | 2686 var resp = convert.JSON.encode(buildListLogMetricsResponse()); |
| 2532 return new async.Future.value(stringResponse(200, h, resp)); | 2687 return new async.Future.value(stringResponse(200, h, resp)); |
| 2533 }), true); | 2688 }), true); |
| 2534 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListLogMetricsResponse response) { | 2689 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListLogMetricsResponse response) { |
| 2535 checkListLogMetricsResponse(response); | 2690 checkListLogMetricsResponse(response); |
| 2536 }))); | 2691 }))); |
| 2537 }); | 2692 }); |
| 2538 | 2693 |
| 2539 unittest.test("method--update", () { | 2694 unittest.test("method--update", () { |
| 2540 | 2695 |
| 2541 var mock = new HttpServerMock(); | 2696 var mock = new HttpServerMock(); |
| 2542 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; | 2697 api.ProjectsMetricsResourceApi res = new api.LoggingApi(mock).projects.met
rics; |
| 2543 var arg_request = buildLogMetric(); | 2698 var arg_request = buildLogMetric(); |
| 2544 var arg_metricName = "foo"; | 2699 var arg_metricName = "foo"; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2772 "content-type" : "application/json; charset=utf-8", | 2927 "content-type" : "application/json; charset=utf-8", |
| 2773 }; | 2928 }; |
| 2774 var resp = convert.JSON.encode(buildListSinksResponse()); | 2929 var resp = convert.JSON.encode(buildListSinksResponse()); |
| 2775 return new async.Future.value(stringResponse(200, h, resp)); | 2930 return new async.Future.value(stringResponse(200, h, resp)); |
| 2776 }), true); | 2931 }), true); |
| 2777 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { | 2932 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.ListSinksResponse response) { |
| 2778 checkListSinksResponse(response); | 2933 checkListSinksResponse(response); |
| 2779 }))); | 2934 }))); |
| 2780 }); | 2935 }); |
| 2781 | 2936 |
| 2937 unittest.test("method--patch", () { |
| 2938 |
| 2939 var mock = new HttpServerMock(); |
| 2940 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
| 2941 var arg_request = buildLogSink(); |
| 2942 var arg_sinkName = "foo"; |
| 2943 var arg_uniqueWriterIdentity = true; |
| 2944 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2945 var obj = new api.LogSink.fromJson(json); |
| 2946 checkLogSink(obj); |
| 2947 |
| 2948 var path = (req.url).path; |
| 2949 var pathOffset = 0; |
| 2950 var index; |
| 2951 var subPart; |
| 2952 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2953 pathOffset += 1; |
| 2954 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v2/")); |
| 2955 pathOffset += 3; |
| 2956 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2957 |
| 2958 var query = (req.url).query; |
| 2959 var queryOffset = 0; |
| 2960 var queryMap = {}; |
| 2961 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2962 parseBool(n) { |
| 2963 if (n == "true") return true; |
| 2964 if (n == "false") return false; |
| 2965 if (n == null) return null; |
| 2966 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2967 } |
| 2968 if (query.length > 0) { |
| 2969 for (var part in query.split("&")) { |
| 2970 var keyvalue = part.split("="); |
| 2971 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2972 } |
| 2973 } |
| 2974 unittest.expect(queryMap["uniqueWriterIdentity"].first, unittest.equals(
"$arg_uniqueWriterIdentity")); |
| 2975 |
| 2976 |
| 2977 var h = { |
| 2978 "content-type" : "application/json; charset=utf-8", |
| 2979 }; |
| 2980 var resp = convert.JSON.encode(buildLogSink()); |
| 2981 return new async.Future.value(stringResponse(200, h, resp)); |
| 2982 }), true); |
| 2983 res.patch(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrite
rIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
| 2984 checkLogSink(response); |
| 2985 }))); |
| 2986 }); |
| 2987 |
| 2782 unittest.test("method--update", () { | 2988 unittest.test("method--update", () { |
| 2783 | 2989 |
| 2784 var mock = new HttpServerMock(); | 2990 var mock = new HttpServerMock(); |
| 2785 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; | 2991 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
| 2786 var arg_request = buildLogSink(); | 2992 var arg_request = buildLogSink(); |
| 2787 var arg_sinkName = "foo"; | 2993 var arg_sinkName = "foo"; |
| 2788 var arg_uniqueWriterIdentity = true; | 2994 var arg_uniqueWriterIdentity = true; |
| 2789 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2995 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2790 var obj = new api.LogSink.fromJson(json); | 2996 var obj = new api.LogSink.fromJson(json); |
| 2791 checkLogSink(obj); | 2997 checkLogSink(obj); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2828 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync1(((api.LogSink response) { | 3034 res.update(arg_request, arg_sinkName, uniqueWriterIdentity: arg_uniqueWrit
erIdentity).then(unittest.expectAsync1(((api.LogSink response) { |
| 2829 checkLogSink(response); | 3035 checkLogSink(response); |
| 2830 }))); | 3036 }))); |
| 2831 }); | 3037 }); |
| 2832 | 3038 |
| 2833 }); | 3039 }); |
| 2834 | 3040 |
| 2835 | 3041 |
| 2836 } | 3042 } |
| 2837 | 3043 |
| OLD | NEW |