| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis.translate.v2; | 3 library googleapis.translate.v2; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:collection' as collection; | 6 import 'dart:collection' as collection; |
| 7 import 'dart:async' as async; | 7 import 'dart:async' as async; |
| 8 import 'dart:convert' as convert; | 8 import 'dart:convert' as convert; |
| 9 | 9 |
| 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 final commons.ApiRequester _requester; | 131 final commons.ApiRequester _requester; |
| 132 | 132 |
| 133 LanguagesResourceApi(commons.ApiRequester client) : | 133 LanguagesResourceApi(commons.ApiRequester client) : |
| 134 _requester = client; | 134 _requester = client; |
| 135 | 135 |
| 136 /** | 136 /** |
| 137 * Returns a list of supported languages for translation. | 137 * Returns a list of supported languages for translation. |
| 138 * | 138 * |
| 139 * Request parameters: | 139 * Request parameters: |
| 140 * | 140 * |
| 141 * [model] - The model type for which supported languages should be returned. | |
| 142 * | |
| 143 * [target] - The language to use to return localized, human readable names of | 141 * [target] - The language to use to return localized, human readable names of |
| 144 * supported | 142 * supported |
| 145 * languages. | 143 * languages. |
| 146 * | 144 * |
| 145 * [model] - The model type for which supported languages should be returned. |
| 146 * |
| 147 * Completes with a [LanguagesListResponse]. | 147 * Completes with a [LanguagesListResponse]. |
| 148 * | 148 * |
| 149 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 149 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 150 * error. | 150 * error. |
| 151 * | 151 * |
| 152 * If the used [http.Client] completes with an error when making a REST call, | 152 * If the used [http.Client] completes with an error when making a REST call, |
| 153 * this method will complete with the same error. | 153 * this method will complete with the same error. |
| 154 */ | 154 */ |
| 155 async.Future<LanguagesListResponse> list({core.String model, core.String targe
t}) { | 155 async.Future<LanguagesListResponse> list({core.String target, core.String mode
l}) { |
| 156 var _url = null; | 156 var _url = null; |
| 157 var _queryParams = new core.Map(); | 157 var _queryParams = new core.Map(); |
| 158 var _uploadMedia = null; | 158 var _uploadMedia = null; |
| 159 var _uploadOptions = null; | 159 var _uploadOptions = null; |
| 160 var _downloadOptions = commons.DownloadOptions.Metadata; | 160 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 161 var _body = null; | 161 var _body = null; |
| 162 | 162 |
| 163 if (target != null) { |
| 164 _queryParams["target"] = [target]; |
| 165 } |
| 163 if (model != null) { | 166 if (model != null) { |
| 164 _queryParams["model"] = [model]; | 167 _queryParams["model"] = [model]; |
| 165 } | 168 } |
| 166 if (target != null) { | |
| 167 _queryParams["target"] = [target]; | |
| 168 } | |
| 169 | 169 |
| 170 _url = 'v2/languages'; | 170 _url = 'v2/languages'; |
| 171 | 171 |
| 172 var _response = _requester.request(_url, | 172 var _response = _requester.request(_url, |
| 173 "GET", | 173 "GET", |
| 174 body: _body, | 174 body: _body, |
| 175 queryParams: _queryParams, | 175 queryParams: _queryParams, |
| 176 uploadOptions: _uploadOptions, | 176 uploadOptions: _uploadOptions, |
| 177 uploadMedia: _uploadMedia, | 177 uploadMedia: _uploadMedia, |
| 178 downloadOptions: _downloadOptions); | 178 downloadOptions: _downloadOptions); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 194 * Request parameters: | 194 * Request parameters: |
| 195 * | 195 * |
| 196 * [q] - The input text to translate. Repeat this parameter to perform | 196 * [q] - The input text to translate. Repeat this parameter to perform |
| 197 * translation | 197 * translation |
| 198 * operations on multiple text inputs. | 198 * operations on multiple text inputs. |
| 199 * | 199 * |
| 200 * [target] - The language to use for translation of the input text, set to | 200 * [target] - The language to use for translation of the input text, set to |
| 201 * one of the | 201 * one of the |
| 202 * language codes listed in Language Support. | 202 * language codes listed in Language Support. |
| 203 * | 203 * |
| 204 * [model] - The `model` type requested for this translation. Valid values are | |
| 205 * listed in public documentation. | |
| 206 * | |
| 207 * [source] - The language of the source text, set to one of the language | 204 * [source] - The language of the source text, set to one of the language |
| 208 * codes listed in | 205 * codes listed in |
| 209 * Language Support. If the source language is not specified, the API will | 206 * Language Support. If the source language is not specified, the API will |
| 210 * attempt to identify the source language automatically and return it within | 207 * attempt to identify the source language automatically and return it within |
| 211 * the response. | 208 * the response. |
| 212 * | 209 * |
| 213 * [cid] - The customization id for translate | 210 * [cid] - The customization id for translate |
| 214 * | 211 * |
| 215 * [format] - The format of the source text, in either HTML (default) or | 212 * [format] - The format of the source text, in either HTML (default) or |
| 216 * plain-text. A | 213 * plain-text. A |
| 217 * value of "html" indicates HTML and a value of "text" indicates plain-text. | 214 * value of "html" indicates HTML and a value of "text" indicates plain-text. |
| 218 * Possible string values are: | 215 * Possible string values are: |
| 219 * - "html" : Specifies the input is in HTML | 216 * - "html" : Specifies the input is in HTML |
| 220 * - "text" : Specifies the input is in plain textual format | 217 * - "text" : Specifies the input is in plain textual format |
| 221 * | 218 * |
| 219 * [model] - The `model` type requested for this translation. Valid values are |
| 220 * listed in public documentation. |
| 221 * |
| 222 * Completes with a [TranslationsListResponse]. | 222 * Completes with a [TranslationsListResponse]. |
| 223 * | 223 * |
| 224 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 224 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 225 * error. | 225 * error. |
| 226 * | 226 * |
| 227 * If the used [http.Client] completes with an error when making a REST call, | 227 * If the used [http.Client] completes with an error when making a REST call, |
| 228 * this method will complete with the same error. | 228 * this method will complete with the same error. |
| 229 */ | 229 */ |
| 230 async.Future<TranslationsListResponse> list(core.List<core.String> q, core.Str
ing target, {core.String model, core.String source, core.List<core.String> cid,
core.String format}) { | 230 async.Future<TranslationsListResponse> list(core.List<core.String> q, core.Str
ing target, {core.String source, core.List<core.String> cid, core.String format,
core.String model}) { |
| 231 var _url = null; | 231 var _url = null; |
| 232 var _queryParams = new core.Map(); | 232 var _queryParams = new core.Map(); |
| 233 var _uploadMedia = null; | 233 var _uploadMedia = null; |
| 234 var _uploadOptions = null; | 234 var _uploadOptions = null; |
| 235 var _downloadOptions = commons.DownloadOptions.Metadata; | 235 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 236 var _body = null; | 236 var _body = null; |
| 237 | 237 |
| 238 if (q == null || q.isEmpty) { | 238 if (q == null || q.isEmpty) { |
| 239 throw new core.ArgumentError("Parameter q is required."); | 239 throw new core.ArgumentError("Parameter q is required."); |
| 240 } | 240 } |
| 241 _queryParams["q"] = q; | 241 _queryParams["q"] = q; |
| 242 if (target == null) { | 242 if (target == null) { |
| 243 throw new core.ArgumentError("Parameter target is required."); | 243 throw new core.ArgumentError("Parameter target is required."); |
| 244 } | 244 } |
| 245 _queryParams["target"] = [target]; | 245 _queryParams["target"] = [target]; |
| 246 if (model != null) { | |
| 247 _queryParams["model"] = [model]; | |
| 248 } | |
| 249 if (source != null) { | 246 if (source != null) { |
| 250 _queryParams["source"] = [source]; | 247 _queryParams["source"] = [source]; |
| 251 } | 248 } |
| 252 if (cid != null) { | 249 if (cid != null) { |
| 253 _queryParams["cid"] = cid; | 250 _queryParams["cid"] = cid; |
| 254 } | 251 } |
| 255 if (format != null) { | 252 if (format != null) { |
| 256 _queryParams["format"] = [format]; | 253 _queryParams["format"] = [format]; |
| 257 } | 254 } |
| 255 if (model != null) { |
| 256 _queryParams["model"] = [model]; |
| 257 } |
| 258 | 258 |
| 259 _url = 'v2'; | 259 _url = 'v2'; |
| 260 | 260 |
| 261 var _response = _requester.request(_url, | 261 var _response = _requester.request(_url, |
| 262 "GET", | 262 "GET", |
| 263 body: _body, | 263 body: _body, |
| 264 queryParams: _queryParams, | 264 queryParams: _queryParams, |
| 265 uploadOptions: _uploadOptions, | 265 uploadOptions: _uploadOptions, |
| 266 uploadMedia: _uploadMedia, | 266 uploadMedia: _uploadMedia, |
| 267 downloadOptions: _downloadOptions); | 267 downloadOptions: _downloadOptions); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 } | 639 } |
| 640 if (model != null) { | 640 if (model != null) { |
| 641 _json["model"] = model; | 641 _json["model"] = model; |
| 642 } | 642 } |
| 643 if (translatedText != null) { | 643 if (translatedText != null) { |
| 644 _json["translatedText"] = translatedText; | 644 _json["translatedText"] = translatedText; |
| 645 } | 645 } |
| 646 return _json; | 646 return _json; |
| 647 } | 647 } |
| 648 } | 648 } |
| OLD | NEW |