| OLD | NEW |
| 1 part of discovery_api_client_generator; | 1 part of discovery_api_client_generator; |
| 2 | 2 |
| 3 /// Generates a dart package with all APIs given in the constructor. | 3 /// Generates a dart package with all APIs given in the constructor. |
| 4 /// | 4 /// |
| 5 /// This class generates a dart package with the following layout: | 5 /// This class generates a dart package with the following layout: |
| 6 /// $packageFolderPath | 6 /// $packageFolderPath |
| 7 /// |- .gitignore | 7 /// |- .gitignore |
| 8 /// |- pubspec.yaml | 8 /// |- pubspec.yaml |
| 9 /// |- LICENSE | 9 /// |- LICENSE |
| 10 /// |- README.md | 10 /// |- README.md |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 | 845 |
| 846 // Validate that we have the correct number of bytes if length was | 846 // Validate that we have the correct number of bytes if length was |
| 847 // specified. | 847 // specified. |
| 848 if (_uploadMedia.length != null) { | 848 if (_uploadMedia.length != null) { |
| 849 if (end < _uploadMedia.length) { | 849 if (end < _uploadMedia.length) { |
| 850 completer.completeError(new common_external.ApiRequestError( | 850 completer.completeError(new common_external.ApiRequestError( |
| 851 'Received less bytes than indicated by [Media.length].')); | 851 'Received less bytes than indicated by [Media.length].')); |
| 852 return; | 852 return; |
| 853 } else if (end > _uploadMedia.length) { | 853 } else if (end > _uploadMedia.length) { |
| 854 completer.completeError(new common_external.ApiRequestError( | 854 completer.completeError(new common_external.ApiRequestError( |
| 855 'Received more bytes than indicated by [Media.length].'); | 855 'Received more bytes than indicated by [Media.length].')); |
| 856 return; | 856 return; |
| 857 } | 857 } |
| 858 } | 858 } |
| 859 | 859 |
| 860 // Upload last chunk and *do not drain the response* but complete | 860 // Upload last chunk and *do not drain the response* but complete |
| 861 // with it. | 861 // with it. |
| 862 _uploadChunkResumable(uploadUri, lastChunk, lastChunk: true) | 862 _uploadChunkResumable(uploadUri, lastChunk, lastChunk: true) |
| 863 .then((response) { | 863 .then((response) { |
| 864 completer.complete(response); | 864 completer.complete(response); |
| 865 }).catchError((error, stack) { | 865 }).catchError((error, stack) { |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 requester.request('s/foo/a1/a2/bar/s1/e', 'GET') | 2211 requester.request('s/foo/a1/a2/bar/s1/e', 'GET') |
| 2212 .then(expectAsync((response) { | 2212 .then(expectAsync((response) { |
| 2213 expect(response, isNull); | 2213 expect(response, isNull); |
| 2214 })); | 2214 })); |
| 2215 }); | 2215 }); |
| 2216 }); | 2216 }); |
| 2217 }); | 2217 }); |
| 2218 } | 2218 } |
| 2219 """; | 2219 """; |
| 2220 } | 2220 } |
| OLD | NEW |