OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Code generation for the file "integration_test_methods.dart". | 6 * Code generation for the file "integration_test_methods.dart". |
7 */ | 7 */ |
8 library codegenInttestMethods; | 8 library codegenInttestMethods; |
9 | 9 |
10 import 'dart:convert'; | 10 import 'dart:convert'; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 if (optionalArgs.isNotEmpty) { | 211 if (optionalArgs.isNotEmpty) { |
212 args.add('{${optionalArgs.join(', ')}}'); | 212 args.add('{${optionalArgs.join(', ')}}'); |
213 } | 213 } |
214 writeln(); | 214 writeln(); |
215 docComment(toHtmlVisitor.collectHtml(() { | 215 docComment(toHtmlVisitor.collectHtml(() { |
216 toHtmlVisitor.translateHtml(request.html); | 216 toHtmlVisitor.translateHtml(request.html); |
217 toHtmlVisitor.describePayload(request.params, 'Parameters'); | 217 toHtmlVisitor.describePayload(request.params, 'Parameters'); |
218 toHtmlVisitor.describePayload(request.result, 'Returns'); | 218 toHtmlVisitor.describePayload(request.result, 'Returns'); |
219 })); | 219 })); |
| 220 if (request.deprecated) { |
| 221 writeln('@deprecated'); |
| 222 } |
220 String resultClass; | 223 String resultClass; |
221 String futureClass; | 224 String futureClass; |
222 if (request.result == null) { | 225 if (request.result == null) { |
223 futureClass = 'Future'; | 226 futureClass = 'Future'; |
224 } else { | 227 } else { |
225 resultClass = camelJoin([request.domainName, request.method, 'result'], | 228 resultClass = camelJoin([request.domainName, request.method, 'result'], |
226 doCapitalize: true); | 229 doCapitalize: true); |
227 futureClass = 'Future<$resultClass>'; | 230 futureClass = 'Future<$resultClass>'; |
228 } | 231 } |
229 writeln('$futureClass $methodName(${args.join(', ')}) async {'); | 232 writeln('$futureClass $methodName(${args.join(', ')}) async {'); |
(...skipping 26 matching lines...) Expand all Loading... |
256 writeln('ResponseDecoder decoder = new ResponseDecoder($kind);'); | 259 writeln('ResponseDecoder decoder = new ResponseDecoder($kind);'); |
257 writeln("return new $resultClass.fromJson(decoder, 'result', result);"); | 260 writeln("return new $resultClass.fromJson(decoder, 'result', result);"); |
258 } else { | 261 } else { |
259 writeln('outOfTestExpect(result, isNull);'); | 262 writeln('outOfTestExpect(result, isNull);'); |
260 writeln('return null;'); | 263 writeln('return null;'); |
261 } | 264 } |
262 }); | 265 }); |
263 writeln('}'); | 266 writeln('}'); |
264 } | 267 } |
265 } | 268 } |
OLD | NEW |