OLD | NEW |
1 library googleapis.ml.v1.test; | 1 library googleapis.ml.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/ml/v1.dart' as api; | 10 import 'package:googleapis/ml/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 buildUnnamed0() { | 53 buildUnnamed0() { |
55 var o = new core.Map<core.String, core.Object>(); | 54 var o = new core.Map<core.String, core.Object>(); |
56 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 55 o["x"] = { |
57 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 56 'list': [1, 2, 3], |
| 57 'bool': true, |
| 58 'string': 'foo' |
| 59 }; |
| 60 o["y"] = { |
| 61 'list': [1, 2, 3], |
| 62 'bool': true, |
| 63 'string': 'foo' |
| 64 }; |
58 return o; | 65 return o; |
59 } | 66 } |
60 | 67 |
61 checkUnnamed0(core.Map<core.String, core.Object> o) { | 68 checkUnnamed0(core.Map<core.String, core.Object> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 69 unittest.expect(o, unittest.hasLength(2)); |
63 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')); | 70 var casted1 = (o["x"]) as core.Map; |
64 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')); | 71 unittest.expect(casted1, unittest.hasLength(3)); |
| 72 unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); |
| 73 unittest.expect(casted1["bool"], unittest.equals(true)); |
| 74 unittest.expect(casted1["string"], unittest.equals('foo')); |
| 75 var casted2 = (o["y"]) as core.Map; |
| 76 unittest.expect(casted2, unittest.hasLength(3)); |
| 77 unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); |
| 78 unittest.expect(casted2["bool"], unittest.equals(true)); |
| 79 unittest.expect(casted2["string"], unittest.equals('foo')); |
65 } | 80 } |
66 | 81 |
67 buildUnnamed1() { | 82 buildUnnamed1() { |
68 var o = new core.List<core.Map<core.String, core.Object>>(); | 83 var o = new core.List<core.Map<core.String, core.Object>>(); |
69 o.add(buildUnnamed0()); | 84 o.add(buildUnnamed0()); |
70 o.add(buildUnnamed0()); | 85 o.add(buildUnnamed0()); |
71 return o; | 86 return o; |
72 } | 87 } |
73 | 88 |
74 checkUnnamed1(core.List<core.Map<core.String, core.Object>> o) { | 89 checkUnnamed1(core.List<core.Map<core.String, core.Object>> o) { |
(...skipping 18 matching lines...) Expand all Loading... |
93 checkGoogleApiHttpBody(api.GoogleApiHttpBody o) { | 108 checkGoogleApiHttpBody(api.GoogleApiHttpBody o) { |
94 buildCounterGoogleApiHttpBody++; | 109 buildCounterGoogleApiHttpBody++; |
95 if (buildCounterGoogleApiHttpBody < 3) { | 110 if (buildCounterGoogleApiHttpBody < 3) { |
96 unittest.expect(o.contentType, unittest.equals('foo')); | 111 unittest.expect(o.contentType, unittest.equals('foo')); |
97 unittest.expect(o.data, unittest.equals('foo')); | 112 unittest.expect(o.data, unittest.equals('foo')); |
98 checkUnnamed1(o.extensions); | 113 checkUnnamed1(o.extensions); |
99 } | 114 } |
100 buildCounterGoogleApiHttpBody--; | 115 buildCounterGoogleApiHttpBody--; |
101 } | 116 } |
102 | 117 |
103 core.int buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric = 0
; | 118 core.int buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric = |
| 119 0; |
104 buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric() { | 120 buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric() { |
105 var o = new api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); | 121 var o = new api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); |
106 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric++; | 122 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric++; |
107 if (buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric < 3) { | 123 if (buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric < 3) { |
108 o.objectiveValue = 42.0; | 124 o.objectiveValue = 42.0; |
109 o.trainingStep = "foo"; | 125 o.trainingStep = "foo"; |
110 } | 126 } |
111 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric--; | 127 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric--; |
112 return o; | 128 return o; |
113 } | 129 } |
114 | 130 |
115 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(api.GoogleCloudMlV1
HyperparameterOutputHyperparameterMetric o) { | 131 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric( |
| 132 api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric o) { |
116 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric++; | 133 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric++; |
117 if (buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric < 3) { | 134 if (buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric < 3) { |
118 unittest.expect(o.objectiveValue, unittest.equals(42.0)); | 135 unittest.expect(o.objectiveValue, unittest.equals(42.0)); |
119 unittest.expect(o.trainingStep, unittest.equals('foo')); | 136 unittest.expect(o.trainingStep, unittest.equals('foo')); |
120 } | 137 } |
121 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric--; | 138 buildCounterGoogleCloudMlV1HyperparameterOutputHyperparameterMetric--; |
122 } | 139 } |
123 | 140 |
124 core.int buildCounterGoogleCloudMlV1AutoScaling = 0; | 141 core.int buildCounterGoogleCloudMlV1AutoScaling = 0; |
125 buildGoogleCloudMlV1AutoScaling() { | 142 buildGoogleCloudMlV1AutoScaling() { |
(...skipping 11 matching lines...) Expand all Loading... |
137 if (buildCounterGoogleCloudMlV1AutoScaling < 3) { | 154 if (buildCounterGoogleCloudMlV1AutoScaling < 3) { |
138 unittest.expect(o.minNodes, unittest.equals(42)); | 155 unittest.expect(o.minNodes, unittest.equals(42)); |
139 } | 156 } |
140 buildCounterGoogleCloudMlV1AutoScaling--; | 157 buildCounterGoogleCloudMlV1AutoScaling--; |
141 } | 158 } |
142 | 159 |
143 core.int buildCounterGoogleCloudMlV1CancelJobRequest = 0; | 160 core.int buildCounterGoogleCloudMlV1CancelJobRequest = 0; |
144 buildGoogleCloudMlV1CancelJobRequest() { | 161 buildGoogleCloudMlV1CancelJobRequest() { |
145 var o = new api.GoogleCloudMlV1CancelJobRequest(); | 162 var o = new api.GoogleCloudMlV1CancelJobRequest(); |
146 buildCounterGoogleCloudMlV1CancelJobRequest++; | 163 buildCounterGoogleCloudMlV1CancelJobRequest++; |
147 if (buildCounterGoogleCloudMlV1CancelJobRequest < 3) { | 164 if (buildCounterGoogleCloudMlV1CancelJobRequest < 3) {} |
148 } | |
149 buildCounterGoogleCloudMlV1CancelJobRequest--; | 165 buildCounterGoogleCloudMlV1CancelJobRequest--; |
150 return o; | 166 return o; |
151 } | 167 } |
152 | 168 |
153 checkGoogleCloudMlV1CancelJobRequest(api.GoogleCloudMlV1CancelJobRequest o) { | 169 checkGoogleCloudMlV1CancelJobRequest(api.GoogleCloudMlV1CancelJobRequest o) { |
154 buildCounterGoogleCloudMlV1CancelJobRequest++; | 170 buildCounterGoogleCloudMlV1CancelJobRequest++; |
155 if (buildCounterGoogleCloudMlV1CancelJobRequest < 3) { | 171 if (buildCounterGoogleCloudMlV1CancelJobRequest < 3) {} |
156 } | |
157 buildCounterGoogleCloudMlV1CancelJobRequest--; | 172 buildCounterGoogleCloudMlV1CancelJobRequest--; |
158 } | 173 } |
159 | 174 |
160 core.int buildCounterGoogleCloudMlV1GetConfigResponse = 0; | 175 core.int buildCounterGoogleCloudMlV1GetConfigResponse = 0; |
161 buildGoogleCloudMlV1GetConfigResponse() { | 176 buildGoogleCloudMlV1GetConfigResponse() { |
162 var o = new api.GoogleCloudMlV1GetConfigResponse(); | 177 var o = new api.GoogleCloudMlV1GetConfigResponse(); |
163 buildCounterGoogleCloudMlV1GetConfigResponse++; | 178 buildCounterGoogleCloudMlV1GetConfigResponse++; |
164 if (buildCounterGoogleCloudMlV1GetConfigResponse < 3) { | 179 if (buildCounterGoogleCloudMlV1GetConfigResponse < 3) { |
165 o.serviceAccount = "foo"; | 180 o.serviceAccount = "foo"; |
166 o.serviceAccountProject = "foo"; | 181 o.serviceAccountProject = "foo"; |
167 } | 182 } |
168 buildCounterGoogleCloudMlV1GetConfigResponse--; | 183 buildCounterGoogleCloudMlV1GetConfigResponse--; |
169 return o; | 184 return o; |
170 } | 185 } |
171 | 186 |
172 checkGoogleCloudMlV1GetConfigResponse(api.GoogleCloudMlV1GetConfigResponse o) { | 187 checkGoogleCloudMlV1GetConfigResponse(api.GoogleCloudMlV1GetConfigResponse o) { |
173 buildCounterGoogleCloudMlV1GetConfigResponse++; | 188 buildCounterGoogleCloudMlV1GetConfigResponse++; |
174 if (buildCounterGoogleCloudMlV1GetConfigResponse < 3) { | 189 if (buildCounterGoogleCloudMlV1GetConfigResponse < 3) { |
175 unittest.expect(o.serviceAccount, unittest.equals('foo')); | 190 unittest.expect(o.serviceAccount, unittest.equals('foo')); |
176 unittest.expect(o.serviceAccountProject, unittest.equals('foo')); | 191 unittest.expect(o.serviceAccountProject, unittest.equals('foo')); |
177 } | 192 } |
178 buildCounterGoogleCloudMlV1GetConfigResponse--; | 193 buildCounterGoogleCloudMlV1GetConfigResponse--; |
179 } | 194 } |
180 | 195 |
181 buildUnnamed2() { | 196 buildUnnamed2() { |
182 var o = new core.List<api.GoogleCloudMlV1HyperparameterOutputHyperparameterMet
ric>(); | 197 var o = new core |
| 198 .List<api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric>(); |
183 o.add(buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric()); | 199 o.add(buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric()); |
184 o.add(buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric()); | 200 o.add(buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric()); |
185 return o; | 201 return o; |
186 } | 202 } |
187 | 203 |
188 checkUnnamed2(core.List<api.GoogleCloudMlV1HyperparameterOutputHyperparameterMet
ric> o) { | 204 checkUnnamed2( |
| 205 core.List<api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric> o) { |
189 unittest.expect(o, unittest.hasLength(2)); | 206 unittest.expect(o, unittest.hasLength(2)); |
190 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o[0]); | 207 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o[0]); |
191 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o[1]); | 208 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o[1]); |
192 } | 209 } |
193 | 210 |
194 buildUnnamed3() { | 211 buildUnnamed3() { |
195 var o = new core.Map<core.String, core.String>(); | 212 var o = new core.Map<core.String, core.String>(); |
196 o["x"] = "foo"; | 213 o["x"] = "foo"; |
197 o["y"] = "foo"; | 214 o["y"] = "foo"; |
198 return o; | 215 return o; |
199 } | 216 } |
200 | 217 |
201 checkUnnamed3(core.Map<core.String, core.String> o) { | 218 checkUnnamed3(core.Map<core.String, core.String> o) { |
202 unittest.expect(o, unittest.hasLength(2)); | 219 unittest.expect(o, unittest.hasLength(2)); |
203 unittest.expect(o["x"], unittest.equals('foo')); | 220 unittest.expect(o["x"], unittest.equals('foo')); |
204 unittest.expect(o["y"], unittest.equals('foo')); | 221 unittest.expect(o["y"], unittest.equals('foo')); |
205 } | 222 } |
206 | 223 |
207 core.int buildCounterGoogleCloudMlV1HyperparameterOutput = 0; | 224 core.int buildCounterGoogleCloudMlV1HyperparameterOutput = 0; |
208 buildGoogleCloudMlV1HyperparameterOutput() { | 225 buildGoogleCloudMlV1HyperparameterOutput() { |
209 var o = new api.GoogleCloudMlV1HyperparameterOutput(); | 226 var o = new api.GoogleCloudMlV1HyperparameterOutput(); |
210 buildCounterGoogleCloudMlV1HyperparameterOutput++; | 227 buildCounterGoogleCloudMlV1HyperparameterOutput++; |
211 if (buildCounterGoogleCloudMlV1HyperparameterOutput < 3) { | 228 if (buildCounterGoogleCloudMlV1HyperparameterOutput < 3) { |
212 o.allMetrics = buildUnnamed2(); | 229 o.allMetrics = buildUnnamed2(); |
213 o.finalMetric = buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric
(); | 230 o.finalMetric = |
| 231 buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); |
214 o.hyperparameters = buildUnnamed3(); | 232 o.hyperparameters = buildUnnamed3(); |
215 o.trialId = "foo"; | 233 o.trialId = "foo"; |
216 } | 234 } |
217 buildCounterGoogleCloudMlV1HyperparameterOutput--; | 235 buildCounterGoogleCloudMlV1HyperparameterOutput--; |
218 return o; | 236 return o; |
219 } | 237 } |
220 | 238 |
221 checkGoogleCloudMlV1HyperparameterOutput(api.GoogleCloudMlV1HyperparameterOutput
o) { | 239 checkGoogleCloudMlV1HyperparameterOutput( |
| 240 api.GoogleCloudMlV1HyperparameterOutput o) { |
222 buildCounterGoogleCloudMlV1HyperparameterOutput++; | 241 buildCounterGoogleCloudMlV1HyperparameterOutput++; |
223 if (buildCounterGoogleCloudMlV1HyperparameterOutput < 3) { | 242 if (buildCounterGoogleCloudMlV1HyperparameterOutput < 3) { |
224 checkUnnamed2(o.allMetrics); | 243 checkUnnamed2(o.allMetrics); |
225 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o.finalMetric); | 244 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(o.finalMetric); |
226 checkUnnamed3(o.hyperparameters); | 245 checkUnnamed3(o.hyperparameters); |
227 unittest.expect(o.trialId, unittest.equals('foo')); | 246 unittest.expect(o.trialId, unittest.equals('foo')); |
228 } | 247 } |
229 buildCounterGoogleCloudMlV1HyperparameterOutput--; | 248 buildCounterGoogleCloudMlV1HyperparameterOutput--; |
230 } | 249 } |
231 | 250 |
(...skipping 18 matching lines...) Expand all Loading... |
250 o.goal = "foo"; | 269 o.goal = "foo"; |
251 o.hyperparameterMetricTag = "foo"; | 270 o.hyperparameterMetricTag = "foo"; |
252 o.maxParallelTrials = 42; | 271 o.maxParallelTrials = 42; |
253 o.maxTrials = 42; | 272 o.maxTrials = 42; |
254 o.params = buildUnnamed4(); | 273 o.params = buildUnnamed4(); |
255 } | 274 } |
256 buildCounterGoogleCloudMlV1HyperparameterSpec--; | 275 buildCounterGoogleCloudMlV1HyperparameterSpec--; |
257 return o; | 276 return o; |
258 } | 277 } |
259 | 278 |
260 checkGoogleCloudMlV1HyperparameterSpec(api.GoogleCloudMlV1HyperparameterSpec o)
{ | 279 checkGoogleCloudMlV1HyperparameterSpec( |
| 280 api.GoogleCloudMlV1HyperparameterSpec o) { |
261 buildCounterGoogleCloudMlV1HyperparameterSpec++; | 281 buildCounterGoogleCloudMlV1HyperparameterSpec++; |
262 if (buildCounterGoogleCloudMlV1HyperparameterSpec < 3) { | 282 if (buildCounterGoogleCloudMlV1HyperparameterSpec < 3) { |
263 unittest.expect(o.goal, unittest.equals('foo')); | 283 unittest.expect(o.goal, unittest.equals('foo')); |
264 unittest.expect(o.hyperparameterMetricTag, unittest.equals('foo')); | 284 unittest.expect(o.hyperparameterMetricTag, unittest.equals('foo')); |
265 unittest.expect(o.maxParallelTrials, unittest.equals(42)); | 285 unittest.expect(o.maxParallelTrials, unittest.equals(42)); |
266 unittest.expect(o.maxTrials, unittest.equals(42)); | 286 unittest.expect(o.maxTrials, unittest.equals(42)); |
267 checkUnnamed4(o.params); | 287 checkUnnamed4(o.params); |
268 } | 288 } |
269 buildCounterGoogleCloudMlV1HyperparameterSpec--; | 289 buildCounterGoogleCloudMlV1HyperparameterSpec--; |
270 } | 290 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 var o = new api.GoogleCloudMlV1ListModelsResponse(); | 378 var o = new api.GoogleCloudMlV1ListModelsResponse(); |
359 buildCounterGoogleCloudMlV1ListModelsResponse++; | 379 buildCounterGoogleCloudMlV1ListModelsResponse++; |
360 if (buildCounterGoogleCloudMlV1ListModelsResponse < 3) { | 380 if (buildCounterGoogleCloudMlV1ListModelsResponse < 3) { |
361 o.models = buildUnnamed6(); | 381 o.models = buildUnnamed6(); |
362 o.nextPageToken = "foo"; | 382 o.nextPageToken = "foo"; |
363 } | 383 } |
364 buildCounterGoogleCloudMlV1ListModelsResponse--; | 384 buildCounterGoogleCloudMlV1ListModelsResponse--; |
365 return o; | 385 return o; |
366 } | 386 } |
367 | 387 |
368 checkGoogleCloudMlV1ListModelsResponse(api.GoogleCloudMlV1ListModelsResponse o)
{ | 388 checkGoogleCloudMlV1ListModelsResponse( |
| 389 api.GoogleCloudMlV1ListModelsResponse o) { |
369 buildCounterGoogleCloudMlV1ListModelsResponse++; | 390 buildCounterGoogleCloudMlV1ListModelsResponse++; |
370 if (buildCounterGoogleCloudMlV1ListModelsResponse < 3) { | 391 if (buildCounterGoogleCloudMlV1ListModelsResponse < 3) { |
371 checkUnnamed6(o.models); | 392 checkUnnamed6(o.models); |
372 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 393 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
373 } | 394 } |
374 buildCounterGoogleCloudMlV1ListModelsResponse--; | 395 buildCounterGoogleCloudMlV1ListModelsResponse--; |
375 } | 396 } |
376 | 397 |
377 buildUnnamed7() { | 398 buildUnnamed7() { |
378 var o = new core.List<api.GoogleCloudMlV1Version>(); | 399 var o = new core.List<api.GoogleCloudMlV1Version>(); |
(...skipping 13 matching lines...) Expand all Loading... |
392 var o = new api.GoogleCloudMlV1ListVersionsResponse(); | 413 var o = new api.GoogleCloudMlV1ListVersionsResponse(); |
393 buildCounterGoogleCloudMlV1ListVersionsResponse++; | 414 buildCounterGoogleCloudMlV1ListVersionsResponse++; |
394 if (buildCounterGoogleCloudMlV1ListVersionsResponse < 3) { | 415 if (buildCounterGoogleCloudMlV1ListVersionsResponse < 3) { |
395 o.nextPageToken = "foo"; | 416 o.nextPageToken = "foo"; |
396 o.versions = buildUnnamed7(); | 417 o.versions = buildUnnamed7(); |
397 } | 418 } |
398 buildCounterGoogleCloudMlV1ListVersionsResponse--; | 419 buildCounterGoogleCloudMlV1ListVersionsResponse--; |
399 return o; | 420 return o; |
400 } | 421 } |
401 | 422 |
402 checkGoogleCloudMlV1ListVersionsResponse(api.GoogleCloudMlV1ListVersionsResponse
o) { | 423 checkGoogleCloudMlV1ListVersionsResponse( |
| 424 api.GoogleCloudMlV1ListVersionsResponse o) { |
403 buildCounterGoogleCloudMlV1ListVersionsResponse++; | 425 buildCounterGoogleCloudMlV1ListVersionsResponse++; |
404 if (buildCounterGoogleCloudMlV1ListVersionsResponse < 3) { | 426 if (buildCounterGoogleCloudMlV1ListVersionsResponse < 3) { |
405 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 427 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
406 checkUnnamed7(o.versions); | 428 checkUnnamed7(o.versions); |
407 } | 429 } |
408 buildCounterGoogleCloudMlV1ListVersionsResponse--; | 430 buildCounterGoogleCloudMlV1ListVersionsResponse--; |
409 } | 431 } |
410 | 432 |
411 core.int buildCounterGoogleCloudMlV1ManualScaling = 0; | 433 core.int buildCounterGoogleCloudMlV1ManualScaling = 0; |
412 buildGoogleCloudMlV1ManualScaling() { | 434 buildGoogleCloudMlV1ManualScaling() { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 unittest.expect(o.outputPath, unittest.equals('foo')); | 668 unittest.expect(o.outputPath, unittest.equals('foo')); |
647 unittest.expect(o.predictionCount, unittest.equals('foo')); | 669 unittest.expect(o.predictionCount, unittest.equals('foo')); |
648 } | 670 } |
649 buildCounterGoogleCloudMlV1PredictionOutput--; | 671 buildCounterGoogleCloudMlV1PredictionOutput--; |
650 } | 672 } |
651 | 673 |
652 core.int buildCounterGoogleCloudMlV1SetDefaultVersionRequest = 0; | 674 core.int buildCounterGoogleCloudMlV1SetDefaultVersionRequest = 0; |
653 buildGoogleCloudMlV1SetDefaultVersionRequest() { | 675 buildGoogleCloudMlV1SetDefaultVersionRequest() { |
654 var o = new api.GoogleCloudMlV1SetDefaultVersionRequest(); | 676 var o = new api.GoogleCloudMlV1SetDefaultVersionRequest(); |
655 buildCounterGoogleCloudMlV1SetDefaultVersionRequest++; | 677 buildCounterGoogleCloudMlV1SetDefaultVersionRequest++; |
656 if (buildCounterGoogleCloudMlV1SetDefaultVersionRequest < 3) { | 678 if (buildCounterGoogleCloudMlV1SetDefaultVersionRequest < 3) {} |
657 } | |
658 buildCounterGoogleCloudMlV1SetDefaultVersionRequest--; | 679 buildCounterGoogleCloudMlV1SetDefaultVersionRequest--; |
659 return o; | 680 return o; |
660 } | 681 } |
661 | 682 |
662 checkGoogleCloudMlV1SetDefaultVersionRequest(api.GoogleCloudMlV1SetDefaultVersio
nRequest o) { | 683 checkGoogleCloudMlV1SetDefaultVersionRequest( |
| 684 api.GoogleCloudMlV1SetDefaultVersionRequest o) { |
663 buildCounterGoogleCloudMlV1SetDefaultVersionRequest++; | 685 buildCounterGoogleCloudMlV1SetDefaultVersionRequest++; |
664 if (buildCounterGoogleCloudMlV1SetDefaultVersionRequest < 3) { | 686 if (buildCounterGoogleCloudMlV1SetDefaultVersionRequest < 3) {} |
665 } | |
666 buildCounterGoogleCloudMlV1SetDefaultVersionRequest--; | 687 buildCounterGoogleCloudMlV1SetDefaultVersionRequest--; |
667 } | 688 } |
668 | 689 |
669 buildUnnamed12() { | 690 buildUnnamed12() { |
670 var o = new core.List<core.String>(); | 691 var o = new core.List<core.String>(); |
671 o.add("foo"); | 692 o.add("foo"); |
672 o.add("foo"); | 693 o.add("foo"); |
673 return o; | 694 return o; |
674 } | 695 } |
675 | 696 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 unittest.expect(o.isDefault, unittest.isTrue); | 826 unittest.expect(o.isDefault, unittest.isTrue); |
806 unittest.expect(o.lastUseTime, unittest.equals('foo')); | 827 unittest.expect(o.lastUseTime, unittest.equals('foo')); |
807 checkGoogleCloudMlV1ManualScaling(o.manualScaling); | 828 checkGoogleCloudMlV1ManualScaling(o.manualScaling); |
808 unittest.expect(o.name, unittest.equals('foo')); | 829 unittest.expect(o.name, unittest.equals('foo')); |
809 unittest.expect(o.runtimeVersion, unittest.equals('foo')); | 830 unittest.expect(o.runtimeVersion, unittest.equals('foo')); |
810 unittest.expect(o.state, unittest.equals('foo')); | 831 unittest.expect(o.state, unittest.equals('foo')); |
811 } | 832 } |
812 buildCounterGoogleCloudMlV1Version--; | 833 buildCounterGoogleCloudMlV1Version--; |
813 } | 834 } |
814 | 835 |
815 core.int buildCounterGoogleCloudMlV1beta1AutoScaling = 0; | |
816 buildGoogleCloudMlV1beta1AutoScaling() { | |
817 var o = new api.GoogleCloudMlV1beta1AutoScaling(); | |
818 buildCounterGoogleCloudMlV1beta1AutoScaling++; | |
819 if (buildCounterGoogleCloudMlV1beta1AutoScaling < 3) { | |
820 o.minNodes = 42; | |
821 } | |
822 buildCounterGoogleCloudMlV1beta1AutoScaling--; | |
823 return o; | |
824 } | |
825 | |
826 checkGoogleCloudMlV1beta1AutoScaling(api.GoogleCloudMlV1beta1AutoScaling o) { | |
827 buildCounterGoogleCloudMlV1beta1AutoScaling++; | |
828 if (buildCounterGoogleCloudMlV1beta1AutoScaling < 3) { | |
829 unittest.expect(o.minNodes, unittest.equals(42)); | |
830 } | |
831 buildCounterGoogleCloudMlV1beta1AutoScaling--; | |
832 } | |
833 | |
834 core.int buildCounterGoogleCloudMlV1beta1ManualScaling = 0; | |
835 buildGoogleCloudMlV1beta1ManualScaling() { | |
836 var o = new api.GoogleCloudMlV1beta1ManualScaling(); | |
837 buildCounterGoogleCloudMlV1beta1ManualScaling++; | |
838 if (buildCounterGoogleCloudMlV1beta1ManualScaling < 3) { | |
839 o.nodes = 42; | |
840 } | |
841 buildCounterGoogleCloudMlV1beta1ManualScaling--; | |
842 return o; | |
843 } | |
844 | |
845 checkGoogleCloudMlV1beta1ManualScaling(api.GoogleCloudMlV1beta1ManualScaling o)
{ | |
846 buildCounterGoogleCloudMlV1beta1ManualScaling++; | |
847 if (buildCounterGoogleCloudMlV1beta1ManualScaling < 3) { | |
848 unittest.expect(o.nodes, unittest.equals(42)); | |
849 } | |
850 buildCounterGoogleCloudMlV1beta1ManualScaling--; | |
851 } | |
852 | |
853 core.int buildCounterGoogleCloudMlV1beta1OperationMetadata = 0; | |
854 buildGoogleCloudMlV1beta1OperationMetadata() { | |
855 var o = new api.GoogleCloudMlV1beta1OperationMetadata(); | |
856 buildCounterGoogleCloudMlV1beta1OperationMetadata++; | |
857 if (buildCounterGoogleCloudMlV1beta1OperationMetadata < 3) { | |
858 o.createTime = "foo"; | |
859 o.endTime = "foo"; | |
860 o.isCancellationRequested = true; | |
861 o.modelName = "foo"; | |
862 o.operationType = "foo"; | |
863 o.startTime = "foo"; | |
864 o.version = buildGoogleCloudMlV1beta1Version(); | |
865 } | |
866 buildCounterGoogleCloudMlV1beta1OperationMetadata--; | |
867 return o; | |
868 } | |
869 | |
870 checkGoogleCloudMlV1beta1OperationMetadata(api.GoogleCloudMlV1beta1OperationMeta
data o) { | |
871 buildCounterGoogleCloudMlV1beta1OperationMetadata++; | |
872 if (buildCounterGoogleCloudMlV1beta1OperationMetadata < 3) { | |
873 unittest.expect(o.createTime, unittest.equals('foo')); | |
874 unittest.expect(o.endTime, unittest.equals('foo')); | |
875 unittest.expect(o.isCancellationRequested, unittest.isTrue); | |
876 unittest.expect(o.modelName, unittest.equals('foo')); | |
877 unittest.expect(o.operationType, unittest.equals('foo')); | |
878 unittest.expect(o.startTime, unittest.equals('foo')); | |
879 checkGoogleCloudMlV1beta1Version(o.version); | |
880 } | |
881 buildCounterGoogleCloudMlV1beta1OperationMetadata--; | |
882 } | |
883 | |
884 core.int buildCounterGoogleCloudMlV1beta1Version = 0; | |
885 buildGoogleCloudMlV1beta1Version() { | |
886 var o = new api.GoogleCloudMlV1beta1Version(); | |
887 buildCounterGoogleCloudMlV1beta1Version++; | |
888 if (buildCounterGoogleCloudMlV1beta1Version < 3) { | |
889 o.autoScaling = buildGoogleCloudMlV1beta1AutoScaling(); | |
890 o.createTime = "foo"; | |
891 o.deploymentUri = "foo"; | |
892 o.description = "foo"; | |
893 o.errorMessage = "foo"; | |
894 o.isDefault = true; | |
895 o.lastUseTime = "foo"; | |
896 o.manualScaling = buildGoogleCloudMlV1beta1ManualScaling(); | |
897 o.name = "foo"; | |
898 o.runtimeVersion = "foo"; | |
899 o.state = "foo"; | |
900 } | |
901 buildCounterGoogleCloudMlV1beta1Version--; | |
902 return o; | |
903 } | |
904 | |
905 checkGoogleCloudMlV1beta1Version(api.GoogleCloudMlV1beta1Version o) { | |
906 buildCounterGoogleCloudMlV1beta1Version++; | |
907 if (buildCounterGoogleCloudMlV1beta1Version < 3) { | |
908 checkGoogleCloudMlV1beta1AutoScaling(o.autoScaling); | |
909 unittest.expect(o.createTime, unittest.equals('foo')); | |
910 unittest.expect(o.deploymentUri, unittest.equals('foo')); | |
911 unittest.expect(o.description, unittest.equals('foo')); | |
912 unittest.expect(o.errorMessage, unittest.equals('foo')); | |
913 unittest.expect(o.isDefault, unittest.isTrue); | |
914 unittest.expect(o.lastUseTime, unittest.equals('foo')); | |
915 checkGoogleCloudMlV1beta1ManualScaling(o.manualScaling); | |
916 unittest.expect(o.name, unittest.equals('foo')); | |
917 unittest.expect(o.runtimeVersion, unittest.equals('foo')); | |
918 unittest.expect(o.state, unittest.equals('foo')); | |
919 } | |
920 buildCounterGoogleCloudMlV1beta1Version--; | |
921 } | |
922 | |
923 core.int buildCounterGoogleIamV1LogConfigCloudAuditOptions = 0; | |
924 buildGoogleIamV1LogConfigCloudAuditOptions() { | |
925 var o = new api.GoogleIamV1LogConfigCloudAuditOptions(); | |
926 buildCounterGoogleIamV1LogConfigCloudAuditOptions++; | |
927 if (buildCounterGoogleIamV1LogConfigCloudAuditOptions < 3) { | |
928 o.logName = "foo"; | |
929 } | |
930 buildCounterGoogleIamV1LogConfigCloudAuditOptions--; | |
931 return o; | |
932 } | |
933 | |
934 checkGoogleIamV1LogConfigCloudAuditOptions(api.GoogleIamV1LogConfigCloudAuditOpt
ions o) { | |
935 buildCounterGoogleIamV1LogConfigCloudAuditOptions++; | |
936 if (buildCounterGoogleIamV1LogConfigCloudAuditOptions < 3) { | |
937 unittest.expect(o.logName, unittest.equals('foo')); | |
938 } | |
939 buildCounterGoogleIamV1LogConfigCloudAuditOptions--; | |
940 } | |
941 | |
942 core.int buildCounterGoogleIamV1LogConfigCounterOptions = 0; | |
943 buildGoogleIamV1LogConfigCounterOptions() { | |
944 var o = new api.GoogleIamV1LogConfigCounterOptions(); | |
945 buildCounterGoogleIamV1LogConfigCounterOptions++; | |
946 if (buildCounterGoogleIamV1LogConfigCounterOptions < 3) { | |
947 o.field = "foo"; | |
948 o.metric = "foo"; | |
949 } | |
950 buildCounterGoogleIamV1LogConfigCounterOptions--; | |
951 return o; | |
952 } | |
953 | |
954 checkGoogleIamV1LogConfigCounterOptions(api.GoogleIamV1LogConfigCounterOptions o
) { | |
955 buildCounterGoogleIamV1LogConfigCounterOptions++; | |
956 if (buildCounterGoogleIamV1LogConfigCounterOptions < 3) { | |
957 unittest.expect(o.field, unittest.equals('foo')); | |
958 unittest.expect(o.metric, unittest.equals('foo')); | |
959 } | |
960 buildCounterGoogleIamV1LogConfigCounterOptions--; | |
961 } | |
962 | |
963 core.int buildCounterGoogleIamV1LogConfigDataAccessOptions = 0; | |
964 buildGoogleIamV1LogConfigDataAccessOptions() { | |
965 var o = new api.GoogleIamV1LogConfigDataAccessOptions(); | |
966 buildCounterGoogleIamV1LogConfigDataAccessOptions++; | |
967 if (buildCounterGoogleIamV1LogConfigDataAccessOptions < 3) { | |
968 o.logMode = "foo"; | |
969 } | |
970 buildCounterGoogleIamV1LogConfigDataAccessOptions--; | |
971 return o; | |
972 } | |
973 | |
974 checkGoogleIamV1LogConfigDataAccessOptions(api.GoogleIamV1LogConfigDataAccessOpt
ions o) { | |
975 buildCounterGoogleIamV1LogConfigDataAccessOptions++; | |
976 if (buildCounterGoogleIamV1LogConfigDataAccessOptions < 3) { | |
977 unittest.expect(o.logMode, unittest.equals('foo')); | |
978 } | |
979 buildCounterGoogleIamV1LogConfigDataAccessOptions--; | |
980 } | |
981 | |
982 buildUnnamed15() { | 836 buildUnnamed15() { |
983 var o = new core.List<api.GoogleIamV1AuditLogConfig>(); | 837 var o = new core.List<api.GoogleIamV1AuditLogConfig>(); |
984 o.add(buildGoogleIamV1AuditLogConfig()); | 838 o.add(buildGoogleIamV1AuditLogConfig()); |
985 o.add(buildGoogleIamV1AuditLogConfig()); | 839 o.add(buildGoogleIamV1AuditLogConfig()); |
986 return o; | 840 return o; |
987 } | 841 } |
988 | 842 |
989 checkUnnamed15(core.List<api.GoogleIamV1AuditLogConfig> o) { | 843 checkUnnamed15(core.List<api.GoogleIamV1AuditLogConfig> o) { |
990 unittest.expect(o, unittest.hasLength(2)); | 844 unittest.expect(o, unittest.hasLength(2)); |
991 checkGoogleIamV1AuditLogConfig(o[0]); | 845 checkGoogleIamV1AuditLogConfig(o[0]); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 buildCounterGoogleIamV1Binding++; | 946 buildCounterGoogleIamV1Binding++; |
1093 if (buildCounterGoogleIamV1Binding < 3) { | 947 if (buildCounterGoogleIamV1Binding < 3) { |
1094 checkGoogleTypeExpr(o.condition); | 948 checkGoogleTypeExpr(o.condition); |
1095 checkUnnamed18(o.members); | 949 checkUnnamed18(o.members); |
1096 unittest.expect(o.role, unittest.equals('foo')); | 950 unittest.expect(o.role, unittest.equals('foo')); |
1097 } | 951 } |
1098 buildCounterGoogleIamV1Binding--; | 952 buildCounterGoogleIamV1Binding--; |
1099 } | 953 } |
1100 | 954 |
1101 buildUnnamed19() { | 955 buildUnnamed19() { |
1102 var o = new core.List<core.String>(); | |
1103 o.add("foo"); | |
1104 o.add("foo"); | |
1105 return o; | |
1106 } | |
1107 | |
1108 checkUnnamed19(core.List<core.String> o) { | |
1109 unittest.expect(o, unittest.hasLength(2)); | |
1110 unittest.expect(o[0], unittest.equals('foo')); | |
1111 unittest.expect(o[1], unittest.equals('foo')); | |
1112 } | |
1113 | |
1114 core.int buildCounterGoogleIamV1Condition = 0; | |
1115 buildGoogleIamV1Condition() { | |
1116 var o = new api.GoogleIamV1Condition(); | |
1117 buildCounterGoogleIamV1Condition++; | |
1118 if (buildCounterGoogleIamV1Condition < 3) { | |
1119 o.iam = "foo"; | |
1120 o.op = "foo"; | |
1121 o.svc = "foo"; | |
1122 o.sys = "foo"; | |
1123 o.value = "foo"; | |
1124 o.values = buildUnnamed19(); | |
1125 } | |
1126 buildCounterGoogleIamV1Condition--; | |
1127 return o; | |
1128 } | |
1129 | |
1130 checkGoogleIamV1Condition(api.GoogleIamV1Condition o) { | |
1131 buildCounterGoogleIamV1Condition++; | |
1132 if (buildCounterGoogleIamV1Condition < 3) { | |
1133 unittest.expect(o.iam, unittest.equals('foo')); | |
1134 unittest.expect(o.op, unittest.equals('foo')); | |
1135 unittest.expect(o.svc, unittest.equals('foo')); | |
1136 unittest.expect(o.sys, unittest.equals('foo')); | |
1137 unittest.expect(o.value, unittest.equals('foo')); | |
1138 checkUnnamed19(o.values); | |
1139 } | |
1140 buildCounterGoogleIamV1Condition--; | |
1141 } | |
1142 | |
1143 core.int buildCounterGoogleIamV1LogConfig = 0; | |
1144 buildGoogleIamV1LogConfig() { | |
1145 var o = new api.GoogleIamV1LogConfig(); | |
1146 buildCounterGoogleIamV1LogConfig++; | |
1147 if (buildCounterGoogleIamV1LogConfig < 3) { | |
1148 o.cloudAudit = buildGoogleIamV1LogConfigCloudAuditOptions(); | |
1149 o.counter = buildGoogleIamV1LogConfigCounterOptions(); | |
1150 o.dataAccess = buildGoogleIamV1LogConfigDataAccessOptions(); | |
1151 } | |
1152 buildCounterGoogleIamV1LogConfig--; | |
1153 return o; | |
1154 } | |
1155 | |
1156 checkGoogleIamV1LogConfig(api.GoogleIamV1LogConfig o) { | |
1157 buildCounterGoogleIamV1LogConfig++; | |
1158 if (buildCounterGoogleIamV1LogConfig < 3) { | |
1159 checkGoogleIamV1LogConfigCloudAuditOptions(o.cloudAudit); | |
1160 checkGoogleIamV1LogConfigCounterOptions(o.counter); | |
1161 checkGoogleIamV1LogConfigDataAccessOptions(o.dataAccess); | |
1162 } | |
1163 buildCounterGoogleIamV1LogConfig--; | |
1164 } | |
1165 | |
1166 buildUnnamed20() { | |
1167 var o = new core.List<api.GoogleIamV1AuditConfig>(); | 956 var o = new core.List<api.GoogleIamV1AuditConfig>(); |
1168 o.add(buildGoogleIamV1AuditConfig()); | 957 o.add(buildGoogleIamV1AuditConfig()); |
1169 o.add(buildGoogleIamV1AuditConfig()); | 958 o.add(buildGoogleIamV1AuditConfig()); |
1170 return o; | 959 return o; |
1171 } | 960 } |
1172 | 961 |
1173 checkUnnamed20(core.List<api.GoogleIamV1AuditConfig> o) { | 962 checkUnnamed19(core.List<api.GoogleIamV1AuditConfig> o) { |
1174 unittest.expect(o, unittest.hasLength(2)); | 963 unittest.expect(o, unittest.hasLength(2)); |
1175 checkGoogleIamV1AuditConfig(o[0]); | 964 checkGoogleIamV1AuditConfig(o[0]); |
1176 checkGoogleIamV1AuditConfig(o[1]); | 965 checkGoogleIamV1AuditConfig(o[1]); |
1177 } | 966 } |
1178 | 967 |
1179 buildUnnamed21() { | 968 buildUnnamed20() { |
1180 var o = new core.List<api.GoogleIamV1Binding>(); | 969 var o = new core.List<api.GoogleIamV1Binding>(); |
1181 o.add(buildGoogleIamV1Binding()); | 970 o.add(buildGoogleIamV1Binding()); |
1182 o.add(buildGoogleIamV1Binding()); | 971 o.add(buildGoogleIamV1Binding()); |
1183 return o; | 972 return o; |
1184 } | 973 } |
1185 | 974 |
1186 checkUnnamed21(core.List<api.GoogleIamV1Binding> o) { | 975 checkUnnamed20(core.List<api.GoogleIamV1Binding> o) { |
1187 unittest.expect(o, unittest.hasLength(2)); | 976 unittest.expect(o, unittest.hasLength(2)); |
1188 checkGoogleIamV1Binding(o[0]); | 977 checkGoogleIamV1Binding(o[0]); |
1189 checkGoogleIamV1Binding(o[1]); | 978 checkGoogleIamV1Binding(o[1]); |
1190 } | 979 } |
1191 | 980 |
1192 buildUnnamed22() { | |
1193 var o = new core.List<api.GoogleIamV1Rule>(); | |
1194 o.add(buildGoogleIamV1Rule()); | |
1195 o.add(buildGoogleIamV1Rule()); | |
1196 return o; | |
1197 } | |
1198 | |
1199 checkUnnamed22(core.List<api.GoogleIamV1Rule> o) { | |
1200 unittest.expect(o, unittest.hasLength(2)); | |
1201 checkGoogleIamV1Rule(o[0]); | |
1202 checkGoogleIamV1Rule(o[1]); | |
1203 } | |
1204 | |
1205 core.int buildCounterGoogleIamV1Policy = 0; | 981 core.int buildCounterGoogleIamV1Policy = 0; |
1206 buildGoogleIamV1Policy() { | 982 buildGoogleIamV1Policy() { |
1207 var o = new api.GoogleIamV1Policy(); | 983 var o = new api.GoogleIamV1Policy(); |
1208 buildCounterGoogleIamV1Policy++; | 984 buildCounterGoogleIamV1Policy++; |
1209 if (buildCounterGoogleIamV1Policy < 3) { | 985 if (buildCounterGoogleIamV1Policy < 3) { |
1210 o.auditConfigs = buildUnnamed20(); | 986 o.auditConfigs = buildUnnamed19(); |
1211 o.bindings = buildUnnamed21(); | 987 o.bindings = buildUnnamed20(); |
1212 o.etag = "foo"; | 988 o.etag = "foo"; |
1213 o.iamOwned = true; | 989 o.iamOwned = true; |
1214 o.rules = buildUnnamed22(); | |
1215 o.version = 42; | 990 o.version = 42; |
1216 } | 991 } |
1217 buildCounterGoogleIamV1Policy--; | 992 buildCounterGoogleIamV1Policy--; |
1218 return o; | 993 return o; |
1219 } | 994 } |
1220 | 995 |
1221 checkGoogleIamV1Policy(api.GoogleIamV1Policy o) { | 996 checkGoogleIamV1Policy(api.GoogleIamV1Policy o) { |
1222 buildCounterGoogleIamV1Policy++; | 997 buildCounterGoogleIamV1Policy++; |
1223 if (buildCounterGoogleIamV1Policy < 3) { | 998 if (buildCounterGoogleIamV1Policy < 3) { |
1224 checkUnnamed20(o.auditConfigs); | 999 checkUnnamed19(o.auditConfigs); |
1225 checkUnnamed21(o.bindings); | 1000 checkUnnamed20(o.bindings); |
1226 unittest.expect(o.etag, unittest.equals('foo')); | 1001 unittest.expect(o.etag, unittest.equals('foo')); |
1227 unittest.expect(o.iamOwned, unittest.isTrue); | 1002 unittest.expect(o.iamOwned, unittest.isTrue); |
1228 checkUnnamed22(o.rules); | |
1229 unittest.expect(o.version, unittest.equals(42)); | 1003 unittest.expect(o.version, unittest.equals(42)); |
1230 } | 1004 } |
1231 buildCounterGoogleIamV1Policy--; | 1005 buildCounterGoogleIamV1Policy--; |
1232 } | 1006 } |
1233 | 1007 |
1234 buildUnnamed23() { | |
1235 var o = new core.List<api.GoogleIamV1Condition>(); | |
1236 o.add(buildGoogleIamV1Condition()); | |
1237 o.add(buildGoogleIamV1Condition()); | |
1238 return o; | |
1239 } | |
1240 | |
1241 checkUnnamed23(core.List<api.GoogleIamV1Condition> o) { | |
1242 unittest.expect(o, unittest.hasLength(2)); | |
1243 checkGoogleIamV1Condition(o[0]); | |
1244 checkGoogleIamV1Condition(o[1]); | |
1245 } | |
1246 | |
1247 buildUnnamed24() { | |
1248 var o = new core.List<core.String>(); | |
1249 o.add("foo"); | |
1250 o.add("foo"); | |
1251 return o; | |
1252 } | |
1253 | |
1254 checkUnnamed24(core.List<core.String> o) { | |
1255 unittest.expect(o, unittest.hasLength(2)); | |
1256 unittest.expect(o[0], unittest.equals('foo')); | |
1257 unittest.expect(o[1], unittest.equals('foo')); | |
1258 } | |
1259 | |
1260 buildUnnamed25() { | |
1261 var o = new core.List<api.GoogleIamV1LogConfig>(); | |
1262 o.add(buildGoogleIamV1LogConfig()); | |
1263 o.add(buildGoogleIamV1LogConfig()); | |
1264 return o; | |
1265 } | |
1266 | |
1267 checkUnnamed25(core.List<api.GoogleIamV1LogConfig> o) { | |
1268 unittest.expect(o, unittest.hasLength(2)); | |
1269 checkGoogleIamV1LogConfig(o[0]); | |
1270 checkGoogleIamV1LogConfig(o[1]); | |
1271 } | |
1272 | |
1273 buildUnnamed26() { | |
1274 var o = new core.List<core.String>(); | |
1275 o.add("foo"); | |
1276 o.add("foo"); | |
1277 return o; | |
1278 } | |
1279 | |
1280 checkUnnamed26(core.List<core.String> o) { | |
1281 unittest.expect(o, unittest.hasLength(2)); | |
1282 unittest.expect(o[0], unittest.equals('foo')); | |
1283 unittest.expect(o[1], unittest.equals('foo')); | |
1284 } | |
1285 | |
1286 buildUnnamed27() { | |
1287 var o = new core.List<core.String>(); | |
1288 o.add("foo"); | |
1289 o.add("foo"); | |
1290 return o; | |
1291 } | |
1292 | |
1293 checkUnnamed27(core.List<core.String> o) { | |
1294 unittest.expect(o, unittest.hasLength(2)); | |
1295 unittest.expect(o[0], unittest.equals('foo')); | |
1296 unittest.expect(o[1], unittest.equals('foo')); | |
1297 } | |
1298 | |
1299 core.int buildCounterGoogleIamV1Rule = 0; | |
1300 buildGoogleIamV1Rule() { | |
1301 var o = new api.GoogleIamV1Rule(); | |
1302 buildCounterGoogleIamV1Rule++; | |
1303 if (buildCounterGoogleIamV1Rule < 3) { | |
1304 o.action = "foo"; | |
1305 o.conditions = buildUnnamed23(); | |
1306 o.description = "foo"; | |
1307 o.in_ = buildUnnamed24(); | |
1308 o.logConfig = buildUnnamed25(); | |
1309 o.notIn = buildUnnamed26(); | |
1310 o.permissions = buildUnnamed27(); | |
1311 } | |
1312 buildCounterGoogleIamV1Rule--; | |
1313 return o; | |
1314 } | |
1315 | |
1316 checkGoogleIamV1Rule(api.GoogleIamV1Rule o) { | |
1317 buildCounterGoogleIamV1Rule++; | |
1318 if (buildCounterGoogleIamV1Rule < 3) { | |
1319 unittest.expect(o.action, unittest.equals('foo')); | |
1320 checkUnnamed23(o.conditions); | |
1321 unittest.expect(o.description, unittest.equals('foo')); | |
1322 checkUnnamed24(o.in_); | |
1323 checkUnnamed25(o.logConfig); | |
1324 checkUnnamed26(o.notIn); | |
1325 checkUnnamed27(o.permissions); | |
1326 } | |
1327 buildCounterGoogleIamV1Rule--; | |
1328 } | |
1329 | |
1330 core.int buildCounterGoogleIamV1SetIamPolicyRequest = 0; | 1008 core.int buildCounterGoogleIamV1SetIamPolicyRequest = 0; |
1331 buildGoogleIamV1SetIamPolicyRequest() { | 1009 buildGoogleIamV1SetIamPolicyRequest() { |
1332 var o = new api.GoogleIamV1SetIamPolicyRequest(); | 1010 var o = new api.GoogleIamV1SetIamPolicyRequest(); |
1333 buildCounterGoogleIamV1SetIamPolicyRequest++; | 1011 buildCounterGoogleIamV1SetIamPolicyRequest++; |
1334 if (buildCounterGoogleIamV1SetIamPolicyRequest < 3) { | 1012 if (buildCounterGoogleIamV1SetIamPolicyRequest < 3) { |
1335 o.policy = buildGoogleIamV1Policy(); | 1013 o.policy = buildGoogleIamV1Policy(); |
1336 o.updateMask = "foo"; | 1014 o.updateMask = "foo"; |
1337 } | 1015 } |
1338 buildCounterGoogleIamV1SetIamPolicyRequest--; | 1016 buildCounterGoogleIamV1SetIamPolicyRequest--; |
1339 return o; | 1017 return o; |
1340 } | 1018 } |
1341 | 1019 |
1342 checkGoogleIamV1SetIamPolicyRequest(api.GoogleIamV1SetIamPolicyRequest o) { | 1020 checkGoogleIamV1SetIamPolicyRequest(api.GoogleIamV1SetIamPolicyRequest o) { |
1343 buildCounterGoogleIamV1SetIamPolicyRequest++; | 1021 buildCounterGoogleIamV1SetIamPolicyRequest++; |
1344 if (buildCounterGoogleIamV1SetIamPolicyRequest < 3) { | 1022 if (buildCounterGoogleIamV1SetIamPolicyRequest < 3) { |
1345 checkGoogleIamV1Policy(o.policy); | 1023 checkGoogleIamV1Policy(o.policy); |
1346 unittest.expect(o.updateMask, unittest.equals('foo')); | 1024 unittest.expect(o.updateMask, unittest.equals('foo')); |
1347 } | 1025 } |
1348 buildCounterGoogleIamV1SetIamPolicyRequest--; | 1026 buildCounterGoogleIamV1SetIamPolicyRequest--; |
1349 } | 1027 } |
1350 | 1028 |
1351 buildUnnamed28() { | 1029 buildUnnamed21() { |
1352 var o = new core.List<core.String>(); | 1030 var o = new core.List<core.String>(); |
1353 o.add("foo"); | 1031 o.add("foo"); |
1354 o.add("foo"); | 1032 o.add("foo"); |
1355 return o; | 1033 return o; |
1356 } | 1034 } |
1357 | 1035 |
1358 checkUnnamed28(core.List<core.String> o) { | 1036 checkUnnamed21(core.List<core.String> o) { |
1359 unittest.expect(o, unittest.hasLength(2)); | 1037 unittest.expect(o, unittest.hasLength(2)); |
1360 unittest.expect(o[0], unittest.equals('foo')); | 1038 unittest.expect(o[0], unittest.equals('foo')); |
1361 unittest.expect(o[1], unittest.equals('foo')); | 1039 unittest.expect(o[1], unittest.equals('foo')); |
1362 } | 1040 } |
1363 | 1041 |
1364 core.int buildCounterGoogleIamV1TestIamPermissionsRequest = 0; | 1042 core.int buildCounterGoogleIamV1TestIamPermissionsRequest = 0; |
1365 buildGoogleIamV1TestIamPermissionsRequest() { | 1043 buildGoogleIamV1TestIamPermissionsRequest() { |
1366 var o = new api.GoogleIamV1TestIamPermissionsRequest(); | 1044 var o = new api.GoogleIamV1TestIamPermissionsRequest(); |
1367 buildCounterGoogleIamV1TestIamPermissionsRequest++; | 1045 buildCounterGoogleIamV1TestIamPermissionsRequest++; |
1368 if (buildCounterGoogleIamV1TestIamPermissionsRequest < 3) { | 1046 if (buildCounterGoogleIamV1TestIamPermissionsRequest < 3) { |
1369 o.permissions = buildUnnamed28(); | 1047 o.permissions = buildUnnamed21(); |
1370 } | 1048 } |
1371 buildCounterGoogleIamV1TestIamPermissionsRequest--; | 1049 buildCounterGoogleIamV1TestIamPermissionsRequest--; |
1372 return o; | 1050 return o; |
1373 } | 1051 } |
1374 | 1052 |
1375 checkGoogleIamV1TestIamPermissionsRequest(api.GoogleIamV1TestIamPermissionsReque
st o) { | 1053 checkGoogleIamV1TestIamPermissionsRequest( |
| 1054 api.GoogleIamV1TestIamPermissionsRequest o) { |
1376 buildCounterGoogleIamV1TestIamPermissionsRequest++; | 1055 buildCounterGoogleIamV1TestIamPermissionsRequest++; |
1377 if (buildCounterGoogleIamV1TestIamPermissionsRequest < 3) { | 1056 if (buildCounterGoogleIamV1TestIamPermissionsRequest < 3) { |
1378 checkUnnamed28(o.permissions); | 1057 checkUnnamed21(o.permissions); |
1379 } | 1058 } |
1380 buildCounterGoogleIamV1TestIamPermissionsRequest--; | 1059 buildCounterGoogleIamV1TestIamPermissionsRequest--; |
1381 } | 1060 } |
1382 | 1061 |
1383 buildUnnamed29() { | 1062 buildUnnamed22() { |
1384 var o = new core.List<core.String>(); | 1063 var o = new core.List<core.String>(); |
1385 o.add("foo"); | 1064 o.add("foo"); |
1386 o.add("foo"); | 1065 o.add("foo"); |
1387 return o; | 1066 return o; |
1388 } | 1067 } |
1389 | 1068 |
1390 checkUnnamed29(core.List<core.String> o) { | 1069 checkUnnamed22(core.List<core.String> o) { |
1391 unittest.expect(o, unittest.hasLength(2)); | 1070 unittest.expect(o, unittest.hasLength(2)); |
1392 unittest.expect(o[0], unittest.equals('foo')); | 1071 unittest.expect(o[0], unittest.equals('foo')); |
1393 unittest.expect(o[1], unittest.equals('foo')); | 1072 unittest.expect(o[1], unittest.equals('foo')); |
1394 } | 1073 } |
1395 | 1074 |
1396 core.int buildCounterGoogleIamV1TestIamPermissionsResponse = 0; | 1075 core.int buildCounterGoogleIamV1TestIamPermissionsResponse = 0; |
1397 buildGoogleIamV1TestIamPermissionsResponse() { | 1076 buildGoogleIamV1TestIamPermissionsResponse() { |
1398 var o = new api.GoogleIamV1TestIamPermissionsResponse(); | 1077 var o = new api.GoogleIamV1TestIamPermissionsResponse(); |
1399 buildCounterGoogleIamV1TestIamPermissionsResponse++; | 1078 buildCounterGoogleIamV1TestIamPermissionsResponse++; |
1400 if (buildCounterGoogleIamV1TestIamPermissionsResponse < 3) { | 1079 if (buildCounterGoogleIamV1TestIamPermissionsResponse < 3) { |
1401 o.permissions = buildUnnamed29(); | 1080 o.permissions = buildUnnamed22(); |
1402 } | 1081 } |
1403 buildCounterGoogleIamV1TestIamPermissionsResponse--; | 1082 buildCounterGoogleIamV1TestIamPermissionsResponse--; |
1404 return o; | 1083 return o; |
1405 } | 1084 } |
1406 | 1085 |
1407 checkGoogleIamV1TestIamPermissionsResponse(api.GoogleIamV1TestIamPermissionsResp
onse o) { | 1086 checkGoogleIamV1TestIamPermissionsResponse( |
| 1087 api.GoogleIamV1TestIamPermissionsResponse o) { |
1408 buildCounterGoogleIamV1TestIamPermissionsResponse++; | 1088 buildCounterGoogleIamV1TestIamPermissionsResponse++; |
1409 if (buildCounterGoogleIamV1TestIamPermissionsResponse < 3) { | 1089 if (buildCounterGoogleIamV1TestIamPermissionsResponse < 3) { |
1410 checkUnnamed29(o.permissions); | 1090 checkUnnamed22(o.permissions); |
1411 } | 1091 } |
1412 buildCounterGoogleIamV1TestIamPermissionsResponse--; | 1092 buildCounterGoogleIamV1TestIamPermissionsResponse--; |
1413 } | 1093 } |
1414 | 1094 |
1415 buildUnnamed30() { | 1095 buildUnnamed23() { |
1416 var o = new core.List<api.GoogleLongrunningOperation>(); | 1096 var o = new core.List<api.GoogleLongrunningOperation>(); |
1417 o.add(buildGoogleLongrunningOperation()); | 1097 o.add(buildGoogleLongrunningOperation()); |
1418 o.add(buildGoogleLongrunningOperation()); | 1098 o.add(buildGoogleLongrunningOperation()); |
1419 return o; | 1099 return o; |
1420 } | 1100 } |
1421 | 1101 |
1422 checkUnnamed30(core.List<api.GoogleLongrunningOperation> o) { | 1102 checkUnnamed23(core.List<api.GoogleLongrunningOperation> o) { |
1423 unittest.expect(o, unittest.hasLength(2)); | 1103 unittest.expect(o, unittest.hasLength(2)); |
1424 checkGoogleLongrunningOperation(o[0]); | 1104 checkGoogleLongrunningOperation(o[0]); |
1425 checkGoogleLongrunningOperation(o[1]); | 1105 checkGoogleLongrunningOperation(o[1]); |
1426 } | 1106 } |
1427 | 1107 |
1428 core.int buildCounterGoogleLongrunningListOperationsResponse = 0; | 1108 core.int buildCounterGoogleLongrunningListOperationsResponse = 0; |
1429 buildGoogleLongrunningListOperationsResponse() { | 1109 buildGoogleLongrunningListOperationsResponse() { |
1430 var o = new api.GoogleLongrunningListOperationsResponse(); | 1110 var o = new api.GoogleLongrunningListOperationsResponse(); |
1431 buildCounterGoogleLongrunningListOperationsResponse++; | 1111 buildCounterGoogleLongrunningListOperationsResponse++; |
1432 if (buildCounterGoogleLongrunningListOperationsResponse < 3) { | 1112 if (buildCounterGoogleLongrunningListOperationsResponse < 3) { |
1433 o.nextPageToken = "foo"; | 1113 o.nextPageToken = "foo"; |
1434 o.operations = buildUnnamed30(); | 1114 o.operations = buildUnnamed23(); |
1435 } | 1115 } |
1436 buildCounterGoogleLongrunningListOperationsResponse--; | 1116 buildCounterGoogleLongrunningListOperationsResponse--; |
1437 return o; | 1117 return o; |
1438 } | 1118 } |
1439 | 1119 |
1440 checkGoogleLongrunningListOperationsResponse(api.GoogleLongrunningListOperations
Response o) { | 1120 checkGoogleLongrunningListOperationsResponse( |
| 1121 api.GoogleLongrunningListOperationsResponse o) { |
1441 buildCounterGoogleLongrunningListOperationsResponse++; | 1122 buildCounterGoogleLongrunningListOperationsResponse++; |
1442 if (buildCounterGoogleLongrunningListOperationsResponse < 3) { | 1123 if (buildCounterGoogleLongrunningListOperationsResponse < 3) { |
1443 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 1124 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
1444 checkUnnamed30(o.operations); | 1125 checkUnnamed23(o.operations); |
1445 } | 1126 } |
1446 buildCounterGoogleLongrunningListOperationsResponse--; | 1127 buildCounterGoogleLongrunningListOperationsResponse--; |
1447 } | 1128 } |
1448 | 1129 |
1449 buildUnnamed31() { | 1130 buildUnnamed24() { |
1450 var o = new core.Map<core.String, core.Object>(); | 1131 var o = new core.Map<core.String, core.Object>(); |
1451 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1132 o["x"] = { |
1452 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1133 'list': [1, 2, 3], |
| 1134 'bool': true, |
| 1135 'string': 'foo' |
| 1136 }; |
| 1137 o["y"] = { |
| 1138 'list': [1, 2, 3], |
| 1139 'bool': true, |
| 1140 'string': 'foo' |
| 1141 }; |
1453 return o; | 1142 return o; |
1454 } | 1143 } |
1455 | 1144 |
1456 checkUnnamed31(core.Map<core.String, core.Object> o) { | 1145 checkUnnamed24(core.Map<core.String, core.Object> o) { |
1457 unittest.expect(o, unittest.hasLength(2)); | 1146 unittest.expect(o, unittest.hasLength(2)); |
1458 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')); | 1147 var casted3 = (o["x"]) as core.Map; |
1459 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')); | 1148 unittest.expect(casted3, unittest.hasLength(3)); |
| 1149 unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); |
| 1150 unittest.expect(casted3["bool"], unittest.equals(true)); |
| 1151 unittest.expect(casted3["string"], unittest.equals('foo')); |
| 1152 var casted4 = (o["y"]) as core.Map; |
| 1153 unittest.expect(casted4, unittest.hasLength(3)); |
| 1154 unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); |
| 1155 unittest.expect(casted4["bool"], unittest.equals(true)); |
| 1156 unittest.expect(casted4["string"], unittest.equals('foo')); |
1460 } | 1157 } |
1461 | 1158 |
1462 buildUnnamed32() { | 1159 buildUnnamed25() { |
1463 var o = new core.Map<core.String, core.Object>(); | 1160 var o = new core.Map<core.String, core.Object>(); |
1464 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1161 o["x"] = { |
1465 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1162 'list': [1, 2, 3], |
| 1163 'bool': true, |
| 1164 'string': 'foo' |
| 1165 }; |
| 1166 o["y"] = { |
| 1167 'list': [1, 2, 3], |
| 1168 'bool': true, |
| 1169 'string': 'foo' |
| 1170 }; |
1466 return o; | 1171 return o; |
1467 } | 1172 } |
1468 | 1173 |
1469 checkUnnamed32(core.Map<core.String, core.Object> o) { | 1174 checkUnnamed25(core.Map<core.String, core.Object> o) { |
1470 unittest.expect(o, unittest.hasLength(2)); | 1175 unittest.expect(o, unittest.hasLength(2)); |
1471 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 1176 var casted5 = (o["x"]) as core.Map; |
1472 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 1177 unittest.expect(casted5, unittest.hasLength(3)); |
| 1178 unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); |
| 1179 unittest.expect(casted5["bool"], unittest.equals(true)); |
| 1180 unittest.expect(casted5["string"], unittest.equals('foo')); |
| 1181 var casted6 = (o["y"]) as core.Map; |
| 1182 unittest.expect(casted6, unittest.hasLength(3)); |
| 1183 unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); |
| 1184 unittest.expect(casted6["bool"], unittest.equals(true)); |
| 1185 unittest.expect(casted6["string"], unittest.equals('foo')); |
1473 } | 1186 } |
1474 | 1187 |
1475 core.int buildCounterGoogleLongrunningOperation = 0; | 1188 core.int buildCounterGoogleLongrunningOperation = 0; |
1476 buildGoogleLongrunningOperation() { | 1189 buildGoogleLongrunningOperation() { |
1477 var o = new api.GoogleLongrunningOperation(); | 1190 var o = new api.GoogleLongrunningOperation(); |
1478 buildCounterGoogleLongrunningOperation++; | 1191 buildCounterGoogleLongrunningOperation++; |
1479 if (buildCounterGoogleLongrunningOperation < 3) { | 1192 if (buildCounterGoogleLongrunningOperation < 3) { |
1480 o.done = true; | 1193 o.done = true; |
1481 o.error = buildGoogleRpcStatus(); | 1194 o.error = buildGoogleRpcStatus(); |
1482 o.metadata = buildUnnamed31(); | 1195 o.metadata = buildUnnamed24(); |
1483 o.name = "foo"; | 1196 o.name = "foo"; |
1484 o.response = buildUnnamed32(); | 1197 o.response = buildUnnamed25(); |
1485 } | 1198 } |
1486 buildCounterGoogleLongrunningOperation--; | 1199 buildCounterGoogleLongrunningOperation--; |
1487 return o; | 1200 return o; |
1488 } | 1201 } |
1489 | 1202 |
1490 checkGoogleLongrunningOperation(api.GoogleLongrunningOperation o) { | 1203 checkGoogleLongrunningOperation(api.GoogleLongrunningOperation o) { |
1491 buildCounterGoogleLongrunningOperation++; | 1204 buildCounterGoogleLongrunningOperation++; |
1492 if (buildCounterGoogleLongrunningOperation < 3) { | 1205 if (buildCounterGoogleLongrunningOperation < 3) { |
1493 unittest.expect(o.done, unittest.isTrue); | 1206 unittest.expect(o.done, unittest.isTrue); |
1494 checkGoogleRpcStatus(o.error); | 1207 checkGoogleRpcStatus(o.error); |
1495 checkUnnamed31(o.metadata); | 1208 checkUnnamed24(o.metadata); |
1496 unittest.expect(o.name, unittest.equals('foo')); | 1209 unittest.expect(o.name, unittest.equals('foo')); |
1497 checkUnnamed32(o.response); | 1210 checkUnnamed25(o.response); |
1498 } | 1211 } |
1499 buildCounterGoogleLongrunningOperation--; | 1212 buildCounterGoogleLongrunningOperation--; |
1500 } | 1213 } |
1501 | 1214 |
1502 core.int buildCounterGoogleProtobufEmpty = 0; | 1215 core.int buildCounterGoogleProtobufEmpty = 0; |
1503 buildGoogleProtobufEmpty() { | 1216 buildGoogleProtobufEmpty() { |
1504 var o = new api.GoogleProtobufEmpty(); | 1217 var o = new api.GoogleProtobufEmpty(); |
1505 buildCounterGoogleProtobufEmpty++; | 1218 buildCounterGoogleProtobufEmpty++; |
1506 if (buildCounterGoogleProtobufEmpty < 3) { | 1219 if (buildCounterGoogleProtobufEmpty < 3) {} |
1507 } | |
1508 buildCounterGoogleProtobufEmpty--; | 1220 buildCounterGoogleProtobufEmpty--; |
1509 return o; | 1221 return o; |
1510 } | 1222 } |
1511 | 1223 |
1512 checkGoogleProtobufEmpty(api.GoogleProtobufEmpty o) { | 1224 checkGoogleProtobufEmpty(api.GoogleProtobufEmpty o) { |
1513 buildCounterGoogleProtobufEmpty++; | 1225 buildCounterGoogleProtobufEmpty++; |
1514 if (buildCounterGoogleProtobufEmpty < 3) { | 1226 if (buildCounterGoogleProtobufEmpty < 3) {} |
1515 } | |
1516 buildCounterGoogleProtobufEmpty--; | 1227 buildCounterGoogleProtobufEmpty--; |
1517 } | 1228 } |
1518 | 1229 |
1519 buildUnnamed33() { | 1230 buildUnnamed26() { |
1520 var o = new core.Map<core.String, core.Object>(); | 1231 var o = new core.Map<core.String, core.Object>(); |
1521 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1232 o["x"] = { |
1522 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1233 'list': [1, 2, 3], |
| 1234 'bool': true, |
| 1235 'string': 'foo' |
| 1236 }; |
| 1237 o["y"] = { |
| 1238 'list': [1, 2, 3], |
| 1239 'bool': true, |
| 1240 'string': 'foo' |
| 1241 }; |
1523 return o; | 1242 return o; |
1524 } | 1243 } |
1525 | 1244 |
1526 checkUnnamed33(core.Map<core.String, core.Object> o) { | 1245 checkUnnamed26(core.Map<core.String, core.Object> o) { |
1527 unittest.expect(o, unittest.hasLength(2)); | 1246 unittest.expect(o, unittest.hasLength(2)); |
1528 var casted7 = (o["x"]) as core.Map; unittest.expect(casted7, unittest.hasLengt
h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"],
unittest.equals('foo')); | 1247 var casted7 = (o["x"]) as core.Map; |
1529 var casted8 = (o["y"]) as core.Map; unittest.expect(casted8, unittest.hasLengt
h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"],
unittest.equals('foo')); | 1248 unittest.expect(casted7, unittest.hasLength(3)); |
| 1249 unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); |
| 1250 unittest.expect(casted7["bool"], unittest.equals(true)); |
| 1251 unittest.expect(casted7["string"], unittest.equals('foo')); |
| 1252 var casted8 = (o["y"]) as core.Map; |
| 1253 unittest.expect(casted8, unittest.hasLength(3)); |
| 1254 unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); |
| 1255 unittest.expect(casted8["bool"], unittest.equals(true)); |
| 1256 unittest.expect(casted8["string"], unittest.equals('foo')); |
1530 } | 1257 } |
1531 | 1258 |
1532 buildUnnamed34() { | 1259 buildUnnamed27() { |
1533 var o = new core.List<core.Map<core.String, core.Object>>(); | 1260 var o = new core.List<core.Map<core.String, core.Object>>(); |
1534 o.add(buildUnnamed33()); | 1261 o.add(buildUnnamed26()); |
1535 o.add(buildUnnamed33()); | 1262 o.add(buildUnnamed26()); |
1536 return o; | 1263 return o; |
1537 } | 1264 } |
1538 | 1265 |
1539 checkUnnamed34(core.List<core.Map<core.String, core.Object>> o) { | 1266 checkUnnamed27(core.List<core.Map<core.String, core.Object>> o) { |
1540 unittest.expect(o, unittest.hasLength(2)); | 1267 unittest.expect(o, unittest.hasLength(2)); |
1541 checkUnnamed33(o[0]); | 1268 checkUnnamed26(o[0]); |
1542 checkUnnamed33(o[1]); | 1269 checkUnnamed26(o[1]); |
1543 } | 1270 } |
1544 | 1271 |
1545 core.int buildCounterGoogleRpcStatus = 0; | 1272 core.int buildCounterGoogleRpcStatus = 0; |
1546 buildGoogleRpcStatus() { | 1273 buildGoogleRpcStatus() { |
1547 var o = new api.GoogleRpcStatus(); | 1274 var o = new api.GoogleRpcStatus(); |
1548 buildCounterGoogleRpcStatus++; | 1275 buildCounterGoogleRpcStatus++; |
1549 if (buildCounterGoogleRpcStatus < 3) { | 1276 if (buildCounterGoogleRpcStatus < 3) { |
1550 o.code = 42; | 1277 o.code = 42; |
1551 o.details = buildUnnamed34(); | 1278 o.details = buildUnnamed27(); |
1552 o.message = "foo"; | 1279 o.message = "foo"; |
1553 } | 1280 } |
1554 buildCounterGoogleRpcStatus--; | 1281 buildCounterGoogleRpcStatus--; |
1555 return o; | 1282 return o; |
1556 } | 1283 } |
1557 | 1284 |
1558 checkGoogleRpcStatus(api.GoogleRpcStatus o) { | 1285 checkGoogleRpcStatus(api.GoogleRpcStatus o) { |
1559 buildCounterGoogleRpcStatus++; | 1286 buildCounterGoogleRpcStatus++; |
1560 if (buildCounterGoogleRpcStatus < 3) { | 1287 if (buildCounterGoogleRpcStatus < 3) { |
1561 unittest.expect(o.code, unittest.equals(42)); | 1288 unittest.expect(o.code, unittest.equals(42)); |
1562 checkUnnamed34(o.details); | 1289 checkUnnamed27(o.details); |
1563 unittest.expect(o.message, unittest.equals('foo')); | 1290 unittest.expect(o.message, unittest.equals('foo')); |
1564 } | 1291 } |
1565 buildCounterGoogleRpcStatus--; | 1292 buildCounterGoogleRpcStatus--; |
1566 } | 1293 } |
1567 | 1294 |
1568 core.int buildCounterGoogleTypeExpr = 0; | 1295 core.int buildCounterGoogleTypeExpr = 0; |
1569 buildGoogleTypeExpr() { | 1296 buildGoogleTypeExpr() { |
1570 var o = new api.GoogleTypeExpr(); | 1297 var o = new api.GoogleTypeExpr(); |
1571 buildCounterGoogleTypeExpr++; | 1298 buildCounterGoogleTypeExpr++; |
1572 if (buildCounterGoogleTypeExpr < 3) { | 1299 if (buildCounterGoogleTypeExpr < 3) { |
(...skipping 10 matching lines...) Expand all Loading... |
1583 buildCounterGoogleTypeExpr++; | 1310 buildCounterGoogleTypeExpr++; |
1584 if (buildCounterGoogleTypeExpr < 3) { | 1311 if (buildCounterGoogleTypeExpr < 3) { |
1585 unittest.expect(o.description, unittest.equals('foo')); | 1312 unittest.expect(o.description, unittest.equals('foo')); |
1586 unittest.expect(o.expression, unittest.equals('foo')); | 1313 unittest.expect(o.expression, unittest.equals('foo')); |
1587 unittest.expect(o.location, unittest.equals('foo')); | 1314 unittest.expect(o.location, unittest.equals('foo')); |
1588 unittest.expect(o.title, unittest.equals('foo')); | 1315 unittest.expect(o.title, unittest.equals('foo')); |
1589 } | 1316 } |
1590 buildCounterGoogleTypeExpr--; | 1317 buildCounterGoogleTypeExpr--; |
1591 } | 1318 } |
1592 | 1319 |
1593 | |
1594 main() { | 1320 main() { |
1595 unittest.group("obj-schema-GoogleApiHttpBody", () { | 1321 unittest.group("obj-schema-GoogleApiHttpBody", () { |
1596 unittest.test("to-json--from-json", () { | 1322 unittest.test("to-json--from-json", () { |
1597 var o = buildGoogleApiHttpBody(); | 1323 var o = buildGoogleApiHttpBody(); |
1598 var od = new api.GoogleApiHttpBody.fromJson(o.toJson()); | 1324 var od = new api.GoogleApiHttpBody.fromJson(o.toJson()); |
1599 checkGoogleApiHttpBody(od); | 1325 checkGoogleApiHttpBody(od); |
1600 }); | 1326 }); |
1601 }); | 1327 }); |
1602 | 1328 |
1603 | 1329 unittest.group( |
1604 unittest.group("obj-schema-GoogleCloudMlV1HyperparameterOutputHyperparameterMe
tric", () { | 1330 "obj-schema-GoogleCloudMlV1HyperparameterOutputHyperparameterMetric", () { |
1605 unittest.test("to-json--from-json", () { | 1331 unittest.test("to-json--from-json", () { |
1606 var o = buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); | 1332 var o = buildGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(); |
1607 var od = new api.GoogleCloudMlV1HyperparameterOutputHyperparameterMetric.f
romJson(o.toJson()); | 1333 var od = new api |
| 1334 .GoogleCloudMlV1HyperparameterOutputHyperparameterMetric.fromJson( |
| 1335 o.toJson()); |
1608 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(od); | 1336 checkGoogleCloudMlV1HyperparameterOutputHyperparameterMetric(od); |
1609 }); | 1337 }); |
1610 }); | 1338 }); |
1611 | 1339 |
1612 | |
1613 unittest.group("obj-schema-GoogleCloudMlV1AutoScaling", () { | 1340 unittest.group("obj-schema-GoogleCloudMlV1AutoScaling", () { |
1614 unittest.test("to-json--from-json", () { | 1341 unittest.test("to-json--from-json", () { |
1615 var o = buildGoogleCloudMlV1AutoScaling(); | 1342 var o = buildGoogleCloudMlV1AutoScaling(); |
1616 var od = new api.GoogleCloudMlV1AutoScaling.fromJson(o.toJson()); | 1343 var od = new api.GoogleCloudMlV1AutoScaling.fromJson(o.toJson()); |
1617 checkGoogleCloudMlV1AutoScaling(od); | 1344 checkGoogleCloudMlV1AutoScaling(od); |
1618 }); | 1345 }); |
1619 }); | 1346 }); |
1620 | 1347 |
1621 | |
1622 unittest.group("obj-schema-GoogleCloudMlV1CancelJobRequest", () { | 1348 unittest.group("obj-schema-GoogleCloudMlV1CancelJobRequest", () { |
1623 unittest.test("to-json--from-json", () { | 1349 unittest.test("to-json--from-json", () { |
1624 var o = buildGoogleCloudMlV1CancelJobRequest(); | 1350 var o = buildGoogleCloudMlV1CancelJobRequest(); |
1625 var od = new api.GoogleCloudMlV1CancelJobRequest.fromJson(o.toJson()); | 1351 var od = new api.GoogleCloudMlV1CancelJobRequest.fromJson(o.toJson()); |
1626 checkGoogleCloudMlV1CancelJobRequest(od); | 1352 checkGoogleCloudMlV1CancelJobRequest(od); |
1627 }); | 1353 }); |
1628 }); | 1354 }); |
1629 | 1355 |
1630 | |
1631 unittest.group("obj-schema-GoogleCloudMlV1GetConfigResponse", () { | 1356 unittest.group("obj-schema-GoogleCloudMlV1GetConfigResponse", () { |
1632 unittest.test("to-json--from-json", () { | 1357 unittest.test("to-json--from-json", () { |
1633 var o = buildGoogleCloudMlV1GetConfigResponse(); | 1358 var o = buildGoogleCloudMlV1GetConfigResponse(); |
1634 var od = new api.GoogleCloudMlV1GetConfigResponse.fromJson(o.toJson()); | 1359 var od = new api.GoogleCloudMlV1GetConfigResponse.fromJson(o.toJson()); |
1635 checkGoogleCloudMlV1GetConfigResponse(od); | 1360 checkGoogleCloudMlV1GetConfigResponse(od); |
1636 }); | 1361 }); |
1637 }); | 1362 }); |
1638 | 1363 |
1639 | |
1640 unittest.group("obj-schema-GoogleCloudMlV1HyperparameterOutput", () { | 1364 unittest.group("obj-schema-GoogleCloudMlV1HyperparameterOutput", () { |
1641 unittest.test("to-json--from-json", () { | 1365 unittest.test("to-json--from-json", () { |
1642 var o = buildGoogleCloudMlV1HyperparameterOutput(); | 1366 var o = buildGoogleCloudMlV1HyperparameterOutput(); |
1643 var od = new api.GoogleCloudMlV1HyperparameterOutput.fromJson(o.toJson()); | 1367 var od = new api.GoogleCloudMlV1HyperparameterOutput.fromJson(o.toJson()); |
1644 checkGoogleCloudMlV1HyperparameterOutput(od); | 1368 checkGoogleCloudMlV1HyperparameterOutput(od); |
1645 }); | 1369 }); |
1646 }); | 1370 }); |
1647 | 1371 |
1648 | |
1649 unittest.group("obj-schema-GoogleCloudMlV1HyperparameterSpec", () { | 1372 unittest.group("obj-schema-GoogleCloudMlV1HyperparameterSpec", () { |
1650 unittest.test("to-json--from-json", () { | 1373 unittest.test("to-json--from-json", () { |
1651 var o = buildGoogleCloudMlV1HyperparameterSpec(); | 1374 var o = buildGoogleCloudMlV1HyperparameterSpec(); |
1652 var od = new api.GoogleCloudMlV1HyperparameterSpec.fromJson(o.toJson()); | 1375 var od = new api.GoogleCloudMlV1HyperparameterSpec.fromJson(o.toJson()); |
1653 checkGoogleCloudMlV1HyperparameterSpec(od); | 1376 checkGoogleCloudMlV1HyperparameterSpec(od); |
1654 }); | 1377 }); |
1655 }); | 1378 }); |
1656 | 1379 |
1657 | |
1658 unittest.group("obj-schema-GoogleCloudMlV1Job", () { | 1380 unittest.group("obj-schema-GoogleCloudMlV1Job", () { |
1659 unittest.test("to-json--from-json", () { | 1381 unittest.test("to-json--from-json", () { |
1660 var o = buildGoogleCloudMlV1Job(); | 1382 var o = buildGoogleCloudMlV1Job(); |
1661 var od = new api.GoogleCloudMlV1Job.fromJson(o.toJson()); | 1383 var od = new api.GoogleCloudMlV1Job.fromJson(o.toJson()); |
1662 checkGoogleCloudMlV1Job(od); | 1384 checkGoogleCloudMlV1Job(od); |
1663 }); | 1385 }); |
1664 }); | 1386 }); |
1665 | 1387 |
1666 | |
1667 unittest.group("obj-schema-GoogleCloudMlV1ListJobsResponse", () { | 1388 unittest.group("obj-schema-GoogleCloudMlV1ListJobsResponse", () { |
1668 unittest.test("to-json--from-json", () { | 1389 unittest.test("to-json--from-json", () { |
1669 var o = buildGoogleCloudMlV1ListJobsResponse(); | 1390 var o = buildGoogleCloudMlV1ListJobsResponse(); |
1670 var od = new api.GoogleCloudMlV1ListJobsResponse.fromJson(o.toJson()); | 1391 var od = new api.GoogleCloudMlV1ListJobsResponse.fromJson(o.toJson()); |
1671 checkGoogleCloudMlV1ListJobsResponse(od); | 1392 checkGoogleCloudMlV1ListJobsResponse(od); |
1672 }); | 1393 }); |
1673 }); | 1394 }); |
1674 | 1395 |
1675 | |
1676 unittest.group("obj-schema-GoogleCloudMlV1ListModelsResponse", () { | 1396 unittest.group("obj-schema-GoogleCloudMlV1ListModelsResponse", () { |
1677 unittest.test("to-json--from-json", () { | 1397 unittest.test("to-json--from-json", () { |
1678 var o = buildGoogleCloudMlV1ListModelsResponse(); | 1398 var o = buildGoogleCloudMlV1ListModelsResponse(); |
1679 var od = new api.GoogleCloudMlV1ListModelsResponse.fromJson(o.toJson()); | 1399 var od = new api.GoogleCloudMlV1ListModelsResponse.fromJson(o.toJson()); |
1680 checkGoogleCloudMlV1ListModelsResponse(od); | 1400 checkGoogleCloudMlV1ListModelsResponse(od); |
1681 }); | 1401 }); |
1682 }); | 1402 }); |
1683 | 1403 |
1684 | |
1685 unittest.group("obj-schema-GoogleCloudMlV1ListVersionsResponse", () { | 1404 unittest.group("obj-schema-GoogleCloudMlV1ListVersionsResponse", () { |
1686 unittest.test("to-json--from-json", () { | 1405 unittest.test("to-json--from-json", () { |
1687 var o = buildGoogleCloudMlV1ListVersionsResponse(); | 1406 var o = buildGoogleCloudMlV1ListVersionsResponse(); |
1688 var od = new api.GoogleCloudMlV1ListVersionsResponse.fromJson(o.toJson()); | 1407 var od = new api.GoogleCloudMlV1ListVersionsResponse.fromJson(o.toJson()); |
1689 checkGoogleCloudMlV1ListVersionsResponse(od); | 1408 checkGoogleCloudMlV1ListVersionsResponse(od); |
1690 }); | 1409 }); |
1691 }); | 1410 }); |
1692 | 1411 |
1693 | |
1694 unittest.group("obj-schema-GoogleCloudMlV1ManualScaling", () { | 1412 unittest.group("obj-schema-GoogleCloudMlV1ManualScaling", () { |
1695 unittest.test("to-json--from-json", () { | 1413 unittest.test("to-json--from-json", () { |
1696 var o = buildGoogleCloudMlV1ManualScaling(); | 1414 var o = buildGoogleCloudMlV1ManualScaling(); |
1697 var od = new api.GoogleCloudMlV1ManualScaling.fromJson(o.toJson()); | 1415 var od = new api.GoogleCloudMlV1ManualScaling.fromJson(o.toJson()); |
1698 checkGoogleCloudMlV1ManualScaling(od); | 1416 checkGoogleCloudMlV1ManualScaling(od); |
1699 }); | 1417 }); |
1700 }); | 1418 }); |
1701 | 1419 |
1702 | |
1703 unittest.group("obj-schema-GoogleCloudMlV1Model", () { | 1420 unittest.group("obj-schema-GoogleCloudMlV1Model", () { |
1704 unittest.test("to-json--from-json", () { | 1421 unittest.test("to-json--from-json", () { |
1705 var o = buildGoogleCloudMlV1Model(); | 1422 var o = buildGoogleCloudMlV1Model(); |
1706 var od = new api.GoogleCloudMlV1Model.fromJson(o.toJson()); | 1423 var od = new api.GoogleCloudMlV1Model.fromJson(o.toJson()); |
1707 checkGoogleCloudMlV1Model(od); | 1424 checkGoogleCloudMlV1Model(od); |
1708 }); | 1425 }); |
1709 }); | 1426 }); |
1710 | 1427 |
1711 | |
1712 unittest.group("obj-schema-GoogleCloudMlV1OperationMetadata", () { | 1428 unittest.group("obj-schema-GoogleCloudMlV1OperationMetadata", () { |
1713 unittest.test("to-json--from-json", () { | 1429 unittest.test("to-json--from-json", () { |
1714 var o = buildGoogleCloudMlV1OperationMetadata(); | 1430 var o = buildGoogleCloudMlV1OperationMetadata(); |
1715 var od = new api.GoogleCloudMlV1OperationMetadata.fromJson(o.toJson()); | 1431 var od = new api.GoogleCloudMlV1OperationMetadata.fromJson(o.toJson()); |
1716 checkGoogleCloudMlV1OperationMetadata(od); | 1432 checkGoogleCloudMlV1OperationMetadata(od); |
1717 }); | 1433 }); |
1718 }); | 1434 }); |
1719 | 1435 |
1720 | |
1721 unittest.group("obj-schema-GoogleCloudMlV1ParameterSpec", () { | 1436 unittest.group("obj-schema-GoogleCloudMlV1ParameterSpec", () { |
1722 unittest.test("to-json--from-json", () { | 1437 unittest.test("to-json--from-json", () { |
1723 var o = buildGoogleCloudMlV1ParameterSpec(); | 1438 var o = buildGoogleCloudMlV1ParameterSpec(); |
1724 var od = new api.GoogleCloudMlV1ParameterSpec.fromJson(o.toJson()); | 1439 var od = new api.GoogleCloudMlV1ParameterSpec.fromJson(o.toJson()); |
1725 checkGoogleCloudMlV1ParameterSpec(od); | 1440 checkGoogleCloudMlV1ParameterSpec(od); |
1726 }); | 1441 }); |
1727 }); | 1442 }); |
1728 | 1443 |
1729 | |
1730 unittest.group("obj-schema-GoogleCloudMlV1PredictRequest", () { | 1444 unittest.group("obj-schema-GoogleCloudMlV1PredictRequest", () { |
1731 unittest.test("to-json--from-json", () { | 1445 unittest.test("to-json--from-json", () { |
1732 var o = buildGoogleCloudMlV1PredictRequest(); | 1446 var o = buildGoogleCloudMlV1PredictRequest(); |
1733 var od = new api.GoogleCloudMlV1PredictRequest.fromJson(o.toJson()); | 1447 var od = new api.GoogleCloudMlV1PredictRequest.fromJson(o.toJson()); |
1734 checkGoogleCloudMlV1PredictRequest(od); | 1448 checkGoogleCloudMlV1PredictRequest(od); |
1735 }); | 1449 }); |
1736 }); | 1450 }); |
1737 | 1451 |
1738 | |
1739 unittest.group("obj-schema-GoogleCloudMlV1PredictionInput", () { | 1452 unittest.group("obj-schema-GoogleCloudMlV1PredictionInput", () { |
1740 unittest.test("to-json--from-json", () { | 1453 unittest.test("to-json--from-json", () { |
1741 var o = buildGoogleCloudMlV1PredictionInput(); | 1454 var o = buildGoogleCloudMlV1PredictionInput(); |
1742 var od = new api.GoogleCloudMlV1PredictionInput.fromJson(o.toJson()); | 1455 var od = new api.GoogleCloudMlV1PredictionInput.fromJson(o.toJson()); |
1743 checkGoogleCloudMlV1PredictionInput(od); | 1456 checkGoogleCloudMlV1PredictionInput(od); |
1744 }); | 1457 }); |
1745 }); | 1458 }); |
1746 | 1459 |
1747 | |
1748 unittest.group("obj-schema-GoogleCloudMlV1PredictionOutput", () { | 1460 unittest.group("obj-schema-GoogleCloudMlV1PredictionOutput", () { |
1749 unittest.test("to-json--from-json", () { | 1461 unittest.test("to-json--from-json", () { |
1750 var o = buildGoogleCloudMlV1PredictionOutput(); | 1462 var o = buildGoogleCloudMlV1PredictionOutput(); |
1751 var od = new api.GoogleCloudMlV1PredictionOutput.fromJson(o.toJson()); | 1463 var od = new api.GoogleCloudMlV1PredictionOutput.fromJson(o.toJson()); |
1752 checkGoogleCloudMlV1PredictionOutput(od); | 1464 checkGoogleCloudMlV1PredictionOutput(od); |
1753 }); | 1465 }); |
1754 }); | 1466 }); |
1755 | 1467 |
1756 | |
1757 unittest.group("obj-schema-GoogleCloudMlV1SetDefaultVersionRequest", () { | 1468 unittest.group("obj-schema-GoogleCloudMlV1SetDefaultVersionRequest", () { |
1758 unittest.test("to-json--from-json", () { | 1469 unittest.test("to-json--from-json", () { |
1759 var o = buildGoogleCloudMlV1SetDefaultVersionRequest(); | 1470 var o = buildGoogleCloudMlV1SetDefaultVersionRequest(); |
1760 var od = new api.GoogleCloudMlV1SetDefaultVersionRequest.fromJson(o.toJson
()); | 1471 var od = |
| 1472 new api.GoogleCloudMlV1SetDefaultVersionRequest.fromJson(o.toJson()); |
1761 checkGoogleCloudMlV1SetDefaultVersionRequest(od); | 1473 checkGoogleCloudMlV1SetDefaultVersionRequest(od); |
1762 }); | 1474 }); |
1763 }); | 1475 }); |
1764 | 1476 |
1765 | |
1766 unittest.group("obj-schema-GoogleCloudMlV1TrainingInput", () { | 1477 unittest.group("obj-schema-GoogleCloudMlV1TrainingInput", () { |
1767 unittest.test("to-json--from-json", () { | 1478 unittest.test("to-json--from-json", () { |
1768 var o = buildGoogleCloudMlV1TrainingInput(); | 1479 var o = buildGoogleCloudMlV1TrainingInput(); |
1769 var od = new api.GoogleCloudMlV1TrainingInput.fromJson(o.toJson()); | 1480 var od = new api.GoogleCloudMlV1TrainingInput.fromJson(o.toJson()); |
1770 checkGoogleCloudMlV1TrainingInput(od); | 1481 checkGoogleCloudMlV1TrainingInput(od); |
1771 }); | 1482 }); |
1772 }); | 1483 }); |
1773 | 1484 |
1774 | |
1775 unittest.group("obj-schema-GoogleCloudMlV1TrainingOutput", () { | 1485 unittest.group("obj-schema-GoogleCloudMlV1TrainingOutput", () { |
1776 unittest.test("to-json--from-json", () { | 1486 unittest.test("to-json--from-json", () { |
1777 var o = buildGoogleCloudMlV1TrainingOutput(); | 1487 var o = buildGoogleCloudMlV1TrainingOutput(); |
1778 var od = new api.GoogleCloudMlV1TrainingOutput.fromJson(o.toJson()); | 1488 var od = new api.GoogleCloudMlV1TrainingOutput.fromJson(o.toJson()); |
1779 checkGoogleCloudMlV1TrainingOutput(od); | 1489 checkGoogleCloudMlV1TrainingOutput(od); |
1780 }); | 1490 }); |
1781 }); | 1491 }); |
1782 | 1492 |
1783 | |
1784 unittest.group("obj-schema-GoogleCloudMlV1Version", () { | 1493 unittest.group("obj-schema-GoogleCloudMlV1Version", () { |
1785 unittest.test("to-json--from-json", () { | 1494 unittest.test("to-json--from-json", () { |
1786 var o = buildGoogleCloudMlV1Version(); | 1495 var o = buildGoogleCloudMlV1Version(); |
1787 var od = new api.GoogleCloudMlV1Version.fromJson(o.toJson()); | 1496 var od = new api.GoogleCloudMlV1Version.fromJson(o.toJson()); |
1788 checkGoogleCloudMlV1Version(od); | 1497 checkGoogleCloudMlV1Version(od); |
1789 }); | 1498 }); |
1790 }); | 1499 }); |
1791 | 1500 |
1792 | |
1793 unittest.group("obj-schema-GoogleCloudMlV1beta1AutoScaling", () { | |
1794 unittest.test("to-json--from-json", () { | |
1795 var o = buildGoogleCloudMlV1beta1AutoScaling(); | |
1796 var od = new api.GoogleCloudMlV1beta1AutoScaling.fromJson(o.toJson()); | |
1797 checkGoogleCloudMlV1beta1AutoScaling(od); | |
1798 }); | |
1799 }); | |
1800 | |
1801 | |
1802 unittest.group("obj-schema-GoogleCloudMlV1beta1ManualScaling", () { | |
1803 unittest.test("to-json--from-json", () { | |
1804 var o = buildGoogleCloudMlV1beta1ManualScaling(); | |
1805 var od = new api.GoogleCloudMlV1beta1ManualScaling.fromJson(o.toJson()); | |
1806 checkGoogleCloudMlV1beta1ManualScaling(od); | |
1807 }); | |
1808 }); | |
1809 | |
1810 | |
1811 unittest.group("obj-schema-GoogleCloudMlV1beta1OperationMetadata", () { | |
1812 unittest.test("to-json--from-json", () { | |
1813 var o = buildGoogleCloudMlV1beta1OperationMetadata(); | |
1814 var od = new api.GoogleCloudMlV1beta1OperationMetadata.fromJson(o.toJson()
); | |
1815 checkGoogleCloudMlV1beta1OperationMetadata(od); | |
1816 }); | |
1817 }); | |
1818 | |
1819 | |
1820 unittest.group("obj-schema-GoogleCloudMlV1beta1Version", () { | |
1821 unittest.test("to-json--from-json", () { | |
1822 var o = buildGoogleCloudMlV1beta1Version(); | |
1823 var od = new api.GoogleCloudMlV1beta1Version.fromJson(o.toJson()); | |
1824 checkGoogleCloudMlV1beta1Version(od); | |
1825 }); | |
1826 }); | |
1827 | |
1828 | |
1829 unittest.group("obj-schema-GoogleIamV1LogConfigCloudAuditOptions", () { | |
1830 unittest.test("to-json--from-json", () { | |
1831 var o = buildGoogleIamV1LogConfigCloudAuditOptions(); | |
1832 var od = new api.GoogleIamV1LogConfigCloudAuditOptions.fromJson(o.toJson()
); | |
1833 checkGoogleIamV1LogConfigCloudAuditOptions(od); | |
1834 }); | |
1835 }); | |
1836 | |
1837 | |
1838 unittest.group("obj-schema-GoogleIamV1LogConfigCounterOptions", () { | |
1839 unittest.test("to-json--from-json", () { | |
1840 var o = buildGoogleIamV1LogConfigCounterOptions(); | |
1841 var od = new api.GoogleIamV1LogConfigCounterOptions.fromJson(o.toJson()); | |
1842 checkGoogleIamV1LogConfigCounterOptions(od); | |
1843 }); | |
1844 }); | |
1845 | |
1846 | |
1847 unittest.group("obj-schema-GoogleIamV1LogConfigDataAccessOptions", () { | |
1848 unittest.test("to-json--from-json", () { | |
1849 var o = buildGoogleIamV1LogConfigDataAccessOptions(); | |
1850 var od = new api.GoogleIamV1LogConfigDataAccessOptions.fromJson(o.toJson()
); | |
1851 checkGoogleIamV1LogConfigDataAccessOptions(od); | |
1852 }); | |
1853 }); | |
1854 | |
1855 | |
1856 unittest.group("obj-schema-GoogleIamV1AuditConfig", () { | 1501 unittest.group("obj-schema-GoogleIamV1AuditConfig", () { |
1857 unittest.test("to-json--from-json", () { | 1502 unittest.test("to-json--from-json", () { |
1858 var o = buildGoogleIamV1AuditConfig(); | 1503 var o = buildGoogleIamV1AuditConfig(); |
1859 var od = new api.GoogleIamV1AuditConfig.fromJson(o.toJson()); | 1504 var od = new api.GoogleIamV1AuditConfig.fromJson(o.toJson()); |
1860 checkGoogleIamV1AuditConfig(od); | 1505 checkGoogleIamV1AuditConfig(od); |
1861 }); | 1506 }); |
1862 }); | 1507 }); |
1863 | 1508 |
1864 | |
1865 unittest.group("obj-schema-GoogleIamV1AuditLogConfig", () { | 1509 unittest.group("obj-schema-GoogleIamV1AuditLogConfig", () { |
1866 unittest.test("to-json--from-json", () { | 1510 unittest.test("to-json--from-json", () { |
1867 var o = buildGoogleIamV1AuditLogConfig(); | 1511 var o = buildGoogleIamV1AuditLogConfig(); |
1868 var od = new api.GoogleIamV1AuditLogConfig.fromJson(o.toJson()); | 1512 var od = new api.GoogleIamV1AuditLogConfig.fromJson(o.toJson()); |
1869 checkGoogleIamV1AuditLogConfig(od); | 1513 checkGoogleIamV1AuditLogConfig(od); |
1870 }); | 1514 }); |
1871 }); | 1515 }); |
1872 | 1516 |
1873 | |
1874 unittest.group("obj-schema-GoogleIamV1Binding", () { | 1517 unittest.group("obj-schema-GoogleIamV1Binding", () { |
1875 unittest.test("to-json--from-json", () { | 1518 unittest.test("to-json--from-json", () { |
1876 var o = buildGoogleIamV1Binding(); | 1519 var o = buildGoogleIamV1Binding(); |
1877 var od = new api.GoogleIamV1Binding.fromJson(o.toJson()); | 1520 var od = new api.GoogleIamV1Binding.fromJson(o.toJson()); |
1878 checkGoogleIamV1Binding(od); | 1521 checkGoogleIamV1Binding(od); |
1879 }); | 1522 }); |
1880 }); | 1523 }); |
1881 | 1524 |
1882 | |
1883 unittest.group("obj-schema-GoogleIamV1Condition", () { | |
1884 unittest.test("to-json--from-json", () { | |
1885 var o = buildGoogleIamV1Condition(); | |
1886 var od = new api.GoogleIamV1Condition.fromJson(o.toJson()); | |
1887 checkGoogleIamV1Condition(od); | |
1888 }); | |
1889 }); | |
1890 | |
1891 | |
1892 unittest.group("obj-schema-GoogleIamV1LogConfig", () { | |
1893 unittest.test("to-json--from-json", () { | |
1894 var o = buildGoogleIamV1LogConfig(); | |
1895 var od = new api.GoogleIamV1LogConfig.fromJson(o.toJson()); | |
1896 checkGoogleIamV1LogConfig(od); | |
1897 }); | |
1898 }); | |
1899 | |
1900 | |
1901 unittest.group("obj-schema-GoogleIamV1Policy", () { | 1525 unittest.group("obj-schema-GoogleIamV1Policy", () { |
1902 unittest.test("to-json--from-json", () { | 1526 unittest.test("to-json--from-json", () { |
1903 var o = buildGoogleIamV1Policy(); | 1527 var o = buildGoogleIamV1Policy(); |
1904 var od = new api.GoogleIamV1Policy.fromJson(o.toJson()); | 1528 var od = new api.GoogleIamV1Policy.fromJson(o.toJson()); |
1905 checkGoogleIamV1Policy(od); | 1529 checkGoogleIamV1Policy(od); |
1906 }); | 1530 }); |
1907 }); | 1531 }); |
1908 | 1532 |
1909 | |
1910 unittest.group("obj-schema-GoogleIamV1Rule", () { | |
1911 unittest.test("to-json--from-json", () { | |
1912 var o = buildGoogleIamV1Rule(); | |
1913 var od = new api.GoogleIamV1Rule.fromJson(o.toJson()); | |
1914 checkGoogleIamV1Rule(od); | |
1915 }); | |
1916 }); | |
1917 | |
1918 | |
1919 unittest.group("obj-schema-GoogleIamV1SetIamPolicyRequest", () { | 1533 unittest.group("obj-schema-GoogleIamV1SetIamPolicyRequest", () { |
1920 unittest.test("to-json--from-json", () { | 1534 unittest.test("to-json--from-json", () { |
1921 var o = buildGoogleIamV1SetIamPolicyRequest(); | 1535 var o = buildGoogleIamV1SetIamPolicyRequest(); |
1922 var od = new api.GoogleIamV1SetIamPolicyRequest.fromJson(o.toJson()); | 1536 var od = new api.GoogleIamV1SetIamPolicyRequest.fromJson(o.toJson()); |
1923 checkGoogleIamV1SetIamPolicyRequest(od); | 1537 checkGoogleIamV1SetIamPolicyRequest(od); |
1924 }); | 1538 }); |
1925 }); | 1539 }); |
1926 | 1540 |
1927 | |
1928 unittest.group("obj-schema-GoogleIamV1TestIamPermissionsRequest", () { | 1541 unittest.group("obj-schema-GoogleIamV1TestIamPermissionsRequest", () { |
1929 unittest.test("to-json--from-json", () { | 1542 unittest.test("to-json--from-json", () { |
1930 var o = buildGoogleIamV1TestIamPermissionsRequest(); | 1543 var o = buildGoogleIamV1TestIamPermissionsRequest(); |
1931 var od = new api.GoogleIamV1TestIamPermissionsRequest.fromJson(o.toJson())
; | 1544 var od = |
| 1545 new api.GoogleIamV1TestIamPermissionsRequest.fromJson(o.toJson()); |
1932 checkGoogleIamV1TestIamPermissionsRequest(od); | 1546 checkGoogleIamV1TestIamPermissionsRequest(od); |
1933 }); | 1547 }); |
1934 }); | 1548 }); |
1935 | 1549 |
1936 | |
1937 unittest.group("obj-schema-GoogleIamV1TestIamPermissionsResponse", () { | 1550 unittest.group("obj-schema-GoogleIamV1TestIamPermissionsResponse", () { |
1938 unittest.test("to-json--from-json", () { | 1551 unittest.test("to-json--from-json", () { |
1939 var o = buildGoogleIamV1TestIamPermissionsResponse(); | 1552 var o = buildGoogleIamV1TestIamPermissionsResponse(); |
1940 var od = new api.GoogleIamV1TestIamPermissionsResponse.fromJson(o.toJson()
); | 1553 var od = |
| 1554 new api.GoogleIamV1TestIamPermissionsResponse.fromJson(o.toJson()); |
1941 checkGoogleIamV1TestIamPermissionsResponse(od); | 1555 checkGoogleIamV1TestIamPermissionsResponse(od); |
1942 }); | 1556 }); |
1943 }); | 1557 }); |
1944 | 1558 |
1945 | |
1946 unittest.group("obj-schema-GoogleLongrunningListOperationsResponse", () { | 1559 unittest.group("obj-schema-GoogleLongrunningListOperationsResponse", () { |
1947 unittest.test("to-json--from-json", () { | 1560 unittest.test("to-json--from-json", () { |
1948 var o = buildGoogleLongrunningListOperationsResponse(); | 1561 var o = buildGoogleLongrunningListOperationsResponse(); |
1949 var od = new api.GoogleLongrunningListOperationsResponse.fromJson(o.toJson
()); | 1562 var od = |
| 1563 new api.GoogleLongrunningListOperationsResponse.fromJson(o.toJson()); |
1950 checkGoogleLongrunningListOperationsResponse(od); | 1564 checkGoogleLongrunningListOperationsResponse(od); |
1951 }); | 1565 }); |
1952 }); | 1566 }); |
1953 | 1567 |
1954 | |
1955 unittest.group("obj-schema-GoogleLongrunningOperation", () { | 1568 unittest.group("obj-schema-GoogleLongrunningOperation", () { |
1956 unittest.test("to-json--from-json", () { | 1569 unittest.test("to-json--from-json", () { |
1957 var o = buildGoogleLongrunningOperation(); | 1570 var o = buildGoogleLongrunningOperation(); |
1958 var od = new api.GoogleLongrunningOperation.fromJson(o.toJson()); | 1571 var od = new api.GoogleLongrunningOperation.fromJson(o.toJson()); |
1959 checkGoogleLongrunningOperation(od); | 1572 checkGoogleLongrunningOperation(od); |
1960 }); | 1573 }); |
1961 }); | 1574 }); |
1962 | 1575 |
1963 | |
1964 unittest.group("obj-schema-GoogleProtobufEmpty", () { | 1576 unittest.group("obj-schema-GoogleProtobufEmpty", () { |
1965 unittest.test("to-json--from-json", () { | 1577 unittest.test("to-json--from-json", () { |
1966 var o = buildGoogleProtobufEmpty(); | 1578 var o = buildGoogleProtobufEmpty(); |
1967 var od = new api.GoogleProtobufEmpty.fromJson(o.toJson()); | 1579 var od = new api.GoogleProtobufEmpty.fromJson(o.toJson()); |
1968 checkGoogleProtobufEmpty(od); | 1580 checkGoogleProtobufEmpty(od); |
1969 }); | 1581 }); |
1970 }); | 1582 }); |
1971 | 1583 |
1972 | |
1973 unittest.group("obj-schema-GoogleRpcStatus", () { | 1584 unittest.group("obj-schema-GoogleRpcStatus", () { |
1974 unittest.test("to-json--from-json", () { | 1585 unittest.test("to-json--from-json", () { |
1975 var o = buildGoogleRpcStatus(); | 1586 var o = buildGoogleRpcStatus(); |
1976 var od = new api.GoogleRpcStatus.fromJson(o.toJson()); | 1587 var od = new api.GoogleRpcStatus.fromJson(o.toJson()); |
1977 checkGoogleRpcStatus(od); | 1588 checkGoogleRpcStatus(od); |
1978 }); | 1589 }); |
1979 }); | 1590 }); |
1980 | 1591 |
1981 | |
1982 unittest.group("obj-schema-GoogleTypeExpr", () { | 1592 unittest.group("obj-schema-GoogleTypeExpr", () { |
1983 unittest.test("to-json--from-json", () { | 1593 unittest.test("to-json--from-json", () { |
1984 var o = buildGoogleTypeExpr(); | 1594 var o = buildGoogleTypeExpr(); |
1985 var od = new api.GoogleTypeExpr.fromJson(o.toJson()); | 1595 var od = new api.GoogleTypeExpr.fromJson(o.toJson()); |
1986 checkGoogleTypeExpr(od); | 1596 checkGoogleTypeExpr(od); |
1987 }); | 1597 }); |
1988 }); | 1598 }); |
1989 | 1599 |
1990 | |
1991 unittest.group("resource-ProjectsResourceApi", () { | 1600 unittest.group("resource-ProjectsResourceApi", () { |
1992 unittest.test("method--getConfig", () { | 1601 unittest.test("method--getConfig", () { |
1993 | |
1994 var mock = new HttpServerMock(); | 1602 var mock = new HttpServerMock(); |
1995 api.ProjectsResourceApi res = new api.MlApi(mock).projects; | 1603 api.ProjectsResourceApi res = new api.MlApi(mock).projects; |
1996 var arg_name = "foo"; | 1604 var arg_name = "foo"; |
1997 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1605 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1998 var path = (req.url).path; | 1606 var path = (req.url).path; |
1999 var pathOffset = 0; | 1607 var pathOffset = 0; |
2000 var index; | 1608 var index; |
2001 var subPart; | 1609 var subPart; |
2002 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1610 unittest.expect( |
| 1611 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2003 pathOffset += 1; | 1612 pathOffset += 1; |
2004 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1613 unittest.expect( |
| 1614 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2005 pathOffset += 3; | 1615 pathOffset += 3; |
2006 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1616 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2007 | 1617 |
2008 var query = (req.url).query; | 1618 var query = (req.url).query; |
2009 var queryOffset = 0; | 1619 var queryOffset = 0; |
2010 var queryMap = {}; | 1620 var queryMap = {}; |
2011 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1621 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2012 parseBool(n) { | 1622 parseBool(n) { |
2013 if (n == "true") return true; | 1623 if (n == "true") return true; |
2014 if (n == "false") return false; | 1624 if (n == "false") return false; |
2015 if (n == null) return null; | 1625 if (n == null) return null; |
2016 throw new core.ArgumentError("Invalid boolean: $n"); | 1626 throw new core.ArgumentError("Invalid boolean: $n"); |
2017 } | 1627 } |
| 1628 |
2018 if (query.length > 0) { | 1629 if (query.length > 0) { |
2019 for (var part in query.split("&")) { | 1630 for (var part in query.split("&")) { |
2020 var keyvalue = part.split("="); | 1631 var keyvalue = part.split("="); |
2021 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1632 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1633 core.Uri.decodeQueryComponent(keyvalue[1])); |
2022 } | 1634 } |
2023 } | 1635 } |
2024 | 1636 |
2025 | |
2026 var h = { | 1637 var h = { |
2027 "content-type" : "application/json; charset=utf-8", | 1638 "content-type": "application/json; charset=utf-8", |
2028 }; | 1639 }; |
2029 var resp = convert.JSON.encode(buildGoogleCloudMlV1GetConfigResponse()); | 1640 var resp = convert.JSON.encode(buildGoogleCloudMlV1GetConfigResponse()); |
2030 return new async.Future.value(stringResponse(200, h, resp)); | 1641 return new async.Future.value(stringResponse(200, h, resp)); |
2031 }), true); | 1642 }), true); |
2032 res.getConfig(arg_name).then(unittest.expectAsync1(((api.GoogleCloudMlV1Ge
tConfigResponse response) { | 1643 res.getConfig(arg_name).then(unittest |
| 1644 .expectAsync1(((api.GoogleCloudMlV1GetConfigResponse response) { |
2033 checkGoogleCloudMlV1GetConfigResponse(response); | 1645 checkGoogleCloudMlV1GetConfigResponse(response); |
2034 }))); | 1646 }))); |
2035 }); | 1647 }); |
2036 | 1648 |
2037 unittest.test("method--predict", () { | 1649 unittest.test("method--predict", () { |
2038 | |
2039 var mock = new HttpServerMock(); | 1650 var mock = new HttpServerMock(); |
2040 api.ProjectsResourceApi res = new api.MlApi(mock).projects; | 1651 api.ProjectsResourceApi res = new api.MlApi(mock).projects; |
2041 var arg_request = buildGoogleCloudMlV1PredictRequest(); | 1652 var arg_request = buildGoogleCloudMlV1PredictRequest(); |
2042 var arg_name = "foo"; | 1653 var arg_name = "foo"; |
2043 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1654 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2044 var obj = new api.GoogleCloudMlV1PredictRequest.fromJson(json); | 1655 var obj = new api.GoogleCloudMlV1PredictRequest.fromJson(json); |
2045 checkGoogleCloudMlV1PredictRequest(obj); | 1656 checkGoogleCloudMlV1PredictRequest(obj); |
2046 | 1657 |
2047 var path = (req.url).path; | 1658 var path = (req.url).path; |
2048 var pathOffset = 0; | 1659 var pathOffset = 0; |
2049 var index; | 1660 var index; |
2050 var subPart; | 1661 var subPart; |
2051 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1662 unittest.expect( |
| 1663 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2052 pathOffset += 1; | 1664 pathOffset += 1; |
2053 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1665 unittest.expect( |
| 1666 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2054 pathOffset += 3; | 1667 pathOffset += 3; |
2055 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1668 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2056 | 1669 |
2057 var query = (req.url).query; | 1670 var query = (req.url).query; |
2058 var queryOffset = 0; | 1671 var queryOffset = 0; |
2059 var queryMap = {}; | 1672 var queryMap = {}; |
2060 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1673 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2061 parseBool(n) { | 1674 parseBool(n) { |
2062 if (n == "true") return true; | 1675 if (n == "true") return true; |
2063 if (n == "false") return false; | 1676 if (n == "false") return false; |
2064 if (n == null) return null; | 1677 if (n == null) return null; |
2065 throw new core.ArgumentError("Invalid boolean: $n"); | 1678 throw new core.ArgumentError("Invalid boolean: $n"); |
2066 } | 1679 } |
| 1680 |
2067 if (query.length > 0) { | 1681 if (query.length > 0) { |
2068 for (var part in query.split("&")) { | 1682 for (var part in query.split("&")) { |
2069 var keyvalue = part.split("="); | 1683 var keyvalue = part.split("="); |
2070 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1684 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1685 core.Uri.decodeQueryComponent(keyvalue[1])); |
2071 } | 1686 } |
2072 } | 1687 } |
2073 | 1688 |
2074 | |
2075 var h = { | 1689 var h = { |
2076 "content-type" : "application/json; charset=utf-8", | 1690 "content-type": "application/json; charset=utf-8", |
2077 }; | 1691 }; |
2078 var resp = convert.JSON.encode(buildGoogleApiHttpBody()); | 1692 var resp = convert.JSON.encode(buildGoogleApiHttpBody()); |
2079 return new async.Future.value(stringResponse(200, h, resp)); | 1693 return new async.Future.value(stringResponse(200, h, resp)); |
2080 }), true); | 1694 }), true); |
2081 res.predict(arg_request, arg_name).then(unittest.expectAsync1(((api.Google
ApiHttpBody response) { | 1695 res |
| 1696 .predict(arg_request, arg_name) |
| 1697 .then(unittest.expectAsync1(((api.GoogleApiHttpBody response) { |
2082 checkGoogleApiHttpBody(response); | 1698 checkGoogleApiHttpBody(response); |
2083 }))); | 1699 }))); |
2084 }); | 1700 }); |
2085 | |
2086 }); | 1701 }); |
2087 | 1702 |
2088 | |
2089 unittest.group("resource-ProjectsJobsResourceApi", () { | 1703 unittest.group("resource-ProjectsJobsResourceApi", () { |
2090 unittest.test("method--cancel", () { | 1704 unittest.test("method--cancel", () { |
2091 | |
2092 var mock = new HttpServerMock(); | 1705 var mock = new HttpServerMock(); |
2093 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 1706 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2094 var arg_request = buildGoogleCloudMlV1CancelJobRequest(); | 1707 var arg_request = buildGoogleCloudMlV1CancelJobRequest(); |
2095 var arg_name = "foo"; | 1708 var arg_name = "foo"; |
2096 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1709 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2097 var obj = new api.GoogleCloudMlV1CancelJobRequest.fromJson(json); | 1710 var obj = new api.GoogleCloudMlV1CancelJobRequest.fromJson(json); |
2098 checkGoogleCloudMlV1CancelJobRequest(obj); | 1711 checkGoogleCloudMlV1CancelJobRequest(obj); |
2099 | 1712 |
2100 var path = (req.url).path; | 1713 var path = (req.url).path; |
2101 var pathOffset = 0; | 1714 var pathOffset = 0; |
2102 var index; | 1715 var index; |
2103 var subPart; | 1716 var subPart; |
2104 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1717 unittest.expect( |
| 1718 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2105 pathOffset += 1; | 1719 pathOffset += 1; |
2106 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1720 unittest.expect( |
| 1721 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2107 pathOffset += 3; | 1722 pathOffset += 3; |
2108 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1723 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2109 | 1724 |
2110 var query = (req.url).query; | 1725 var query = (req.url).query; |
2111 var queryOffset = 0; | 1726 var queryOffset = 0; |
2112 var queryMap = {}; | 1727 var queryMap = {}; |
2113 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1728 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2114 parseBool(n) { | 1729 parseBool(n) { |
2115 if (n == "true") return true; | 1730 if (n == "true") return true; |
2116 if (n == "false") return false; | 1731 if (n == "false") return false; |
2117 if (n == null) return null; | 1732 if (n == null) return null; |
2118 throw new core.ArgumentError("Invalid boolean: $n"); | 1733 throw new core.ArgumentError("Invalid boolean: $n"); |
2119 } | 1734 } |
| 1735 |
2120 if (query.length > 0) { | 1736 if (query.length > 0) { |
2121 for (var part in query.split("&")) { | 1737 for (var part in query.split("&")) { |
2122 var keyvalue = part.split("="); | 1738 var keyvalue = part.split("="); |
2123 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1739 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1740 core.Uri.decodeQueryComponent(keyvalue[1])); |
2124 } | 1741 } |
2125 } | 1742 } |
2126 | 1743 |
2127 | |
2128 var h = { | 1744 var h = { |
2129 "content-type" : "application/json; charset=utf-8", | 1745 "content-type": "application/json; charset=utf-8", |
2130 }; | 1746 }; |
2131 var resp = convert.JSON.encode(buildGoogleProtobufEmpty()); | 1747 var resp = convert.JSON.encode(buildGoogleProtobufEmpty()); |
2132 return new async.Future.value(stringResponse(200, h, resp)); | 1748 return new async.Future.value(stringResponse(200, h, resp)); |
2133 }), true); | 1749 }), true); |
2134 res.cancel(arg_request, arg_name).then(unittest.expectAsync1(((api.GoogleP
rotobufEmpty response) { | 1750 res |
| 1751 .cancel(arg_request, arg_name) |
| 1752 .then(unittest.expectAsync1(((api.GoogleProtobufEmpty response) { |
2135 checkGoogleProtobufEmpty(response); | 1753 checkGoogleProtobufEmpty(response); |
2136 }))); | 1754 }))); |
2137 }); | 1755 }); |
2138 | 1756 |
2139 unittest.test("method--create", () { | 1757 unittest.test("method--create", () { |
2140 | |
2141 var mock = new HttpServerMock(); | 1758 var mock = new HttpServerMock(); |
2142 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 1759 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2143 var arg_request = buildGoogleCloudMlV1Job(); | 1760 var arg_request = buildGoogleCloudMlV1Job(); |
2144 var arg_parent = "foo"; | 1761 var arg_parent = "foo"; |
2145 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1762 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2146 var obj = new api.GoogleCloudMlV1Job.fromJson(json); | 1763 var obj = new api.GoogleCloudMlV1Job.fromJson(json); |
2147 checkGoogleCloudMlV1Job(obj); | 1764 checkGoogleCloudMlV1Job(obj); |
2148 | 1765 |
2149 var path = (req.url).path; | 1766 var path = (req.url).path; |
2150 var pathOffset = 0; | 1767 var pathOffset = 0; |
2151 var index; | 1768 var index; |
2152 var subPart; | 1769 var subPart; |
2153 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1770 unittest.expect( |
| 1771 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2154 pathOffset += 1; | 1772 pathOffset += 1; |
2155 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1773 unittest.expect( |
| 1774 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2156 pathOffset += 3; | 1775 pathOffset += 3; |
2157 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1776 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2158 | 1777 |
2159 var query = (req.url).query; | 1778 var query = (req.url).query; |
2160 var queryOffset = 0; | 1779 var queryOffset = 0; |
2161 var queryMap = {}; | 1780 var queryMap = {}; |
2162 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1781 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2163 parseBool(n) { | 1782 parseBool(n) { |
2164 if (n == "true") return true; | 1783 if (n == "true") return true; |
2165 if (n == "false") return false; | 1784 if (n == "false") return false; |
2166 if (n == null) return null; | 1785 if (n == null) return null; |
2167 throw new core.ArgumentError("Invalid boolean: $n"); | 1786 throw new core.ArgumentError("Invalid boolean: $n"); |
2168 } | 1787 } |
| 1788 |
2169 if (query.length > 0) { | 1789 if (query.length > 0) { |
2170 for (var part in query.split("&")) { | 1790 for (var part in query.split("&")) { |
2171 var keyvalue = part.split("="); | 1791 var keyvalue = part.split("="); |
2172 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1792 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1793 core.Uri.decodeQueryComponent(keyvalue[1])); |
2173 } | 1794 } |
2174 } | 1795 } |
2175 | 1796 |
2176 | |
2177 var h = { | 1797 var h = { |
2178 "content-type" : "application/json; charset=utf-8", | 1798 "content-type": "application/json; charset=utf-8", |
2179 }; | 1799 }; |
2180 var resp = convert.JSON.encode(buildGoogleCloudMlV1Job()); | 1800 var resp = convert.JSON.encode(buildGoogleCloudMlV1Job()); |
2181 return new async.Future.value(stringResponse(200, h, resp)); | 1801 return new async.Future.value(stringResponse(200, h, resp)); |
2182 }), true); | 1802 }), true); |
2183 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Googl
eCloudMlV1Job response) { | 1803 res |
| 1804 .create(arg_request, arg_parent) |
| 1805 .then(unittest.expectAsync1(((api.GoogleCloudMlV1Job response) { |
2184 checkGoogleCloudMlV1Job(response); | 1806 checkGoogleCloudMlV1Job(response); |
2185 }))); | 1807 }))); |
2186 }); | 1808 }); |
2187 | 1809 |
2188 unittest.test("method--get", () { | 1810 unittest.test("method--get", () { |
2189 | |
2190 var mock = new HttpServerMock(); | 1811 var mock = new HttpServerMock(); |
2191 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 1812 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2192 var arg_name = "foo"; | 1813 var arg_name = "foo"; |
2193 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1814 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2194 var path = (req.url).path; | 1815 var path = (req.url).path; |
2195 var pathOffset = 0; | 1816 var pathOffset = 0; |
2196 var index; | 1817 var index; |
2197 var subPart; | 1818 var subPart; |
2198 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1819 unittest.expect( |
| 1820 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2199 pathOffset += 1; | 1821 pathOffset += 1; |
2200 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1822 unittest.expect( |
| 1823 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2201 pathOffset += 3; | 1824 pathOffset += 3; |
2202 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1825 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2203 | 1826 |
2204 var query = (req.url).query; | 1827 var query = (req.url).query; |
2205 var queryOffset = 0; | 1828 var queryOffset = 0; |
2206 var queryMap = {}; | 1829 var queryMap = {}; |
2207 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1830 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2208 parseBool(n) { | 1831 parseBool(n) { |
2209 if (n == "true") return true; | 1832 if (n == "true") return true; |
2210 if (n == "false") return false; | 1833 if (n == "false") return false; |
2211 if (n == null) return null; | 1834 if (n == null) return null; |
2212 throw new core.ArgumentError("Invalid boolean: $n"); | 1835 throw new core.ArgumentError("Invalid boolean: $n"); |
2213 } | 1836 } |
| 1837 |
2214 if (query.length > 0) { | 1838 if (query.length > 0) { |
2215 for (var part in query.split("&")) { | 1839 for (var part in query.split("&")) { |
2216 var keyvalue = part.split("="); | 1840 var keyvalue = part.split("="); |
2217 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1841 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1842 core.Uri.decodeQueryComponent(keyvalue[1])); |
2218 } | 1843 } |
2219 } | 1844 } |
2220 | 1845 |
2221 | |
2222 var h = { | 1846 var h = { |
2223 "content-type" : "application/json; charset=utf-8", | 1847 "content-type": "application/json; charset=utf-8", |
2224 }; | 1848 }; |
2225 var resp = convert.JSON.encode(buildGoogleCloudMlV1Job()); | 1849 var resp = convert.JSON.encode(buildGoogleCloudMlV1Job()); |
2226 return new async.Future.value(stringResponse(200, h, resp)); | 1850 return new async.Future.value(stringResponse(200, h, resp)); |
2227 }), true); | 1851 }), true); |
2228 res.get(arg_name).then(unittest.expectAsync1(((api.GoogleCloudMlV1Job resp
onse) { | 1852 res |
| 1853 .get(arg_name) |
| 1854 .then(unittest.expectAsync1(((api.GoogleCloudMlV1Job response) { |
2229 checkGoogleCloudMlV1Job(response); | 1855 checkGoogleCloudMlV1Job(response); |
2230 }))); | 1856 }))); |
2231 }); | 1857 }); |
2232 | 1858 |
2233 unittest.test("method--getIamPolicy", () { | 1859 unittest.test("method--getIamPolicy", () { |
2234 | |
2235 var mock = new HttpServerMock(); | 1860 var mock = new HttpServerMock(); |
2236 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 1861 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2237 var arg_resource = "foo"; | 1862 var arg_resource = "foo"; |
2238 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1863 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2239 var path = (req.url).path; | 1864 var path = (req.url).path; |
2240 var pathOffset = 0; | 1865 var pathOffset = 0; |
2241 var index; | 1866 var index; |
2242 var subPart; | 1867 var subPart; |
2243 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1868 unittest.expect( |
| 1869 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2244 pathOffset += 1; | 1870 pathOffset += 1; |
2245 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1871 unittest.expect( |
| 1872 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2246 pathOffset += 3; | 1873 pathOffset += 3; |
2247 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1874 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2248 | 1875 |
2249 var query = (req.url).query; | 1876 var query = (req.url).query; |
2250 var queryOffset = 0; | 1877 var queryOffset = 0; |
2251 var queryMap = {}; | 1878 var queryMap = {}; |
2252 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1879 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2253 parseBool(n) { | 1880 parseBool(n) { |
2254 if (n == "true") return true; | 1881 if (n == "true") return true; |
2255 if (n == "false") return false; | 1882 if (n == "false") return false; |
2256 if (n == null) return null; | 1883 if (n == null) return null; |
2257 throw new core.ArgumentError("Invalid boolean: $n"); | 1884 throw new core.ArgumentError("Invalid boolean: $n"); |
2258 } | 1885 } |
| 1886 |
2259 if (query.length > 0) { | 1887 if (query.length > 0) { |
2260 for (var part in query.split("&")) { | 1888 for (var part in query.split("&")) { |
2261 var keyvalue = part.split("="); | 1889 var keyvalue = part.split("="); |
2262 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1890 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1891 core.Uri.decodeQueryComponent(keyvalue[1])); |
2263 } | 1892 } |
2264 } | 1893 } |
2265 | 1894 |
2266 | |
2267 var h = { | 1895 var h = { |
2268 "content-type" : "application/json; charset=utf-8", | 1896 "content-type": "application/json; charset=utf-8", |
2269 }; | 1897 }; |
2270 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); | 1898 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); |
2271 return new async.Future.value(stringResponse(200, h, resp)); | 1899 return new async.Future.value(stringResponse(200, h, resp)); |
2272 }), true); | 1900 }), true); |
2273 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.GoogleIamV
1Policy response) { | 1901 res |
| 1902 .getIamPolicy(arg_resource) |
| 1903 .then(unittest.expectAsync1(((api.GoogleIamV1Policy response) { |
2274 checkGoogleIamV1Policy(response); | 1904 checkGoogleIamV1Policy(response); |
2275 }))); | 1905 }))); |
2276 }); | 1906 }); |
2277 | 1907 |
2278 unittest.test("method--list", () { | 1908 unittest.test("method--list", () { |
2279 | |
2280 var mock = new HttpServerMock(); | 1909 var mock = new HttpServerMock(); |
2281 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 1910 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2282 var arg_parent = "foo"; | 1911 var arg_parent = "foo"; |
| 1912 var arg_filter = "foo"; |
2283 var arg_pageToken = "foo"; | 1913 var arg_pageToken = "foo"; |
2284 var arg_pageSize = 42; | 1914 var arg_pageSize = 42; |
2285 var arg_filter = "foo"; | |
2286 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1915 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2287 var path = (req.url).path; | 1916 var path = (req.url).path; |
2288 var pathOffset = 0; | 1917 var pathOffset = 0; |
2289 var index; | 1918 var index; |
2290 var subPart; | 1919 var subPart; |
2291 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1920 unittest.expect( |
| 1921 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2292 pathOffset += 1; | 1922 pathOffset += 1; |
2293 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1923 unittest.expect( |
| 1924 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2294 pathOffset += 3; | 1925 pathOffset += 3; |
2295 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1926 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2296 | 1927 |
2297 var query = (req.url).query; | 1928 var query = (req.url).query; |
2298 var queryOffset = 0; | 1929 var queryOffset = 0; |
2299 var queryMap = {}; | 1930 var queryMap = {}; |
2300 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1931 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2301 parseBool(n) { | 1932 parseBool(n) { |
2302 if (n == "true") return true; | 1933 if (n == "true") return true; |
2303 if (n == "false") return false; | 1934 if (n == "false") return false; |
2304 if (n == null) return null; | 1935 if (n == null) return null; |
2305 throw new core.ArgumentError("Invalid boolean: $n"); | 1936 throw new core.ArgumentError("Invalid boolean: $n"); |
2306 } | 1937 } |
| 1938 |
2307 if (query.length > 0) { | 1939 if (query.length > 0) { |
2308 for (var part in query.split("&")) { | 1940 for (var part in query.split("&")) { |
2309 var keyvalue = part.split("="); | 1941 var keyvalue = part.split("="); |
2310 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1942 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1943 core.Uri.decodeQueryComponent(keyvalue[1])); |
2311 } | 1944 } |
2312 } | 1945 } |
2313 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
2314 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
2315 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1946 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
2316 | 1947 unittest.expect( |
| 1948 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 1949 unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| 1950 unittest.equals(arg_pageSize)); |
2317 | 1951 |
2318 var h = { | 1952 var h = { |
2319 "content-type" : "application/json; charset=utf-8", | 1953 "content-type": "application/json; charset=utf-8", |
2320 }; | 1954 }; |
2321 var resp = convert.JSON.encode(buildGoogleCloudMlV1ListJobsResponse()); | 1955 var resp = convert.JSON.encode(buildGoogleCloudMlV1ListJobsResponse()); |
2322 return new async.Future.value(stringResponse(200, h, resp)); | 1956 return new async.Future.value(stringResponse(200, h, resp)); |
2323 }), true); | 1957 }), true); |
2324 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize, fil
ter: arg_filter).then(unittest.expectAsync1(((api.GoogleCloudMlV1ListJobsRespons
e response) { | 1958 res |
| 1959 .list(arg_parent, |
| 1960 filter: arg_filter, |
| 1961 pageToken: arg_pageToken, |
| 1962 pageSize: arg_pageSize) |
| 1963 .then(unittest |
| 1964 .expectAsync1(((api.GoogleCloudMlV1ListJobsResponse response) { |
2325 checkGoogleCloudMlV1ListJobsResponse(response); | 1965 checkGoogleCloudMlV1ListJobsResponse(response); |
2326 }))); | 1966 }))); |
2327 }); | 1967 }); |
2328 | 1968 |
2329 unittest.test("method--setIamPolicy", () { | 1969 unittest.test("method--setIamPolicy", () { |
2330 | |
2331 var mock = new HttpServerMock(); | 1970 var mock = new HttpServerMock(); |
2332 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 1971 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2333 var arg_request = buildGoogleIamV1SetIamPolicyRequest(); | 1972 var arg_request = buildGoogleIamV1SetIamPolicyRequest(); |
2334 var arg_resource = "foo"; | 1973 var arg_resource = "foo"; |
2335 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1974 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2336 var obj = new api.GoogleIamV1SetIamPolicyRequest.fromJson(json); | 1975 var obj = new api.GoogleIamV1SetIamPolicyRequest.fromJson(json); |
2337 checkGoogleIamV1SetIamPolicyRequest(obj); | 1976 checkGoogleIamV1SetIamPolicyRequest(obj); |
2338 | 1977 |
2339 var path = (req.url).path; | 1978 var path = (req.url).path; |
2340 var pathOffset = 0; | 1979 var pathOffset = 0; |
2341 var index; | 1980 var index; |
2342 var subPart; | 1981 var subPart; |
2343 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1982 unittest.expect( |
| 1983 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2344 pathOffset += 1; | 1984 pathOffset += 1; |
2345 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1985 unittest.expect( |
| 1986 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2346 pathOffset += 3; | 1987 pathOffset += 3; |
2347 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1988 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2348 | 1989 |
2349 var query = (req.url).query; | 1990 var query = (req.url).query; |
2350 var queryOffset = 0; | 1991 var queryOffset = 0; |
2351 var queryMap = {}; | 1992 var queryMap = {}; |
2352 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1993 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2353 parseBool(n) { | 1994 parseBool(n) { |
2354 if (n == "true") return true; | 1995 if (n == "true") return true; |
2355 if (n == "false") return false; | 1996 if (n == "false") return false; |
2356 if (n == null) return null; | 1997 if (n == null) return null; |
2357 throw new core.ArgumentError("Invalid boolean: $n"); | 1998 throw new core.ArgumentError("Invalid boolean: $n"); |
2358 } | 1999 } |
| 2000 |
2359 if (query.length > 0) { | 2001 if (query.length > 0) { |
2360 for (var part in query.split("&")) { | 2002 for (var part in query.split("&")) { |
2361 var keyvalue = part.split("="); | 2003 var keyvalue = part.split("="); |
2362 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2004 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2005 core.Uri.decodeQueryComponent(keyvalue[1])); |
2363 } | 2006 } |
2364 } | 2007 } |
2365 | 2008 |
2366 | |
2367 var h = { | 2009 var h = { |
2368 "content-type" : "application/json; charset=utf-8", | 2010 "content-type": "application/json; charset=utf-8", |
2369 }; | 2011 }; |
2370 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); | 2012 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); |
2371 return new async.Future.value(stringResponse(200, h, resp)); | 2013 return new async.Future.value(stringResponse(200, h, resp)); |
2372 }), true); | 2014 }), true); |
2373 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.GoogleIamV1Policy response) { | 2015 res |
| 2016 .setIamPolicy(arg_request, arg_resource) |
| 2017 .then(unittest.expectAsync1(((api.GoogleIamV1Policy response) { |
2374 checkGoogleIamV1Policy(response); | 2018 checkGoogleIamV1Policy(response); |
2375 }))); | 2019 }))); |
2376 }); | 2020 }); |
2377 | 2021 |
2378 unittest.test("method--testIamPermissions", () { | 2022 unittest.test("method--testIamPermissions", () { |
2379 | |
2380 var mock = new HttpServerMock(); | 2023 var mock = new HttpServerMock(); |
2381 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; | 2024 api.ProjectsJobsResourceApi res = new api.MlApi(mock).projects.jobs; |
2382 var arg_request = buildGoogleIamV1TestIamPermissionsRequest(); | 2025 var arg_request = buildGoogleIamV1TestIamPermissionsRequest(); |
2383 var arg_resource = "foo"; | 2026 var arg_resource = "foo"; |
2384 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2027 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2385 var obj = new api.GoogleIamV1TestIamPermissionsRequest.fromJson(json); | 2028 var obj = new api.GoogleIamV1TestIamPermissionsRequest.fromJson(json); |
2386 checkGoogleIamV1TestIamPermissionsRequest(obj); | 2029 checkGoogleIamV1TestIamPermissionsRequest(obj); |
2387 | 2030 |
2388 var path = (req.url).path; | 2031 var path = (req.url).path; |
2389 var pathOffset = 0; | 2032 var pathOffset = 0; |
2390 var index; | 2033 var index; |
2391 var subPart; | 2034 var subPart; |
2392 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2035 unittest.expect( |
| 2036 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2393 pathOffset += 1; | 2037 pathOffset += 1; |
2394 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2038 unittest.expect( |
| 2039 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2395 pathOffset += 3; | 2040 pathOffset += 3; |
2396 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2041 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2397 | 2042 |
2398 var query = (req.url).query; | 2043 var query = (req.url).query; |
2399 var queryOffset = 0; | 2044 var queryOffset = 0; |
2400 var queryMap = {}; | 2045 var queryMap = {}; |
2401 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2046 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2402 parseBool(n) { | 2047 parseBool(n) { |
2403 if (n == "true") return true; | 2048 if (n == "true") return true; |
2404 if (n == "false") return false; | 2049 if (n == "false") return false; |
2405 if (n == null) return null; | 2050 if (n == null) return null; |
2406 throw new core.ArgumentError("Invalid boolean: $n"); | 2051 throw new core.ArgumentError("Invalid boolean: $n"); |
2407 } | 2052 } |
| 2053 |
2408 if (query.length > 0) { | 2054 if (query.length > 0) { |
2409 for (var part in query.split("&")) { | 2055 for (var part in query.split("&")) { |
2410 var keyvalue = part.split("="); | 2056 var keyvalue = part.split("="); |
2411 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2057 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2058 core.Uri.decodeQueryComponent(keyvalue[1])); |
2412 } | 2059 } |
2413 } | 2060 } |
2414 | 2061 |
2415 | |
2416 var h = { | 2062 var h = { |
2417 "content-type" : "application/json; charset=utf-8", | 2063 "content-type": "application/json; charset=utf-8", |
2418 }; | 2064 }; |
2419 var resp = convert.JSON.encode(buildGoogleIamV1TestIamPermissionsRespons
e()); | 2065 var resp = |
| 2066 convert.JSON.encode(buildGoogleIamV1TestIamPermissionsResponse()); |
2420 return new async.Future.value(stringResponse(200, h, resp)); | 2067 return new async.Future.value(stringResponse(200, h, resp)); |
2421 }), true); | 2068 }), true); |
2422 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.GoogleIamV1TestIamPermissionsResponse response) { | 2069 res.testIamPermissions(arg_request, arg_resource).then(unittest |
| 2070 .expectAsync1(((api.GoogleIamV1TestIamPermissionsResponse response) { |
2423 checkGoogleIamV1TestIamPermissionsResponse(response); | 2071 checkGoogleIamV1TestIamPermissionsResponse(response); |
2424 }))); | 2072 }))); |
2425 }); | 2073 }); |
2426 | |
2427 }); | 2074 }); |
2428 | 2075 |
2429 | |
2430 unittest.group("resource-ProjectsModelsResourceApi", () { | 2076 unittest.group("resource-ProjectsModelsResourceApi", () { |
2431 unittest.test("method--create", () { | 2077 unittest.test("method--create", () { |
2432 | |
2433 var mock = new HttpServerMock(); | 2078 var mock = new HttpServerMock(); |
2434 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2079 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2435 var arg_request = buildGoogleCloudMlV1Model(); | 2080 var arg_request = buildGoogleCloudMlV1Model(); |
2436 var arg_parent = "foo"; | 2081 var arg_parent = "foo"; |
2437 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2082 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2438 var obj = new api.GoogleCloudMlV1Model.fromJson(json); | 2083 var obj = new api.GoogleCloudMlV1Model.fromJson(json); |
2439 checkGoogleCloudMlV1Model(obj); | 2084 checkGoogleCloudMlV1Model(obj); |
2440 | 2085 |
2441 var path = (req.url).path; | 2086 var path = (req.url).path; |
2442 var pathOffset = 0; | 2087 var pathOffset = 0; |
2443 var index; | 2088 var index; |
2444 var subPart; | 2089 var subPart; |
2445 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2090 unittest.expect( |
| 2091 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2446 pathOffset += 1; | 2092 pathOffset += 1; |
2447 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2093 unittest.expect( |
| 2094 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2448 pathOffset += 3; | 2095 pathOffset += 3; |
2449 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2096 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2450 | 2097 |
2451 var query = (req.url).query; | 2098 var query = (req.url).query; |
2452 var queryOffset = 0; | 2099 var queryOffset = 0; |
2453 var queryMap = {}; | 2100 var queryMap = {}; |
2454 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2101 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2455 parseBool(n) { | 2102 parseBool(n) { |
2456 if (n == "true") return true; | 2103 if (n == "true") return true; |
2457 if (n == "false") return false; | 2104 if (n == "false") return false; |
2458 if (n == null) return null; | 2105 if (n == null) return null; |
2459 throw new core.ArgumentError("Invalid boolean: $n"); | 2106 throw new core.ArgumentError("Invalid boolean: $n"); |
2460 } | 2107 } |
| 2108 |
2461 if (query.length > 0) { | 2109 if (query.length > 0) { |
2462 for (var part in query.split("&")) { | 2110 for (var part in query.split("&")) { |
2463 var keyvalue = part.split("="); | 2111 var keyvalue = part.split("="); |
2464 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2112 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2113 core.Uri.decodeQueryComponent(keyvalue[1])); |
2465 } | 2114 } |
2466 } | 2115 } |
2467 | 2116 |
2468 | |
2469 var h = { | 2117 var h = { |
2470 "content-type" : "application/json; charset=utf-8", | 2118 "content-type": "application/json; charset=utf-8", |
2471 }; | 2119 }; |
2472 var resp = convert.JSON.encode(buildGoogleCloudMlV1Model()); | 2120 var resp = convert.JSON.encode(buildGoogleCloudMlV1Model()); |
2473 return new async.Future.value(stringResponse(200, h, resp)); | 2121 return new async.Future.value(stringResponse(200, h, resp)); |
2474 }), true); | 2122 }), true); |
2475 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Googl
eCloudMlV1Model response) { | 2123 res |
| 2124 .create(arg_request, arg_parent) |
| 2125 .then(unittest.expectAsync1(((api.GoogleCloudMlV1Model response) { |
2476 checkGoogleCloudMlV1Model(response); | 2126 checkGoogleCloudMlV1Model(response); |
2477 }))); | 2127 }))); |
2478 }); | 2128 }); |
2479 | 2129 |
2480 unittest.test("method--delete", () { | 2130 unittest.test("method--delete", () { |
2481 | |
2482 var mock = new HttpServerMock(); | 2131 var mock = new HttpServerMock(); |
2483 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2132 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2484 var arg_name = "foo"; | 2133 var arg_name = "foo"; |
2485 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2134 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2486 var path = (req.url).path; | 2135 var path = (req.url).path; |
2487 var pathOffset = 0; | 2136 var pathOffset = 0; |
2488 var index; | 2137 var index; |
2489 var subPart; | 2138 var subPart; |
2490 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2139 unittest.expect( |
| 2140 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2491 pathOffset += 1; | 2141 pathOffset += 1; |
2492 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2142 unittest.expect( |
| 2143 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2493 pathOffset += 3; | 2144 pathOffset += 3; |
2494 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2145 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2495 | 2146 |
2496 var query = (req.url).query; | 2147 var query = (req.url).query; |
2497 var queryOffset = 0; | 2148 var queryOffset = 0; |
2498 var queryMap = {}; | 2149 var queryMap = {}; |
2499 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2150 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2500 parseBool(n) { | 2151 parseBool(n) { |
2501 if (n == "true") return true; | 2152 if (n == "true") return true; |
2502 if (n == "false") return false; | 2153 if (n == "false") return false; |
2503 if (n == null) return null; | 2154 if (n == null) return null; |
2504 throw new core.ArgumentError("Invalid boolean: $n"); | 2155 throw new core.ArgumentError("Invalid boolean: $n"); |
2505 } | 2156 } |
| 2157 |
2506 if (query.length > 0) { | 2158 if (query.length > 0) { |
2507 for (var part in query.split("&")) { | 2159 for (var part in query.split("&")) { |
2508 var keyvalue = part.split("="); | 2160 var keyvalue = part.split("="); |
2509 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2161 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2162 core.Uri.decodeQueryComponent(keyvalue[1])); |
2510 } | 2163 } |
2511 } | 2164 } |
2512 | 2165 |
2513 | |
2514 var h = { | 2166 var h = { |
2515 "content-type" : "application/json; charset=utf-8", | 2167 "content-type": "application/json; charset=utf-8", |
2516 }; | 2168 }; |
2517 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); | 2169 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); |
2518 return new async.Future.value(stringResponse(200, h, resp)); | 2170 return new async.Future.value(stringResponse(200, h, resp)); |
2519 }), true); | 2171 }), true); |
2520 res.delete(arg_name).then(unittest.expectAsync1(((api.GoogleLongrunningOpe
ration response) { | 2172 res.delete(arg_name).then( |
| 2173 unittest.expectAsync1(((api.GoogleLongrunningOperation response) { |
2521 checkGoogleLongrunningOperation(response); | 2174 checkGoogleLongrunningOperation(response); |
2522 }))); | 2175 }))); |
2523 }); | 2176 }); |
2524 | 2177 |
2525 unittest.test("method--get", () { | 2178 unittest.test("method--get", () { |
2526 | |
2527 var mock = new HttpServerMock(); | 2179 var mock = new HttpServerMock(); |
2528 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2180 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2529 var arg_name = "foo"; | 2181 var arg_name = "foo"; |
2530 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2182 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2531 var path = (req.url).path; | 2183 var path = (req.url).path; |
2532 var pathOffset = 0; | 2184 var pathOffset = 0; |
2533 var index; | 2185 var index; |
2534 var subPart; | 2186 var subPart; |
2535 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2187 unittest.expect( |
| 2188 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2536 pathOffset += 1; | 2189 pathOffset += 1; |
2537 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2190 unittest.expect( |
| 2191 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2538 pathOffset += 3; | 2192 pathOffset += 3; |
2539 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2193 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2540 | 2194 |
2541 var query = (req.url).query; | 2195 var query = (req.url).query; |
2542 var queryOffset = 0; | 2196 var queryOffset = 0; |
2543 var queryMap = {}; | 2197 var queryMap = {}; |
2544 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2198 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2545 parseBool(n) { | 2199 parseBool(n) { |
2546 if (n == "true") return true; | 2200 if (n == "true") return true; |
2547 if (n == "false") return false; | 2201 if (n == "false") return false; |
2548 if (n == null) return null; | 2202 if (n == null) return null; |
2549 throw new core.ArgumentError("Invalid boolean: $n"); | 2203 throw new core.ArgumentError("Invalid boolean: $n"); |
2550 } | 2204 } |
| 2205 |
2551 if (query.length > 0) { | 2206 if (query.length > 0) { |
2552 for (var part in query.split("&")) { | 2207 for (var part in query.split("&")) { |
2553 var keyvalue = part.split("="); | 2208 var keyvalue = part.split("="); |
2554 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2209 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2210 core.Uri.decodeQueryComponent(keyvalue[1])); |
2555 } | 2211 } |
2556 } | 2212 } |
2557 | 2213 |
2558 | |
2559 var h = { | 2214 var h = { |
2560 "content-type" : "application/json; charset=utf-8", | 2215 "content-type": "application/json; charset=utf-8", |
2561 }; | 2216 }; |
2562 var resp = convert.JSON.encode(buildGoogleCloudMlV1Model()); | 2217 var resp = convert.JSON.encode(buildGoogleCloudMlV1Model()); |
2563 return new async.Future.value(stringResponse(200, h, resp)); | 2218 return new async.Future.value(stringResponse(200, h, resp)); |
2564 }), true); | 2219 }), true); |
2565 res.get(arg_name).then(unittest.expectAsync1(((api.GoogleCloudMlV1Model re
sponse) { | 2220 res |
| 2221 .get(arg_name) |
| 2222 .then(unittest.expectAsync1(((api.GoogleCloudMlV1Model response) { |
2566 checkGoogleCloudMlV1Model(response); | 2223 checkGoogleCloudMlV1Model(response); |
2567 }))); | 2224 }))); |
2568 }); | 2225 }); |
2569 | 2226 |
2570 unittest.test("method--getIamPolicy", () { | 2227 unittest.test("method--getIamPolicy", () { |
2571 | |
2572 var mock = new HttpServerMock(); | 2228 var mock = new HttpServerMock(); |
2573 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2229 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2574 var arg_resource = "foo"; | 2230 var arg_resource = "foo"; |
2575 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2231 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2576 var path = (req.url).path; | 2232 var path = (req.url).path; |
2577 var pathOffset = 0; | 2233 var pathOffset = 0; |
2578 var index; | 2234 var index; |
2579 var subPart; | 2235 var subPart; |
2580 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2236 unittest.expect( |
| 2237 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2581 pathOffset += 1; | 2238 pathOffset += 1; |
2582 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2239 unittest.expect( |
| 2240 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2583 pathOffset += 3; | 2241 pathOffset += 3; |
2584 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2242 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2585 | 2243 |
2586 var query = (req.url).query; | 2244 var query = (req.url).query; |
2587 var queryOffset = 0; | 2245 var queryOffset = 0; |
2588 var queryMap = {}; | 2246 var queryMap = {}; |
2589 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2247 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2590 parseBool(n) { | 2248 parseBool(n) { |
2591 if (n == "true") return true; | 2249 if (n == "true") return true; |
2592 if (n == "false") return false; | 2250 if (n == "false") return false; |
2593 if (n == null) return null; | 2251 if (n == null) return null; |
2594 throw new core.ArgumentError("Invalid boolean: $n"); | 2252 throw new core.ArgumentError("Invalid boolean: $n"); |
2595 } | 2253 } |
| 2254 |
2596 if (query.length > 0) { | 2255 if (query.length > 0) { |
2597 for (var part in query.split("&")) { | 2256 for (var part in query.split("&")) { |
2598 var keyvalue = part.split("="); | 2257 var keyvalue = part.split("="); |
2599 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2258 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2259 core.Uri.decodeQueryComponent(keyvalue[1])); |
2600 } | 2260 } |
2601 } | 2261 } |
2602 | 2262 |
2603 | |
2604 var h = { | 2263 var h = { |
2605 "content-type" : "application/json; charset=utf-8", | 2264 "content-type": "application/json; charset=utf-8", |
2606 }; | 2265 }; |
2607 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); | 2266 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); |
2608 return new async.Future.value(stringResponse(200, h, resp)); | 2267 return new async.Future.value(stringResponse(200, h, resp)); |
2609 }), true); | 2268 }), true); |
2610 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.GoogleIamV
1Policy response) { | 2269 res |
| 2270 .getIamPolicy(arg_resource) |
| 2271 .then(unittest.expectAsync1(((api.GoogleIamV1Policy response) { |
2611 checkGoogleIamV1Policy(response); | 2272 checkGoogleIamV1Policy(response); |
2612 }))); | 2273 }))); |
2613 }); | 2274 }); |
2614 | 2275 |
2615 unittest.test("method--list", () { | 2276 unittest.test("method--list", () { |
2616 | |
2617 var mock = new HttpServerMock(); | 2277 var mock = new HttpServerMock(); |
2618 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2278 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2619 var arg_parent = "foo"; | 2279 var arg_parent = "foo"; |
2620 var arg_pageToken = "foo"; | 2280 var arg_pageToken = "foo"; |
2621 var arg_pageSize = 42; | 2281 var arg_pageSize = 42; |
2622 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2282 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2623 var path = (req.url).path; | 2283 var path = (req.url).path; |
2624 var pathOffset = 0; | 2284 var pathOffset = 0; |
2625 var index; | 2285 var index; |
2626 var subPart; | 2286 var subPart; |
2627 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2287 unittest.expect( |
| 2288 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2628 pathOffset += 1; | 2289 pathOffset += 1; |
2629 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2290 unittest.expect( |
| 2291 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2630 pathOffset += 3; | 2292 pathOffset += 3; |
2631 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2293 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2632 | 2294 |
2633 var query = (req.url).query; | 2295 var query = (req.url).query; |
2634 var queryOffset = 0; | 2296 var queryOffset = 0; |
2635 var queryMap = {}; | 2297 var queryMap = {}; |
2636 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2298 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2637 parseBool(n) { | 2299 parseBool(n) { |
2638 if (n == "true") return true; | 2300 if (n == "true") return true; |
2639 if (n == "false") return false; | 2301 if (n == "false") return false; |
2640 if (n == null) return null; | 2302 if (n == null) return null; |
2641 throw new core.ArgumentError("Invalid boolean: $n"); | 2303 throw new core.ArgumentError("Invalid boolean: $n"); |
2642 } | 2304 } |
| 2305 |
2643 if (query.length > 0) { | 2306 if (query.length > 0) { |
2644 for (var part in query.split("&")) { | 2307 for (var part in query.split("&")) { |
2645 var keyvalue = part.split("="); | 2308 var keyvalue = part.split("="); |
2646 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2309 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2310 core.Uri.decodeQueryComponent(keyvalue[1])); |
2647 } | 2311 } |
2648 } | 2312 } |
2649 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2313 unittest.expect( |
2650 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2314 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
2651 | 2315 unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| 2316 unittest.equals(arg_pageSize)); |
2652 | 2317 |
2653 var h = { | 2318 var h = { |
2654 "content-type" : "application/json; charset=utf-8", | 2319 "content-type": "application/json; charset=utf-8", |
2655 }; | 2320 }; |
2656 var resp = convert.JSON.encode(buildGoogleCloudMlV1ListModelsResponse())
; | 2321 var resp = |
| 2322 convert.JSON.encode(buildGoogleCloudMlV1ListModelsResponse()); |
2657 return new async.Future.value(stringResponse(200, h, resp)); | 2323 return new async.Future.value(stringResponse(200, h, resp)); |
2658 }), true); | 2324 }), true); |
2659 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.GoogleCloudMlV1ListModelsResponse response) { | 2325 res |
| 2326 .list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize) |
| 2327 .then(unittest |
| 2328 .expectAsync1(((api.GoogleCloudMlV1ListModelsResponse response) { |
2660 checkGoogleCloudMlV1ListModelsResponse(response); | 2329 checkGoogleCloudMlV1ListModelsResponse(response); |
2661 }))); | 2330 }))); |
2662 }); | 2331 }); |
2663 | 2332 |
2664 unittest.test("method--setIamPolicy", () { | 2333 unittest.test("method--setIamPolicy", () { |
2665 | |
2666 var mock = new HttpServerMock(); | 2334 var mock = new HttpServerMock(); |
2667 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2335 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2668 var arg_request = buildGoogleIamV1SetIamPolicyRequest(); | 2336 var arg_request = buildGoogleIamV1SetIamPolicyRequest(); |
2669 var arg_resource = "foo"; | 2337 var arg_resource = "foo"; |
2670 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2338 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2671 var obj = new api.GoogleIamV1SetIamPolicyRequest.fromJson(json); | 2339 var obj = new api.GoogleIamV1SetIamPolicyRequest.fromJson(json); |
2672 checkGoogleIamV1SetIamPolicyRequest(obj); | 2340 checkGoogleIamV1SetIamPolicyRequest(obj); |
2673 | 2341 |
2674 var path = (req.url).path; | 2342 var path = (req.url).path; |
2675 var pathOffset = 0; | 2343 var pathOffset = 0; |
2676 var index; | 2344 var index; |
2677 var subPart; | 2345 var subPart; |
2678 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2346 unittest.expect( |
| 2347 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2679 pathOffset += 1; | 2348 pathOffset += 1; |
2680 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2349 unittest.expect( |
| 2350 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2681 pathOffset += 3; | 2351 pathOffset += 3; |
2682 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2352 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2683 | 2353 |
2684 var query = (req.url).query; | 2354 var query = (req.url).query; |
2685 var queryOffset = 0; | 2355 var queryOffset = 0; |
2686 var queryMap = {}; | 2356 var queryMap = {}; |
2687 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2357 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2688 parseBool(n) { | 2358 parseBool(n) { |
2689 if (n == "true") return true; | 2359 if (n == "true") return true; |
2690 if (n == "false") return false; | 2360 if (n == "false") return false; |
2691 if (n == null) return null; | 2361 if (n == null) return null; |
2692 throw new core.ArgumentError("Invalid boolean: $n"); | 2362 throw new core.ArgumentError("Invalid boolean: $n"); |
2693 } | 2363 } |
| 2364 |
2694 if (query.length > 0) { | 2365 if (query.length > 0) { |
2695 for (var part in query.split("&")) { | 2366 for (var part in query.split("&")) { |
2696 var keyvalue = part.split("="); | 2367 var keyvalue = part.split("="); |
2697 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2368 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2369 core.Uri.decodeQueryComponent(keyvalue[1])); |
2698 } | 2370 } |
2699 } | 2371 } |
2700 | 2372 |
2701 | |
2702 var h = { | 2373 var h = { |
2703 "content-type" : "application/json; charset=utf-8", | 2374 "content-type": "application/json; charset=utf-8", |
2704 }; | 2375 }; |
2705 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); | 2376 var resp = convert.JSON.encode(buildGoogleIamV1Policy()); |
2706 return new async.Future.value(stringResponse(200, h, resp)); | 2377 return new async.Future.value(stringResponse(200, h, resp)); |
2707 }), true); | 2378 }), true); |
2708 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.GoogleIamV1Policy response) { | 2379 res |
| 2380 .setIamPolicy(arg_request, arg_resource) |
| 2381 .then(unittest.expectAsync1(((api.GoogleIamV1Policy response) { |
2709 checkGoogleIamV1Policy(response); | 2382 checkGoogleIamV1Policy(response); |
2710 }))); | 2383 }))); |
2711 }); | 2384 }); |
2712 | 2385 |
2713 unittest.test("method--testIamPermissions", () { | 2386 unittest.test("method--testIamPermissions", () { |
2714 | |
2715 var mock = new HttpServerMock(); | 2387 var mock = new HttpServerMock(); |
2716 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; | 2388 api.ProjectsModelsResourceApi res = new api.MlApi(mock).projects.models; |
2717 var arg_request = buildGoogleIamV1TestIamPermissionsRequest(); | 2389 var arg_request = buildGoogleIamV1TestIamPermissionsRequest(); |
2718 var arg_resource = "foo"; | 2390 var arg_resource = "foo"; |
2719 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2391 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2720 var obj = new api.GoogleIamV1TestIamPermissionsRequest.fromJson(json); | 2392 var obj = new api.GoogleIamV1TestIamPermissionsRequest.fromJson(json); |
2721 checkGoogleIamV1TestIamPermissionsRequest(obj); | 2393 checkGoogleIamV1TestIamPermissionsRequest(obj); |
2722 | 2394 |
2723 var path = (req.url).path; | 2395 var path = (req.url).path; |
2724 var pathOffset = 0; | 2396 var pathOffset = 0; |
2725 var index; | 2397 var index; |
2726 var subPart; | 2398 var subPart; |
2727 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2399 unittest.expect( |
| 2400 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2728 pathOffset += 1; | 2401 pathOffset += 1; |
2729 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2402 unittest.expect( |
| 2403 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2730 pathOffset += 3; | 2404 pathOffset += 3; |
2731 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2405 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2732 | 2406 |
2733 var query = (req.url).query; | 2407 var query = (req.url).query; |
2734 var queryOffset = 0; | 2408 var queryOffset = 0; |
2735 var queryMap = {}; | 2409 var queryMap = {}; |
2736 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2410 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2737 parseBool(n) { | 2411 parseBool(n) { |
2738 if (n == "true") return true; | 2412 if (n == "true") return true; |
2739 if (n == "false") return false; | 2413 if (n == "false") return false; |
2740 if (n == null) return null; | 2414 if (n == null) return null; |
2741 throw new core.ArgumentError("Invalid boolean: $n"); | 2415 throw new core.ArgumentError("Invalid boolean: $n"); |
2742 } | 2416 } |
| 2417 |
2743 if (query.length > 0) { | 2418 if (query.length > 0) { |
2744 for (var part in query.split("&")) { | 2419 for (var part in query.split("&")) { |
2745 var keyvalue = part.split("="); | 2420 var keyvalue = part.split("="); |
2746 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2421 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2422 core.Uri.decodeQueryComponent(keyvalue[1])); |
2747 } | 2423 } |
2748 } | 2424 } |
2749 | 2425 |
2750 | |
2751 var h = { | 2426 var h = { |
2752 "content-type" : "application/json; charset=utf-8", | 2427 "content-type": "application/json; charset=utf-8", |
2753 }; | 2428 }; |
2754 var resp = convert.JSON.encode(buildGoogleIamV1TestIamPermissionsRespons
e()); | 2429 var resp = |
| 2430 convert.JSON.encode(buildGoogleIamV1TestIamPermissionsResponse()); |
2755 return new async.Future.value(stringResponse(200, h, resp)); | 2431 return new async.Future.value(stringResponse(200, h, resp)); |
2756 }), true); | 2432 }), true); |
2757 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.GoogleIamV1TestIamPermissionsResponse response) { | 2433 res.testIamPermissions(arg_request, arg_resource).then(unittest |
| 2434 .expectAsync1(((api.GoogleIamV1TestIamPermissionsResponse response) { |
2758 checkGoogleIamV1TestIamPermissionsResponse(response); | 2435 checkGoogleIamV1TestIamPermissionsResponse(response); |
2759 }))); | 2436 }))); |
2760 }); | 2437 }); |
2761 | |
2762 }); | 2438 }); |
2763 | 2439 |
2764 | |
2765 unittest.group("resource-ProjectsModelsVersionsResourceApi", () { | 2440 unittest.group("resource-ProjectsModelsVersionsResourceApi", () { |
2766 unittest.test("method--create", () { | 2441 unittest.test("method--create", () { |
2767 | |
2768 var mock = new HttpServerMock(); | 2442 var mock = new HttpServerMock(); |
2769 api.ProjectsModelsVersionsResourceApi res = new api.MlApi(mock).projects.m
odels.versions; | 2443 api.ProjectsModelsVersionsResourceApi res = |
| 2444 new api.MlApi(mock).projects.models.versions; |
2770 var arg_request = buildGoogleCloudMlV1Version(); | 2445 var arg_request = buildGoogleCloudMlV1Version(); |
2771 var arg_parent = "foo"; | 2446 var arg_parent = "foo"; |
2772 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2447 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2773 var obj = new api.GoogleCloudMlV1Version.fromJson(json); | 2448 var obj = new api.GoogleCloudMlV1Version.fromJson(json); |
2774 checkGoogleCloudMlV1Version(obj); | 2449 checkGoogleCloudMlV1Version(obj); |
2775 | 2450 |
2776 var path = (req.url).path; | 2451 var path = (req.url).path; |
2777 var pathOffset = 0; | 2452 var pathOffset = 0; |
2778 var index; | 2453 var index; |
2779 var subPart; | 2454 var subPart; |
2780 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2455 unittest.expect( |
| 2456 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2781 pathOffset += 1; | 2457 pathOffset += 1; |
2782 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2458 unittest.expect( |
| 2459 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2783 pathOffset += 3; | 2460 pathOffset += 3; |
2784 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2461 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2785 | 2462 |
2786 var query = (req.url).query; | 2463 var query = (req.url).query; |
2787 var queryOffset = 0; | 2464 var queryOffset = 0; |
2788 var queryMap = {}; | 2465 var queryMap = {}; |
2789 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2466 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2790 parseBool(n) { | 2467 parseBool(n) { |
2791 if (n == "true") return true; | 2468 if (n == "true") return true; |
2792 if (n == "false") return false; | 2469 if (n == "false") return false; |
2793 if (n == null) return null; | 2470 if (n == null) return null; |
2794 throw new core.ArgumentError("Invalid boolean: $n"); | 2471 throw new core.ArgumentError("Invalid boolean: $n"); |
2795 } | 2472 } |
| 2473 |
2796 if (query.length > 0) { | 2474 if (query.length > 0) { |
2797 for (var part in query.split("&")) { | 2475 for (var part in query.split("&")) { |
2798 var keyvalue = part.split("="); | 2476 var keyvalue = part.split("="); |
2799 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2477 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2478 core.Uri.decodeQueryComponent(keyvalue[1])); |
2800 } | 2479 } |
2801 } | 2480 } |
2802 | 2481 |
2803 | |
2804 var h = { | 2482 var h = { |
2805 "content-type" : "application/json; charset=utf-8", | 2483 "content-type": "application/json; charset=utf-8", |
2806 }; | 2484 }; |
2807 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); | 2485 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); |
2808 return new async.Future.value(stringResponse(200, h, resp)); | 2486 return new async.Future.value(stringResponse(200, h, resp)); |
2809 }), true); | 2487 }), true); |
2810 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Googl
eLongrunningOperation response) { | 2488 res.create(arg_request, arg_parent).then( |
| 2489 unittest.expectAsync1(((api.GoogleLongrunningOperation response) { |
2811 checkGoogleLongrunningOperation(response); | 2490 checkGoogleLongrunningOperation(response); |
2812 }))); | 2491 }))); |
2813 }); | 2492 }); |
2814 | 2493 |
2815 unittest.test("method--delete", () { | 2494 unittest.test("method--delete", () { |
2816 | |
2817 var mock = new HttpServerMock(); | 2495 var mock = new HttpServerMock(); |
2818 api.ProjectsModelsVersionsResourceApi res = new api.MlApi(mock).projects.m
odels.versions; | 2496 api.ProjectsModelsVersionsResourceApi res = |
| 2497 new api.MlApi(mock).projects.models.versions; |
2819 var arg_name = "foo"; | 2498 var arg_name = "foo"; |
2820 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2499 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2821 var path = (req.url).path; | 2500 var path = (req.url).path; |
2822 var pathOffset = 0; | 2501 var pathOffset = 0; |
2823 var index; | 2502 var index; |
2824 var subPart; | 2503 var subPart; |
2825 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2504 unittest.expect( |
| 2505 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2826 pathOffset += 1; | 2506 pathOffset += 1; |
2827 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2507 unittest.expect( |
| 2508 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2828 pathOffset += 3; | 2509 pathOffset += 3; |
2829 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2510 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2830 | 2511 |
2831 var query = (req.url).query; | 2512 var query = (req.url).query; |
2832 var queryOffset = 0; | 2513 var queryOffset = 0; |
2833 var queryMap = {}; | 2514 var queryMap = {}; |
2834 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2515 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2835 parseBool(n) { | 2516 parseBool(n) { |
2836 if (n == "true") return true; | 2517 if (n == "true") return true; |
2837 if (n == "false") return false; | 2518 if (n == "false") return false; |
2838 if (n == null) return null; | 2519 if (n == null) return null; |
2839 throw new core.ArgumentError("Invalid boolean: $n"); | 2520 throw new core.ArgumentError("Invalid boolean: $n"); |
2840 } | 2521 } |
| 2522 |
2841 if (query.length > 0) { | 2523 if (query.length > 0) { |
2842 for (var part in query.split("&")) { | 2524 for (var part in query.split("&")) { |
2843 var keyvalue = part.split("="); | 2525 var keyvalue = part.split("="); |
2844 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2526 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2527 core.Uri.decodeQueryComponent(keyvalue[1])); |
2845 } | 2528 } |
2846 } | 2529 } |
2847 | 2530 |
2848 | |
2849 var h = { | 2531 var h = { |
2850 "content-type" : "application/json; charset=utf-8", | 2532 "content-type": "application/json; charset=utf-8", |
2851 }; | 2533 }; |
2852 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); | 2534 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); |
2853 return new async.Future.value(stringResponse(200, h, resp)); | 2535 return new async.Future.value(stringResponse(200, h, resp)); |
2854 }), true); | 2536 }), true); |
2855 res.delete(arg_name).then(unittest.expectAsync1(((api.GoogleLongrunningOpe
ration response) { | 2537 res.delete(arg_name).then( |
| 2538 unittest.expectAsync1(((api.GoogleLongrunningOperation response) { |
2856 checkGoogleLongrunningOperation(response); | 2539 checkGoogleLongrunningOperation(response); |
2857 }))); | 2540 }))); |
2858 }); | 2541 }); |
2859 | 2542 |
2860 unittest.test("method--get", () { | 2543 unittest.test("method--get", () { |
2861 | |
2862 var mock = new HttpServerMock(); | 2544 var mock = new HttpServerMock(); |
2863 api.ProjectsModelsVersionsResourceApi res = new api.MlApi(mock).projects.m
odels.versions; | 2545 api.ProjectsModelsVersionsResourceApi res = |
| 2546 new api.MlApi(mock).projects.models.versions; |
2864 var arg_name = "foo"; | 2547 var arg_name = "foo"; |
2865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2548 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2866 var path = (req.url).path; | 2549 var path = (req.url).path; |
2867 var pathOffset = 0; | 2550 var pathOffset = 0; |
2868 var index; | 2551 var index; |
2869 var subPart; | 2552 var subPart; |
2870 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2553 unittest.expect( |
| 2554 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2871 pathOffset += 1; | 2555 pathOffset += 1; |
2872 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2556 unittest.expect( |
| 2557 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2873 pathOffset += 3; | 2558 pathOffset += 3; |
2874 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2559 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2875 | 2560 |
2876 var query = (req.url).query; | 2561 var query = (req.url).query; |
2877 var queryOffset = 0; | 2562 var queryOffset = 0; |
2878 var queryMap = {}; | 2563 var queryMap = {}; |
2879 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2564 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2880 parseBool(n) { | 2565 parseBool(n) { |
2881 if (n == "true") return true; | 2566 if (n == "true") return true; |
2882 if (n == "false") return false; | 2567 if (n == "false") return false; |
2883 if (n == null) return null; | 2568 if (n == null) return null; |
2884 throw new core.ArgumentError("Invalid boolean: $n"); | 2569 throw new core.ArgumentError("Invalid boolean: $n"); |
2885 } | 2570 } |
| 2571 |
2886 if (query.length > 0) { | 2572 if (query.length > 0) { |
2887 for (var part in query.split("&")) { | 2573 for (var part in query.split("&")) { |
2888 var keyvalue = part.split("="); | 2574 var keyvalue = part.split("="); |
2889 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])); |
2890 } | 2577 } |
2891 } | 2578 } |
2892 | 2579 |
2893 | |
2894 var h = { | 2580 var h = { |
2895 "content-type" : "application/json; charset=utf-8", | 2581 "content-type": "application/json; charset=utf-8", |
2896 }; | 2582 }; |
2897 var resp = convert.JSON.encode(buildGoogleCloudMlV1Version()); | 2583 var resp = convert.JSON.encode(buildGoogleCloudMlV1Version()); |
2898 return new async.Future.value(stringResponse(200, h, resp)); | 2584 return new async.Future.value(stringResponse(200, h, resp)); |
2899 }), true); | 2585 }), true); |
2900 res.get(arg_name).then(unittest.expectAsync1(((api.GoogleCloudMlV1Version
response) { | 2586 res |
| 2587 .get(arg_name) |
| 2588 .then(unittest.expectAsync1(((api.GoogleCloudMlV1Version response) { |
2901 checkGoogleCloudMlV1Version(response); | 2589 checkGoogleCloudMlV1Version(response); |
2902 }))); | 2590 }))); |
2903 }); | 2591 }); |
2904 | 2592 |
2905 unittest.test("method--list", () { | 2593 unittest.test("method--list", () { |
2906 | |
2907 var mock = new HttpServerMock(); | 2594 var mock = new HttpServerMock(); |
2908 api.ProjectsModelsVersionsResourceApi res = new api.MlApi(mock).projects.m
odels.versions; | 2595 api.ProjectsModelsVersionsResourceApi res = |
| 2596 new api.MlApi(mock).projects.models.versions; |
2909 var arg_parent = "foo"; | 2597 var arg_parent = "foo"; |
2910 var arg_pageToken = "foo"; | 2598 var arg_pageToken = "foo"; |
2911 var arg_pageSize = 42; | 2599 var arg_pageSize = 42; |
2912 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2600 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2913 var path = (req.url).path; | 2601 var path = (req.url).path; |
2914 var pathOffset = 0; | 2602 var pathOffset = 0; |
2915 var index; | 2603 var index; |
2916 var subPart; | 2604 var subPart; |
2917 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2605 unittest.expect( |
| 2606 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2918 pathOffset += 1; | 2607 pathOffset += 1; |
2919 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2608 unittest.expect( |
| 2609 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2920 pathOffset += 3; | 2610 pathOffset += 3; |
2921 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2611 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2922 | 2612 |
2923 var query = (req.url).query; | 2613 var query = (req.url).query; |
2924 var queryOffset = 0; | 2614 var queryOffset = 0; |
2925 var queryMap = {}; | 2615 var queryMap = {}; |
2926 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2616 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2927 parseBool(n) { | 2617 parseBool(n) { |
2928 if (n == "true") return true; | 2618 if (n == "true") return true; |
2929 if (n == "false") return false; | 2619 if (n == "false") return false; |
2930 if (n == null) return null; | 2620 if (n == null) return null; |
2931 throw new core.ArgumentError("Invalid boolean: $n"); | 2621 throw new core.ArgumentError("Invalid boolean: $n"); |
2932 } | 2622 } |
| 2623 |
2933 if (query.length > 0) { | 2624 if (query.length > 0) { |
2934 for (var part in query.split("&")) { | 2625 for (var part in query.split("&")) { |
2935 var keyvalue = part.split("="); | 2626 var keyvalue = part.split("="); |
2936 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2627 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2628 core.Uri.decodeQueryComponent(keyvalue[1])); |
2937 } | 2629 } |
2938 } | 2630 } |
2939 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2631 unittest.expect( |
2940 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2632 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
2941 | 2633 unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| 2634 unittest.equals(arg_pageSize)); |
2942 | 2635 |
2943 var h = { | 2636 var h = { |
2944 "content-type" : "application/json; charset=utf-8", | 2637 "content-type": "application/json; charset=utf-8", |
2945 }; | 2638 }; |
2946 var resp = convert.JSON.encode(buildGoogleCloudMlV1ListVersionsResponse(
)); | 2639 var resp = |
| 2640 convert.JSON.encode(buildGoogleCloudMlV1ListVersionsResponse()); |
2947 return new async.Future.value(stringResponse(200, h, resp)); | 2641 return new async.Future.value(stringResponse(200, h, resp)); |
2948 }), true); | 2642 }), true); |
2949 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync1(((api.GoogleCloudMlV1ListVersionsResponse response) { | 2643 res |
| 2644 .list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize) |
| 2645 .then(unittest.expectAsync1( |
| 2646 ((api.GoogleCloudMlV1ListVersionsResponse response) { |
2950 checkGoogleCloudMlV1ListVersionsResponse(response); | 2647 checkGoogleCloudMlV1ListVersionsResponse(response); |
2951 }))); | 2648 }))); |
2952 }); | 2649 }); |
2953 | 2650 |
2954 unittest.test("method--setDefault", () { | 2651 unittest.test("method--setDefault", () { |
2955 | |
2956 var mock = new HttpServerMock(); | 2652 var mock = new HttpServerMock(); |
2957 api.ProjectsModelsVersionsResourceApi res = new api.MlApi(mock).projects.m
odels.versions; | 2653 api.ProjectsModelsVersionsResourceApi res = |
| 2654 new api.MlApi(mock).projects.models.versions; |
2958 var arg_request = buildGoogleCloudMlV1SetDefaultVersionRequest(); | 2655 var arg_request = buildGoogleCloudMlV1SetDefaultVersionRequest(); |
2959 var arg_name = "foo"; | 2656 var arg_name = "foo"; |
2960 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2657 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2961 var obj = new api.GoogleCloudMlV1SetDefaultVersionRequest.fromJson(json)
; | 2658 var obj = |
| 2659 new api.GoogleCloudMlV1SetDefaultVersionRequest.fromJson(json); |
2962 checkGoogleCloudMlV1SetDefaultVersionRequest(obj); | 2660 checkGoogleCloudMlV1SetDefaultVersionRequest(obj); |
2963 | 2661 |
2964 var path = (req.url).path; | 2662 var path = (req.url).path; |
2965 var pathOffset = 0; | 2663 var pathOffset = 0; |
2966 var index; | 2664 var index; |
2967 var subPart; | 2665 var subPart; |
2968 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2666 unittest.expect( |
| 2667 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2969 pathOffset += 1; | 2668 pathOffset += 1; |
2970 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2669 unittest.expect( |
| 2670 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
2971 pathOffset += 3; | 2671 pathOffset += 3; |
2972 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2672 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
2973 | 2673 |
2974 var query = (req.url).query; | 2674 var query = (req.url).query; |
2975 var queryOffset = 0; | 2675 var queryOffset = 0; |
2976 var queryMap = {}; | 2676 var queryMap = {}; |
2977 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2677 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2978 parseBool(n) { | 2678 parseBool(n) { |
2979 if (n == "true") return true; | 2679 if (n == "true") return true; |
2980 if (n == "false") return false; | 2680 if (n == "false") return false; |
2981 if (n == null) return null; | 2681 if (n == null) return null; |
2982 throw new core.ArgumentError("Invalid boolean: $n"); | 2682 throw new core.ArgumentError("Invalid boolean: $n"); |
2983 } | 2683 } |
| 2684 |
2984 if (query.length > 0) { | 2685 if (query.length > 0) { |
2985 for (var part in query.split("&")) { | 2686 for (var part in query.split("&")) { |
2986 var keyvalue = part.split("="); | 2687 var keyvalue = part.split("="); |
2987 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2688 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2689 core.Uri.decodeQueryComponent(keyvalue[1])); |
2988 } | 2690 } |
2989 } | 2691 } |
2990 | 2692 |
2991 | |
2992 var h = { | 2693 var h = { |
2993 "content-type" : "application/json; charset=utf-8", | 2694 "content-type": "application/json; charset=utf-8", |
2994 }; | 2695 }; |
2995 var resp = convert.JSON.encode(buildGoogleCloudMlV1Version()); | 2696 var resp = convert.JSON.encode(buildGoogleCloudMlV1Version()); |
2996 return new async.Future.value(stringResponse(200, h, resp)); | 2697 return new async.Future.value(stringResponse(200, h, resp)); |
2997 }), true); | 2698 }), true); |
2998 res.setDefault(arg_request, arg_name).then(unittest.expectAsync1(((api.Goo
gleCloudMlV1Version response) { | 2699 res |
| 2700 .setDefault(arg_request, arg_name) |
| 2701 .then(unittest.expectAsync1(((api.GoogleCloudMlV1Version response) { |
2999 checkGoogleCloudMlV1Version(response); | 2702 checkGoogleCloudMlV1Version(response); |
3000 }))); | 2703 }))); |
3001 }); | 2704 }); |
3002 | |
3003 }); | 2705 }); |
3004 | 2706 |
3005 | |
3006 unittest.group("resource-ProjectsOperationsResourceApi", () { | 2707 unittest.group("resource-ProjectsOperationsResourceApi", () { |
3007 unittest.test("method--cancel", () { | 2708 unittest.test("method--cancel", () { |
3008 | |
3009 var mock = new HttpServerMock(); | 2709 var mock = new HttpServerMock(); |
3010 api.ProjectsOperationsResourceApi res = new api.MlApi(mock).projects.opera
tions; | 2710 api.ProjectsOperationsResourceApi res = |
| 2711 new api.MlApi(mock).projects.operations; |
3011 var arg_name = "foo"; | 2712 var arg_name = "foo"; |
3012 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2713 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3013 var path = (req.url).path; | 2714 var path = (req.url).path; |
3014 var pathOffset = 0; | 2715 var pathOffset = 0; |
3015 var index; | 2716 var index; |
3016 var subPart; | 2717 var subPart; |
3017 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2718 unittest.expect( |
| 2719 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3018 pathOffset += 1; | 2720 pathOffset += 1; |
3019 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2721 unittest.expect( |
| 2722 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
3020 pathOffset += 3; | 2723 pathOffset += 3; |
3021 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2724 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
3022 | 2725 |
3023 var query = (req.url).query; | 2726 var query = (req.url).query; |
3024 var queryOffset = 0; | 2727 var queryOffset = 0; |
3025 var queryMap = {}; | 2728 var queryMap = {}; |
3026 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2729 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3027 parseBool(n) { | 2730 parseBool(n) { |
3028 if (n == "true") return true; | 2731 if (n == "true") return true; |
3029 if (n == "false") return false; | 2732 if (n == "false") return false; |
3030 if (n == null) return null; | 2733 if (n == null) return null; |
3031 throw new core.ArgumentError("Invalid boolean: $n"); | 2734 throw new core.ArgumentError("Invalid boolean: $n"); |
3032 } | 2735 } |
| 2736 |
3033 if (query.length > 0) { | 2737 if (query.length > 0) { |
3034 for (var part in query.split("&")) { | 2738 for (var part in query.split("&")) { |
3035 var keyvalue = part.split("="); | 2739 var keyvalue = part.split("="); |
3036 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2740 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2741 core.Uri.decodeQueryComponent(keyvalue[1])); |
3037 } | 2742 } |
3038 } | 2743 } |
3039 | 2744 |
3040 | |
3041 var h = { | 2745 var h = { |
3042 "content-type" : "application/json; charset=utf-8", | 2746 "content-type": "application/json; charset=utf-8", |
3043 }; | 2747 }; |
3044 var resp = convert.JSON.encode(buildGoogleProtobufEmpty()); | 2748 var resp = convert.JSON.encode(buildGoogleProtobufEmpty()); |
3045 return new async.Future.value(stringResponse(200, h, resp)); | 2749 return new async.Future.value(stringResponse(200, h, resp)); |
3046 }), true); | 2750 }), true); |
3047 res.cancel(arg_name).then(unittest.expectAsync1(((api.GoogleProtobufEmpty
response) { | 2751 res |
| 2752 .cancel(arg_name) |
| 2753 .then(unittest.expectAsync1(((api.GoogleProtobufEmpty response) { |
3048 checkGoogleProtobufEmpty(response); | 2754 checkGoogleProtobufEmpty(response); |
3049 }))); | 2755 }))); |
3050 }); | 2756 }); |
3051 | 2757 |
3052 unittest.test("method--delete", () { | 2758 unittest.test("method--delete", () { |
3053 | |
3054 var mock = new HttpServerMock(); | 2759 var mock = new HttpServerMock(); |
3055 api.ProjectsOperationsResourceApi res = new api.MlApi(mock).projects.opera
tions; | 2760 api.ProjectsOperationsResourceApi res = |
| 2761 new api.MlApi(mock).projects.operations; |
3056 var arg_name = "foo"; | 2762 var arg_name = "foo"; |
3057 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2763 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3058 var path = (req.url).path; | 2764 var path = (req.url).path; |
3059 var pathOffset = 0; | 2765 var pathOffset = 0; |
3060 var index; | 2766 var index; |
3061 var subPart; | 2767 var subPart; |
3062 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2768 unittest.expect( |
| 2769 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3063 pathOffset += 1; | 2770 pathOffset += 1; |
3064 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2771 unittest.expect( |
| 2772 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
3065 pathOffset += 3; | 2773 pathOffset += 3; |
3066 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2774 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
3067 | 2775 |
3068 var query = (req.url).query; | 2776 var query = (req.url).query; |
3069 var queryOffset = 0; | 2777 var queryOffset = 0; |
3070 var queryMap = {}; | 2778 var queryMap = {}; |
3071 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2779 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3072 parseBool(n) { | 2780 parseBool(n) { |
3073 if (n == "true") return true; | 2781 if (n == "true") return true; |
3074 if (n == "false") return false; | 2782 if (n == "false") return false; |
3075 if (n == null) return null; | 2783 if (n == null) return null; |
3076 throw new core.ArgumentError("Invalid boolean: $n"); | 2784 throw new core.ArgumentError("Invalid boolean: $n"); |
3077 } | 2785 } |
| 2786 |
3078 if (query.length > 0) { | 2787 if (query.length > 0) { |
3079 for (var part in query.split("&")) { | 2788 for (var part in query.split("&")) { |
3080 var keyvalue = part.split("="); | 2789 var keyvalue = part.split("="); |
3081 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2790 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2791 core.Uri.decodeQueryComponent(keyvalue[1])); |
3082 } | 2792 } |
3083 } | 2793 } |
3084 | 2794 |
3085 | |
3086 var h = { | 2795 var h = { |
3087 "content-type" : "application/json; charset=utf-8", | 2796 "content-type": "application/json; charset=utf-8", |
3088 }; | 2797 }; |
3089 var resp = convert.JSON.encode(buildGoogleProtobufEmpty()); | 2798 var resp = convert.JSON.encode(buildGoogleProtobufEmpty()); |
3090 return new async.Future.value(stringResponse(200, h, resp)); | 2799 return new async.Future.value(stringResponse(200, h, resp)); |
3091 }), true); | 2800 }), true); |
3092 res.delete(arg_name).then(unittest.expectAsync1(((api.GoogleProtobufEmpty
response) { | 2801 res |
| 2802 .delete(arg_name) |
| 2803 .then(unittest.expectAsync1(((api.GoogleProtobufEmpty response) { |
3093 checkGoogleProtobufEmpty(response); | 2804 checkGoogleProtobufEmpty(response); |
3094 }))); | 2805 }))); |
3095 }); | 2806 }); |
3096 | 2807 |
3097 unittest.test("method--get", () { | 2808 unittest.test("method--get", () { |
3098 | |
3099 var mock = new HttpServerMock(); | 2809 var mock = new HttpServerMock(); |
3100 api.ProjectsOperationsResourceApi res = new api.MlApi(mock).projects.opera
tions; | 2810 api.ProjectsOperationsResourceApi res = |
| 2811 new api.MlApi(mock).projects.operations; |
3101 var arg_name = "foo"; | 2812 var arg_name = "foo"; |
3102 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2813 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3103 var path = (req.url).path; | 2814 var path = (req.url).path; |
3104 var pathOffset = 0; | 2815 var pathOffset = 0; |
3105 var index; | 2816 var index; |
3106 var subPart; | 2817 var subPart; |
3107 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2818 unittest.expect( |
| 2819 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3108 pathOffset += 1; | 2820 pathOffset += 1; |
3109 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2821 unittest.expect( |
| 2822 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
3110 pathOffset += 3; | 2823 pathOffset += 3; |
3111 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2824 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
3112 | 2825 |
3113 var query = (req.url).query; | 2826 var query = (req.url).query; |
3114 var queryOffset = 0; | 2827 var queryOffset = 0; |
3115 var queryMap = {}; | 2828 var queryMap = {}; |
3116 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2829 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3117 parseBool(n) { | 2830 parseBool(n) { |
3118 if (n == "true") return true; | 2831 if (n == "true") return true; |
3119 if (n == "false") return false; | 2832 if (n == "false") return false; |
3120 if (n == null) return null; | 2833 if (n == null) return null; |
3121 throw new core.ArgumentError("Invalid boolean: $n"); | 2834 throw new core.ArgumentError("Invalid boolean: $n"); |
3122 } | 2835 } |
| 2836 |
3123 if (query.length > 0) { | 2837 if (query.length > 0) { |
3124 for (var part in query.split("&")) { | 2838 for (var part in query.split("&")) { |
3125 var keyvalue = part.split("="); | 2839 var keyvalue = part.split("="); |
3126 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2840 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2841 core.Uri.decodeQueryComponent(keyvalue[1])); |
3127 } | 2842 } |
3128 } | 2843 } |
3129 | 2844 |
3130 | |
3131 var h = { | 2845 var h = { |
3132 "content-type" : "application/json; charset=utf-8", | 2846 "content-type": "application/json; charset=utf-8", |
3133 }; | 2847 }; |
3134 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); | 2848 var resp = convert.JSON.encode(buildGoogleLongrunningOperation()); |
3135 return new async.Future.value(stringResponse(200, h, resp)); | 2849 return new async.Future.value(stringResponse(200, h, resp)); |
3136 }), true); | 2850 }), true); |
3137 res.get(arg_name).then(unittest.expectAsync1(((api.GoogleLongrunningOperat
ion response) { | 2851 res.get(arg_name).then( |
| 2852 unittest.expectAsync1(((api.GoogleLongrunningOperation response) { |
3138 checkGoogleLongrunningOperation(response); | 2853 checkGoogleLongrunningOperation(response); |
3139 }))); | 2854 }))); |
3140 }); | 2855 }); |
3141 | 2856 |
3142 unittest.test("method--list", () { | 2857 unittest.test("method--list", () { |
3143 | |
3144 var mock = new HttpServerMock(); | 2858 var mock = new HttpServerMock(); |
3145 api.ProjectsOperationsResourceApi res = new api.MlApi(mock).projects.opera
tions; | 2859 api.ProjectsOperationsResourceApi res = |
| 2860 new api.MlApi(mock).projects.operations; |
3146 var arg_name = "foo"; | 2861 var arg_name = "foo"; |
3147 var arg_pageToken = "foo"; | 2862 var arg_pageToken = "foo"; |
3148 var arg_pageSize = 42; | 2863 var arg_pageSize = 42; |
3149 var arg_filter = "foo"; | 2864 var arg_filter = "foo"; |
3150 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3151 var path = (req.url).path; | 2866 var path = (req.url).path; |
3152 var pathOffset = 0; | 2867 var pathOffset = 0; |
3153 var index; | 2868 var index; |
3154 var subPart; | 2869 var subPart; |
3155 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2870 unittest.expect( |
| 2871 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3156 pathOffset += 1; | 2872 pathOffset += 1; |
3157 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2873 unittest.expect( |
| 2874 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
3158 pathOffset += 3; | 2875 pathOffset += 3; |
3159 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2876 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
3160 | 2877 |
3161 var query = (req.url).query; | 2878 var query = (req.url).query; |
3162 var queryOffset = 0; | 2879 var queryOffset = 0; |
3163 var queryMap = {}; | 2880 var queryMap = {}; |
3164 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2881 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3165 parseBool(n) { | 2882 parseBool(n) { |
3166 if (n == "true") return true; | 2883 if (n == "true") return true; |
3167 if (n == "false") return false; | 2884 if (n == "false") return false; |
3168 if (n == null) return null; | 2885 if (n == null) return null; |
3169 throw new core.ArgumentError("Invalid boolean: $n"); | 2886 throw new core.ArgumentError("Invalid boolean: $n"); |
3170 } | 2887 } |
| 2888 |
3171 if (query.length > 0) { | 2889 if (query.length > 0) { |
3172 for (var part in query.split("&")) { | 2890 for (var part in query.split("&")) { |
3173 var keyvalue = part.split("="); | 2891 var keyvalue = part.split("="); |
3174 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2893 core.Uri.decodeQueryComponent(keyvalue[1])); |
3175 } | 2894 } |
3176 } | 2895 } |
3177 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2896 unittest.expect( |
3178 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2897 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 2898 unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| 2899 unittest.equals(arg_pageSize)); |
3179 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 2900 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
3180 | 2901 |
3181 | |
3182 var h = { | 2902 var h = { |
3183 "content-type" : "application/json; charset=utf-8", | 2903 "content-type": "application/json; charset=utf-8", |
3184 }; | 2904 }; |
3185 var resp = convert.JSON.encode(buildGoogleLongrunningListOperationsRespo
nse()); | 2905 var resp = |
| 2906 convert.JSON.encode(buildGoogleLongrunningListOperationsResponse()); |
3186 return new async.Future.value(stringResponse(200, h, resp)); | 2907 return new async.Future.value(stringResponse(200, h, resp)); |
3187 }), true); | 2908 }), true); |
3188 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync1(((api.GoogleLongrunningListOperationsR
esponse response) { | 2909 res |
| 2910 .list(arg_name, |
| 2911 pageToken: arg_pageToken, |
| 2912 pageSize: arg_pageSize, |
| 2913 filter: arg_filter) |
| 2914 .then(unittest.expectAsync1( |
| 2915 ((api.GoogleLongrunningListOperationsResponse response) { |
3189 checkGoogleLongrunningListOperationsResponse(response); | 2916 checkGoogleLongrunningListOperationsResponse(response); |
3190 }))); | 2917 }))); |
3191 }); | 2918 }); |
3192 | |
3193 }); | 2919 }); |
3194 | |
3195 | |
3196 } | 2920 } |
3197 | |
OLD | NEW |