Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: generated/googleapis/lib/prediction/v1_6.dart

Issue 1078053002: Roll of googleapis as of 4/7/2015. (Closed) Base URL: https://github.com/dart-lang/googleapis.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // This is a generated file (see the discoveryapis_generator project).
2
1 library googleapis.prediction.v1_6; 3 library googleapis.prediction.v1_6;
2 4
3 import "dart:core" as core; 5 import 'dart:core' as core;
4 import "dart:collection" as collection; 6 import 'dart:collection' as collection;
5 import "dart:async" as async; 7 import 'dart:async' as async;
6 import "dart:convert" as convert; 8 import 'dart:convert' as convert;
7 9
8 import "package:crypto/crypto.dart" as crypto; 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
11 import 'package:crypto/crypto.dart' as crypto;
9 import 'package:http/http.dart' as http; 12 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12 13
13 export '../common/common.dart' show ApiRequestError; 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show
14 export '../common/common.dart' show DetailedApiRequestError; 15 ApiRequestError, DetailedApiRequestError;
16
17 const core.String USER_AGENT = 'dart-api-client prediction/v1.6';
15 18
16 /** 19 /**
17 * Lets you access a cloud hosted machine learning service that makes it easy to 20 * Lets you access a cloud hosted machine learning service that makes it easy to
18 * build smart apps 21 * build smart apps
19 */ 22 */
20 class PredictionApi { 23 class PredictionApi {
21 /** Manage your data and permissions in Google Cloud Storage */ 24 /** Manage your data and permissions in Google Cloud Storage */
22 static const DevstorageFullControlScope = "https://www.googleapis.com/auth/dev storage.full_control"; 25 static const DevstorageFullControlScope = "https://www.googleapis.com/auth/dev storage.full_control";
23 26
24 /** View your data in Google Cloud Storage */ 27 /** View your data in Google Cloud Storage */
25 static const DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devsto rage.read_only"; 28 static const DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devsto rage.read_only";
26 29
27 /** Manage your data in Google Cloud Storage */ 30 /** Manage your data in Google Cloud Storage */
28 static const DevstorageReadWriteScope = "https://www.googleapis.com/auth/devst orage.read_write"; 31 static const DevstorageReadWriteScope = "https://www.googleapis.com/auth/devst orage.read_write";
29 32
30 /** Manage your data in the Google Prediction API */ 33 /** Manage your data in the Google Prediction API */
31 static const PredictionScope = "https://www.googleapis.com/auth/prediction"; 34 static const PredictionScope = "https://www.googleapis.com/auth/prediction";
32 35
33 36
34 final common_internal.ApiRequester _requester; 37 final commons.ApiRequester _requester;
35 38
36 HostedmodelsResourceApi get hostedmodels => new HostedmodelsResourceApi(_reque ster); 39 HostedmodelsResourceApi get hostedmodels => new HostedmodelsResourceApi(_reque ster);
37 TrainedmodelsResourceApi get trainedmodels => new TrainedmodelsResourceApi(_re quester); 40 TrainedmodelsResourceApi get trainedmodels => new TrainedmodelsResourceApi(_re quester);
38 41
39 PredictionApi(http.Client client, {core.String rootUrl: "https://www.googleapi s.com/", core.String servicePath: "prediction/v1.6/projects/"}) : 42 PredictionApi(http.Client client, {core.String rootUrl: "https://www.googleapi s.com/", core.String servicePath: "prediction/v1.6/projects/"}) :
40 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath ); 43 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
41 } 44 }
42 45
43 46
44 /** Not documented yet. */
45 class HostedmodelsResourceApi { 47 class HostedmodelsResourceApi {
46 final common_internal.ApiRequester _requester; 48 final commons.ApiRequester _requester;
47 49
48 HostedmodelsResourceApi(common_internal.ApiRequester client) : 50 HostedmodelsResourceApi(commons.ApiRequester client) :
49 _requester = client; 51 _requester = client;
50 52
51 /** 53 /**
52 * Submit input and request an output against a hosted model. 54 * Submit input and request an output against a hosted model.
53 * 55 *
54 * [request] - The metadata request object. 56 * [request] - The metadata request object.
55 * 57 *
56 * Request parameters: 58 * Request parameters:
57 * 59 *
58 * [project] - The project associated with the model. 60 * [project] - The project associated with the model.
59 * 61 *
60 * [hostedModelName] - The name of a hosted model. 62 * [hostedModelName] - The name of a hosted model.
61 * 63 *
62 * Completes with a [Output]. 64 * Completes with a [Output].
63 * 65 *
64 * Completes with a [common.ApiRequestError] if the API endpoint returned an 66 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
65 * error. 67 * error.
66 * 68 *
67 * If the used [http.Client] completes with an error when making a REST call, 69 * If the used [http.Client] completes with an error when making a REST call,
68 * this method will complete with the same error. 70 * this method will complete with the same error.
69 */ 71 */
70 async.Future<Output> predict(Input request, core.String project, core.String h ostedModelName) { 72 async.Future<Output> predict(Input request, core.String project, core.String h ostedModelName) {
71 var _url = null; 73 var _url = null;
72 var _queryParams = new core.Map(); 74 var _queryParams = new core.Map();
73 var _uploadMedia = null; 75 var _uploadMedia = null;
74 var _uploadOptions = null; 76 var _uploadOptions = null;
75 var _downloadOptions = common.DownloadOptions.Metadata; 77 var _downloadOptions = commons.DownloadOptions.Metadata;
76 var _body = null; 78 var _body = null;
77 79
78 if (request != null) { 80 if (request != null) {
79 _body = convert.JSON.encode((request).toJson()); 81 _body = convert.JSON.encode((request).toJson());
80 } 82 }
81 if (project == null) { 83 if (project == null) {
82 throw new core.ArgumentError("Parameter project is required."); 84 throw new core.ArgumentError("Parameter project is required.");
83 } 85 }
84 if (hostedModelName == null) { 86 if (hostedModelName == null) {
85 throw new core.ArgumentError("Parameter hostedModelName is required."); 87 throw new core.ArgumentError("Parameter hostedModelName is required.");
86 } 88 }
87 89
88 90
89 _url = common_internal.Escaper.ecapeVariable('$project') + '/hostedmodels/' + common_internal.Escaper.ecapeVariable('$hostedModelName') + '/predict'; 91 _url = commons.Escaper.ecapeVariable('$project') + '/hostedmodels/' + common s.Escaper.ecapeVariable('$hostedModelName') + '/predict';
90 92
91 var _response = _requester.request(_url, 93 var _response = _requester.request(_url,
92 "POST", 94 "POST",
93 body: _body, 95 body: _body,
94 queryParams: _queryParams, 96 queryParams: _queryParams,
95 uploadOptions: _uploadOptions, 97 uploadOptions: _uploadOptions,
96 uploadMedia: _uploadMedia, 98 uploadMedia: _uploadMedia,
97 downloadOptions: _downloadOptions); 99 downloadOptions: _downloadOptions);
98 return _response.then((data) => new Output.fromJson(data)); 100 return _response.then((data) => new Output.fromJson(data));
99 } 101 }
100 102
101 } 103 }
102 104
103 105
104 /** Not documented yet. */
105 class TrainedmodelsResourceApi { 106 class TrainedmodelsResourceApi {
106 final common_internal.ApiRequester _requester; 107 final commons.ApiRequester _requester;
107 108
108 TrainedmodelsResourceApi(common_internal.ApiRequester client) : 109 TrainedmodelsResourceApi(commons.ApiRequester client) :
109 _requester = client; 110 _requester = client;
110 111
111 /** 112 /**
112 * Get analysis of the model and the data the model was trained on. 113 * Get analysis of the model and the data the model was trained on.
113 * 114 *
114 * Request parameters: 115 * Request parameters:
115 * 116 *
116 * [project] - The project associated with the model. 117 * [project] - The project associated with the model.
117 * 118 *
118 * [id] - The unique name for the predictive model. 119 * [id] - The unique name for the predictive model.
119 * 120 *
120 * Completes with a [Analyze]. 121 * Completes with a [Analyze].
121 * 122 *
122 * Completes with a [common.ApiRequestError] if the API endpoint returned an 123 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
123 * error. 124 * error.
124 * 125 *
125 * If the used [http.Client] completes with an error when making a REST call, 126 * If the used [http.Client] completes with an error when making a REST call,
126 * this method will complete with the same error. 127 * this method will complete with the same error.
127 */ 128 */
128 async.Future<Analyze> analyze(core.String project, core.String id) { 129 async.Future<Analyze> analyze(core.String project, core.String id) {
129 var _url = null; 130 var _url = null;
130 var _queryParams = new core.Map(); 131 var _queryParams = new core.Map();
131 var _uploadMedia = null; 132 var _uploadMedia = null;
132 var _uploadOptions = null; 133 var _uploadOptions = null;
133 var _downloadOptions = common.DownloadOptions.Metadata; 134 var _downloadOptions = commons.DownloadOptions.Metadata;
134 var _body = null; 135 var _body = null;
135 136
136 if (project == null) { 137 if (project == null) {
137 throw new core.ArgumentError("Parameter project is required."); 138 throw new core.ArgumentError("Parameter project is required.");
138 } 139 }
139 if (id == null) { 140 if (id == null) {
140 throw new core.ArgumentError("Parameter id is required."); 141 throw new core.ArgumentError("Parameter id is required.");
141 } 142 }
142 143
143 144
144 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id') + '/analyze'; 145 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo ns.Escaper.ecapeVariable('$id') + '/analyze';
145 146
146 var _response = _requester.request(_url, 147 var _response = _requester.request(_url,
147 "GET", 148 "GET",
148 body: _body, 149 body: _body,
149 queryParams: _queryParams, 150 queryParams: _queryParams,
150 uploadOptions: _uploadOptions, 151 uploadOptions: _uploadOptions,
151 uploadMedia: _uploadMedia, 152 uploadMedia: _uploadMedia,
152 downloadOptions: _downloadOptions); 153 downloadOptions: _downloadOptions);
153 return _response.then((data) => new Analyze.fromJson(data)); 154 return _response.then((data) => new Analyze.fromJson(data));
154 } 155 }
155 156
156 /** 157 /**
157 * Delete a trained model. 158 * Delete a trained model.
158 * 159 *
159 * Request parameters: 160 * Request parameters:
160 * 161 *
161 * [project] - The project associated with the model. 162 * [project] - The project associated with the model.
162 * 163 *
163 * [id] - The unique name for the predictive model. 164 * [id] - The unique name for the predictive model.
164 * 165 *
165 * Completes with a [common.ApiRequestError] if the API endpoint returned an 166 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
166 * error. 167 * error.
167 * 168 *
168 * If the used [http.Client] completes with an error when making a REST call, 169 * If the used [http.Client] completes with an error when making a REST call,
169 * this method will complete with the same error. 170 * this method will complete with the same error.
170 */ 171 */
171 async.Future delete(core.String project, core.String id) { 172 async.Future delete(core.String project, core.String id) {
172 var _url = null; 173 var _url = null;
173 var _queryParams = new core.Map(); 174 var _queryParams = new core.Map();
174 var _uploadMedia = null; 175 var _uploadMedia = null;
175 var _uploadOptions = null; 176 var _uploadOptions = null;
176 var _downloadOptions = common.DownloadOptions.Metadata; 177 var _downloadOptions = commons.DownloadOptions.Metadata;
177 var _body = null; 178 var _body = null;
178 179
179 if (project == null) { 180 if (project == null) {
180 throw new core.ArgumentError("Parameter project is required."); 181 throw new core.ArgumentError("Parameter project is required.");
181 } 182 }
182 if (id == null) { 183 if (id == null) {
183 throw new core.ArgumentError("Parameter id is required."); 184 throw new core.ArgumentError("Parameter id is required.");
184 } 185 }
185 186
186 _downloadOptions = null; 187 _downloadOptions = null;
187 188
188 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id'); 189 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo ns.Escaper.ecapeVariable('$id');
189 190
190 var _response = _requester.request(_url, 191 var _response = _requester.request(_url,
191 "DELETE", 192 "DELETE",
192 body: _body, 193 body: _body,
193 queryParams: _queryParams, 194 queryParams: _queryParams,
194 uploadOptions: _uploadOptions, 195 uploadOptions: _uploadOptions,
195 uploadMedia: _uploadMedia, 196 uploadMedia: _uploadMedia,
196 downloadOptions: _downloadOptions); 197 downloadOptions: _downloadOptions);
197 return _response.then((data) => null); 198 return _response.then((data) => null);
198 } 199 }
199 200
200 /** 201 /**
201 * Check training status of your model. 202 * Check training status of your model.
202 * 203 *
203 * Request parameters: 204 * Request parameters:
204 * 205 *
205 * [project] - The project associated with the model. 206 * [project] - The project associated with the model.
206 * 207 *
207 * [id] - The unique name for the predictive model. 208 * [id] - The unique name for the predictive model.
208 * 209 *
209 * Completes with a [Insert2]. 210 * Completes with a [Insert2].
210 * 211 *
211 * Completes with a [common.ApiRequestError] if the API endpoint returned an 212 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
212 * error. 213 * error.
213 * 214 *
214 * If the used [http.Client] completes with an error when making a REST call, 215 * If the used [http.Client] completes with an error when making a REST call,
215 * this method will complete with the same error. 216 * this method will complete with the same error.
216 */ 217 */
217 async.Future<Insert2> get(core.String project, core.String id) { 218 async.Future<Insert2> get(core.String project, core.String id) {
218 var _url = null; 219 var _url = null;
219 var _queryParams = new core.Map(); 220 var _queryParams = new core.Map();
220 var _uploadMedia = null; 221 var _uploadMedia = null;
221 var _uploadOptions = null; 222 var _uploadOptions = null;
222 var _downloadOptions = common.DownloadOptions.Metadata; 223 var _downloadOptions = commons.DownloadOptions.Metadata;
223 var _body = null; 224 var _body = null;
224 225
225 if (project == null) { 226 if (project == null) {
226 throw new core.ArgumentError("Parameter project is required."); 227 throw new core.ArgumentError("Parameter project is required.");
227 } 228 }
228 if (id == null) { 229 if (id == null) {
229 throw new core.ArgumentError("Parameter id is required."); 230 throw new core.ArgumentError("Parameter id is required.");
230 } 231 }
231 232
232 233
233 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id'); 234 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo ns.Escaper.ecapeVariable('$id');
234 235
235 var _response = _requester.request(_url, 236 var _response = _requester.request(_url,
236 "GET", 237 "GET",
237 body: _body, 238 body: _body,
238 queryParams: _queryParams, 239 queryParams: _queryParams,
239 uploadOptions: _uploadOptions, 240 uploadOptions: _uploadOptions,
240 uploadMedia: _uploadMedia, 241 uploadMedia: _uploadMedia,
241 downloadOptions: _downloadOptions); 242 downloadOptions: _downloadOptions);
242 return _response.then((data) => new Insert2.fromJson(data)); 243 return _response.then((data) => new Insert2.fromJson(data));
243 } 244 }
244 245
245 /** 246 /**
246 * Train a Prediction API model. 247 * Train a Prediction API model.
247 * 248 *
248 * [request] - The metadata request object. 249 * [request] - The metadata request object.
249 * 250 *
250 * Request parameters: 251 * Request parameters:
251 * 252 *
252 * [project] - The project associated with the model. 253 * [project] - The project associated with the model.
253 * 254 *
254 * Completes with a [Insert2]. 255 * Completes with a [Insert2].
255 * 256 *
256 * Completes with a [common.ApiRequestError] if the API endpoint returned an 257 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
257 * error. 258 * error.
258 * 259 *
259 * If the used [http.Client] completes with an error when making a REST call, 260 * If the used [http.Client] completes with an error when making a REST call,
260 * this method will complete with the same error. 261 * this method will complete with the same error.
261 */ 262 */
262 async.Future<Insert2> insert(Insert request, core.String project) { 263 async.Future<Insert2> insert(Insert request, core.String project) {
263 var _url = null; 264 var _url = null;
264 var _queryParams = new core.Map(); 265 var _queryParams = new core.Map();
265 var _uploadMedia = null; 266 var _uploadMedia = null;
266 var _uploadOptions = null; 267 var _uploadOptions = null;
267 var _downloadOptions = common.DownloadOptions.Metadata; 268 var _downloadOptions = commons.DownloadOptions.Metadata;
268 var _body = null; 269 var _body = null;
269 270
270 if (request != null) { 271 if (request != null) {
271 _body = convert.JSON.encode((request).toJson()); 272 _body = convert.JSON.encode((request).toJson());
272 } 273 }
273 if (project == null) { 274 if (project == null) {
274 throw new core.ArgumentError("Parameter project is required."); 275 throw new core.ArgumentError("Parameter project is required.");
275 } 276 }
276 277
277 278
278 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels'; 279 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels';
279 280
280 var _response = _requester.request(_url, 281 var _response = _requester.request(_url,
281 "POST", 282 "POST",
282 body: _body, 283 body: _body,
283 queryParams: _queryParams, 284 queryParams: _queryParams,
284 uploadOptions: _uploadOptions, 285 uploadOptions: _uploadOptions,
285 uploadMedia: _uploadMedia, 286 uploadMedia: _uploadMedia,
286 downloadOptions: _downloadOptions); 287 downloadOptions: _downloadOptions);
287 return _response.then((data) => new Insert2.fromJson(data)); 288 return _response.then((data) => new Insert2.fromJson(data));
288 } 289 }
289 290
290 /** 291 /**
291 * List available models. 292 * List available models.
292 * 293 *
293 * Request parameters: 294 * Request parameters:
294 * 295 *
295 * [project] - The project associated with the model. 296 * [project] - The project associated with the model.
296 * 297 *
297 * [maxResults] - Maximum number of results to return. 298 * [maxResults] - Maximum number of results to return.
298 * 299 *
299 * [pageToken] - Pagination token. 300 * [pageToken] - Pagination token.
300 * 301 *
301 * Completes with a [List]. 302 * Completes with a [List].
302 * 303 *
303 * Completes with a [common.ApiRequestError] if the API endpoint returned an 304 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
304 * error. 305 * error.
305 * 306 *
306 * If the used [http.Client] completes with an error when making a REST call, 307 * If the used [http.Client] completes with an error when making a REST call,
307 * this method will complete with the same error. 308 * this method will complete with the same error.
308 */ 309 */
309 async.Future<List> list(core.String project, {core.int maxResults, core.String pageToken}) { 310 async.Future<List> list(core.String project, {core.int maxResults, core.String pageToken}) {
310 var _url = null; 311 var _url = null;
311 var _queryParams = new core.Map(); 312 var _queryParams = new core.Map();
312 var _uploadMedia = null; 313 var _uploadMedia = null;
313 var _uploadOptions = null; 314 var _uploadOptions = null;
314 var _downloadOptions = common.DownloadOptions.Metadata; 315 var _downloadOptions = commons.DownloadOptions.Metadata;
315 var _body = null; 316 var _body = null;
316 317
317 if (project == null) { 318 if (project == null) {
318 throw new core.ArgumentError("Parameter project is required."); 319 throw new core.ArgumentError("Parameter project is required.");
319 } 320 }
320 if (maxResults != null) { 321 if (maxResults != null) {
321 _queryParams["maxResults"] = ["${maxResults}"]; 322 _queryParams["maxResults"] = ["${maxResults}"];
322 } 323 }
323 if (pageToken != null) { 324 if (pageToken != null) {
324 _queryParams["pageToken"] = [pageToken]; 325 _queryParams["pageToken"] = [pageToken];
325 } 326 }
326 327
327 328
328 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/l ist'; 329 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/list';
329 330
330 var _response = _requester.request(_url, 331 var _response = _requester.request(_url,
331 "GET", 332 "GET",
332 body: _body, 333 body: _body,
333 queryParams: _queryParams, 334 queryParams: _queryParams,
334 uploadOptions: _uploadOptions, 335 uploadOptions: _uploadOptions,
335 uploadMedia: _uploadMedia, 336 uploadMedia: _uploadMedia,
336 downloadOptions: _downloadOptions); 337 downloadOptions: _downloadOptions);
337 return _response.then((data) => new List.fromJson(data)); 338 return _response.then((data) => new List.fromJson(data));
338 } 339 }
339 340
340 /** 341 /**
341 * Submit model id and request a prediction. 342 * Submit model id and request a prediction.
342 * 343 *
343 * [request] - The metadata request object. 344 * [request] - The metadata request object.
344 * 345 *
345 * Request parameters: 346 * Request parameters:
346 * 347 *
347 * [project] - The project associated with the model. 348 * [project] - The project associated with the model.
348 * 349 *
349 * [id] - The unique name for the predictive model. 350 * [id] - The unique name for the predictive model.
350 * 351 *
351 * Completes with a [Output]. 352 * Completes with a [Output].
352 * 353 *
353 * Completes with a [common.ApiRequestError] if the API endpoint returned an 354 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
354 * error. 355 * error.
355 * 356 *
356 * If the used [http.Client] completes with an error when making a REST call, 357 * If the used [http.Client] completes with an error when making a REST call,
357 * this method will complete with the same error. 358 * this method will complete with the same error.
358 */ 359 */
359 async.Future<Output> predict(Input request, core.String project, core.String i d) { 360 async.Future<Output> predict(Input request, core.String project, core.String i d) {
360 var _url = null; 361 var _url = null;
361 var _queryParams = new core.Map(); 362 var _queryParams = new core.Map();
362 var _uploadMedia = null; 363 var _uploadMedia = null;
363 var _uploadOptions = null; 364 var _uploadOptions = null;
364 var _downloadOptions = common.DownloadOptions.Metadata; 365 var _downloadOptions = commons.DownloadOptions.Metadata;
365 var _body = null; 366 var _body = null;
366 367
367 if (request != null) { 368 if (request != null) {
368 _body = convert.JSON.encode((request).toJson()); 369 _body = convert.JSON.encode((request).toJson());
369 } 370 }
370 if (project == null) { 371 if (project == null) {
371 throw new core.ArgumentError("Parameter project is required."); 372 throw new core.ArgumentError("Parameter project is required.");
372 } 373 }
373 if (id == null) { 374 if (id == null) {
374 throw new core.ArgumentError("Parameter id is required."); 375 throw new core.ArgumentError("Parameter id is required.");
375 } 376 }
376 377
377 378
378 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id') + '/predict'; 379 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo ns.Escaper.ecapeVariable('$id') + '/predict';
379 380
380 var _response = _requester.request(_url, 381 var _response = _requester.request(_url,
381 "POST", 382 "POST",
382 body: _body, 383 body: _body,
383 queryParams: _queryParams, 384 queryParams: _queryParams,
384 uploadOptions: _uploadOptions, 385 uploadOptions: _uploadOptions,
385 uploadMedia: _uploadMedia, 386 uploadMedia: _uploadMedia,
386 downloadOptions: _downloadOptions); 387 downloadOptions: _downloadOptions);
387 return _response.then((data) => new Output.fromJson(data)); 388 return _response.then((data) => new Output.fromJson(data));
388 } 389 }
389 390
390 /** 391 /**
391 * Add new data to a trained model. 392 * Add new data to a trained model.
392 * 393 *
393 * [request] - The metadata request object. 394 * [request] - The metadata request object.
394 * 395 *
395 * Request parameters: 396 * Request parameters:
396 * 397 *
397 * [project] - The project associated with the model. 398 * [project] - The project associated with the model.
398 * 399 *
399 * [id] - The unique name for the predictive model. 400 * [id] - The unique name for the predictive model.
400 * 401 *
401 * Completes with a [Insert2]. 402 * Completes with a [Insert2].
402 * 403 *
403 * Completes with a [common.ApiRequestError] if the API endpoint returned an 404 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
404 * error. 405 * error.
405 * 406 *
406 * If the used [http.Client] completes with an error when making a REST call, 407 * If the used [http.Client] completes with an error when making a REST call,
407 * this method will complete with the same error. 408 * this method will complete with the same error.
408 */ 409 */
409 async.Future<Insert2> update(Update request, core.String project, core.String id) { 410 async.Future<Insert2> update(Update request, core.String project, core.String id) {
410 var _url = null; 411 var _url = null;
411 var _queryParams = new core.Map(); 412 var _queryParams = new core.Map();
412 var _uploadMedia = null; 413 var _uploadMedia = null;
413 var _uploadOptions = null; 414 var _uploadOptions = null;
414 var _downloadOptions = common.DownloadOptions.Metadata; 415 var _downloadOptions = commons.DownloadOptions.Metadata;
415 var _body = null; 416 var _body = null;
416 417
417 if (request != null) { 418 if (request != null) {
418 _body = convert.JSON.encode((request).toJson()); 419 _body = convert.JSON.encode((request).toJson());
419 } 420 }
420 if (project == null) { 421 if (project == null) {
421 throw new core.ArgumentError("Parameter project is required."); 422 throw new core.ArgumentError("Parameter project is required.");
422 } 423 }
423 if (id == null) { 424 if (id == null) {
424 throw new core.ArgumentError("Parameter id is required."); 425 throw new core.ArgumentError("Parameter id is required.");
425 } 426 }
426 427
427 428
428 _url = common_internal.Escaper.ecapeVariable('$project') + '/trainedmodels/' + common_internal.Escaper.ecapeVariable('$id'); 429 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo ns.Escaper.ecapeVariable('$id');
429 430
430 var _response = _requester.request(_url, 431 var _response = _requester.request(_url,
431 "PUT", 432 "PUT",
432 body: _body, 433 body: _body,
433 queryParams: _queryParams, 434 queryParams: _queryParams,
434 uploadOptions: _uploadOptions, 435 uploadOptions: _uploadOptions,
435 uploadMedia: _uploadMedia, 436 uploadMedia: _uploadMedia,
436 downloadOptions: _downloadOptions); 437 downloadOptions: _downloadOptions);
437 return _response.then((data) => new Insert2.fromJson(data)); 438 return _response.then((data) => new Insert2.fromJson(data));
438 } 439 }
439 440
440 } 441 }
441 442
442 443
443 444
444 /** Not documented yet. */
445 class AnalyzeDataDescriptionFeaturesCategoricalValues { 445 class AnalyzeDataDescriptionFeaturesCategoricalValues {
446 /** Number of times this feature had this value. */ 446 /** Number of times this feature had this value. */
447 core.String count; 447 core.String count;
448 448
449 /** The category name. */ 449 /** The category name. */
450 core.String value; 450 core.String value;
451 451
452 452
453 AnalyzeDataDescriptionFeaturesCategoricalValues(); 453 AnalyzeDataDescriptionFeaturesCategoricalValues();
454 454
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 core.Map toJson() { 566 core.Map toJson() {
567 var _json = new core.Map(); 567 var _json = new core.Map();
568 if (count != null) { 568 if (count != null) {
569 _json["count"] = count; 569 _json["count"] = count;
570 } 570 }
571 return _json; 571 return _json;
572 } 572 }
573 } 573 }
574 574
575 575
576 /** Not documented yet. */
577 class AnalyzeDataDescriptionFeatures { 576 class AnalyzeDataDescriptionFeatures {
578 /** Description of the categorical values of this feature. */ 577 /** Description of the categorical values of this feature. */
579 AnalyzeDataDescriptionFeaturesCategorical categorical; 578 AnalyzeDataDescriptionFeaturesCategorical categorical;
580 579
581 /** The feature index. */ 580 /** The feature index. */
582 core.String index; 581 core.String index;
583 582
584 /** Description of the numeric values of this feature. */ 583 /** Description of the numeric values of this feature. */
585 AnalyzeDataDescriptionFeaturesNumeric numeric; 584 AnalyzeDataDescriptionFeaturesNumeric numeric;
586 585
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 _json["mean"] = mean; 658 _json["mean"] = mean;
660 } 659 }
661 if (variance != null) { 660 if (variance != null) {
662 _json["variance"] = variance; 661 _json["variance"] = variance;
663 } 662 }
664 return _json; 663 return _json;
665 } 664 }
666 } 665 }
667 666
668 667
669 /** Not documented yet. */
670 class AnalyzeDataDescriptionOutputFeatureText { 668 class AnalyzeDataDescriptionOutputFeatureText {
671 /** Number of times the output label occurred in the data set. */ 669 /** Number of times the output label occurred in the data set. */
672 core.String count; 670 core.String count;
673 671
674 /** The output label. */ 672 /** The output label. */
675 core.String value; 673 core.String value;
676 674
677 675
678 AnalyzeDataDescriptionOutputFeatureText(); 676 AnalyzeDataDescriptionOutputFeatureText();
679 677
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 _json["confusionMatrixRowTotals"] = confusionMatrixRowTotals; 805 _json["confusionMatrixRowTotals"] = confusionMatrixRowTotals;
808 } 806 }
809 if (modelinfo != null) { 807 if (modelinfo != null) {
810 _json["modelinfo"] = (modelinfo).toJson(); 808 _json["modelinfo"] = (modelinfo).toJson();
811 } 809 }
812 return _json; 810 return _json;
813 } 811 }
814 } 812 }
815 813
816 814
817 /** Not documented yet. */
818 class Analyze { 815 class Analyze {
819 /** Description of the data the model was trained on. */ 816 /** Description of the data the model was trained on. */
820 AnalyzeDataDescription dataDescription; 817 AnalyzeDataDescription dataDescription;
821 818
822 /** List of errors with the data. */ 819 /** List of errors with the data. */
823 core.List<core.Map<core.String, core.String>> errors; 820 core.List<core.Map<core.String, core.String>> errors;
824 821
825 /** The unique name for the predictive model. */ 822 /** The unique name for the predictive model. */
826 core.String id; 823 core.String id;
827 824
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 core.Map toJson() { 902 core.Map toJson() {
906 var _json = new core.Map(); 903 var _json = new core.Map();
907 if (csvInstance != null) { 904 if (csvInstance != null) {
908 _json["csvInstance"] = csvInstance; 905 _json["csvInstance"] = csvInstance;
909 } 906 }
910 return _json; 907 return _json;
911 } 908 }
912 } 909 }
913 910
914 911
915 /** Not documented yet. */
916 class Input { 912 class Input {
917 /** Input to the model for a prediction. */ 913 /** Input to the model for a prediction. */
918 InputInput input; 914 InputInput input;
919 915
920 916
921 Input(); 917 Input();
922 918
923 Input.fromJson(core.Map _json) { 919 Input.fromJson(core.Map _json) {
924 if (_json.containsKey("input")) { 920 if (_json.containsKey("input")) {
925 input = new InputInput.fromJson(_json["input"]); 921 input = new InputInput.fromJson(_json["input"]);
926 } 922 }
927 } 923 }
928 924
929 core.Map toJson() { 925 core.Map toJson() {
930 var _json = new core.Map(); 926 var _json = new core.Map();
931 if (input != null) { 927 if (input != null) {
932 _json["input"] = (input).toJson(); 928 _json["input"] = (input).toJson();
933 } 929 }
934 return _json; 930 return _json;
935 } 931 }
936 } 932 }
937 933
938 934
939 /** Not documented yet. */
940 class InsertTrainingInstances { 935 class InsertTrainingInstances {
941 /** 936 /**
942 * The input features for this instance. 937 * The input features for this instance.
943 * 938 *
944 * The values for Object must be JSON objects. It can consist of `num`, 939 * The values for Object must be JSON objects. It can consist of `num`,
945 * `String`, `bool` and `null` as well as `Map` and `List` values. 940 * `String`, `bool` and `null` as well as `Map` and `List` values.
946 */ 941 */
947 core.List<core.Object> csvInstance; 942 core.List<core.Object> csvInstance;
948 943
949 /** The generic output value - could be regression or class label. */ 944 /** The generic output value - could be regression or class label. */
(...skipping 17 matching lines...) Expand all
967 _json["csvInstance"] = csvInstance; 962 _json["csvInstance"] = csvInstance;
968 } 963 }
969 if (output != null) { 964 if (output != null) {
970 _json["output"] = output; 965 _json["output"] = output;
971 } 966 }
972 return _json; 967 return _json;
973 } 968 }
974 } 969 }
975 970
976 971
977 /** Not documented yet. */
978 class Insert { 972 class Insert {
979 /** The unique name for the predictive model. */ 973 /** The unique name for the predictive model. */
980 core.String id; 974 core.String id;
981 975
982 /** Type of predictive model (classification or regression). */ 976 /** Type of predictive model (classification or regression). */
983 core.String modelType; 977 core.String modelType;
984 978
985 /** The Id of the model to be copied over. */ 979 /** The Id of the model to be copied over. */
986 core.String sourceModel; 980 core.String sourceModel;
987 981
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 _json["numberInstances"] = numberInstances; 1133 _json["numberInstances"] = numberInstances;
1140 } 1134 }
1141 if (numberLabels != null) { 1135 if (numberLabels != null) {
1142 _json["numberLabels"] = numberLabels; 1136 _json["numberLabels"] = numberLabels;
1143 } 1137 }
1144 return _json; 1138 return _json;
1145 } 1139 }
1146 } 1140 }
1147 1141
1148 1142
1149 /** Not documented yet. */
1150 class Insert2 { 1143 class Insert2 {
1151 /** Insert time of the model (as a RFC 3339 timestamp). */ 1144 /** Insert time of the model (as a RFC 3339 timestamp). */
1152 core.DateTime created; 1145 core.DateTime created;
1153 1146
1154 /** The unique name for the predictive model. */ 1147 /** The unique name for the predictive model. */
1155 core.String id; 1148 core.String id;
1156 1149
1157 /** What kind of resource this is. */ 1150 /** What kind of resource this is. */
1158 core.String kind; 1151 core.String kind;
1159 1152
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 _json["trainingComplete"] = (trainingComplete).toIso8601String(); 1249 _json["trainingComplete"] = (trainingComplete).toIso8601String();
1257 } 1250 }
1258 if (trainingStatus != null) { 1251 if (trainingStatus != null) {
1259 _json["trainingStatus"] = trainingStatus; 1252 _json["trainingStatus"] = trainingStatus;
1260 } 1253 }
1261 return _json; 1254 return _json;
1262 } 1255 }
1263 } 1256 }
1264 1257
1265 1258
1266 /** Not documented yet. */
1267 class List { 1259 class List {
1268 /** List of models. */ 1260 /** List of models. */
1269 core.List<Insert2> items; 1261 core.List<Insert2> items;
1270 1262
1271 /** What kind of resource this is. */ 1263 /** What kind of resource this is. */
1272 core.String kind; 1264 core.String kind;
1273 1265
1274 /** Pagination token to fetch the next page, if one exists. */ 1266 /** Pagination token to fetch the next page, if one exists. */
1275 core.String nextPageToken; 1267 core.String nextPageToken;
1276 1268
(...skipping 30 matching lines...) Expand all
1307 _json["nextPageToken"] = nextPageToken; 1299 _json["nextPageToken"] = nextPageToken;
1308 } 1300 }
1309 if (selfLink != null) { 1301 if (selfLink != null) {
1310 _json["selfLink"] = selfLink; 1302 _json["selfLink"] = selfLink;
1311 } 1303 }
1312 return _json; 1304 return _json;
1313 } 1305 }
1314 } 1306 }
1315 1307
1316 1308
1317 /** Not documented yet. */
1318 class OutputOutputMulti { 1309 class OutputOutputMulti {
1319 /** The class label. */ 1310 /** The class label. */
1320 core.String label; 1311 core.String label;
1321 1312
1322 /** The probability of the class label. */ 1313 /** The probability of the class label. */
1323 core.String score; 1314 core.String score;
1324 1315
1325 1316
1326 OutputOutputMulti(); 1317 OutputOutputMulti();
1327 1318
(...skipping 12 matching lines...) Expand all
1340 _json["label"] = label; 1331 _json["label"] = label;
1341 } 1332 }
1342 if (score != null) { 1333 if (score != null) {
1343 _json["score"] = score; 1334 _json["score"] = score;
1344 } 1335 }
1345 return _json; 1336 return _json;
1346 } 1337 }
1347 } 1338 }
1348 1339
1349 1340
1350 /** Not documented yet. */
1351 class Output { 1341 class Output {
1352 /** The unique name for the predictive model. */ 1342 /** The unique name for the predictive model. */
1353 core.String id; 1343 core.String id;
1354 1344
1355 /** What kind of resource this is. */ 1345 /** What kind of resource this is. */
1356 core.String kind; 1346 core.String kind;
1357 1347
1358 /** The most likely class label (Categorical models only). */ 1348 /** The most likely class label (Categorical models only). */
1359 core.String outputLabel; 1349 core.String outputLabel;
1360 1350
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 _json["outputValue"] = outputValue; 1402 _json["outputValue"] = outputValue;
1413 } 1403 }
1414 if (selfLink != null) { 1404 if (selfLink != null) {
1415 _json["selfLink"] = selfLink; 1405 _json["selfLink"] = selfLink;
1416 } 1406 }
1417 return _json; 1407 return _json;
1418 } 1408 }
1419 } 1409 }
1420 1410
1421 1411
1422 /** Not documented yet. */
1423 class Update { 1412 class Update {
1424 /** 1413 /**
1425 * The input features for this instance. 1414 * The input features for this instance.
1426 * 1415 *
1427 * The values for Object must be JSON objects. It can consist of `num`, 1416 * The values for Object must be JSON objects. It can consist of `num`,
1428 * `String`, `bool` and `null` as well as `Map` and `List` values. 1417 * `String`, `bool` and `null` as well as `Map` and `List` values.
1429 */ 1418 */
1430 core.List<core.Object> csvInstance; 1419 core.List<core.Object> csvInstance;
1431 1420
1432 /** The generic output value - could be regression or class label. */ 1421 /** The generic output value - could be regression or class label. */
(...skipping 15 matching lines...) Expand all
1448 var _json = new core.Map(); 1437 var _json = new core.Map();
1449 if (csvInstance != null) { 1438 if (csvInstance != null) {
1450 _json["csvInstance"] = csvInstance; 1439 _json["csvInstance"] = csvInstance;
1451 } 1440 }
1452 if (output != null) { 1441 if (output != null) {
1453 _json["output"] = output; 1442 _json["output"] = output;
1454 } 1443 }
1455 return _json; 1444 return _json;
1456 } 1445 }
1457 } 1446 }
1458
1459
OLDNEW
« no previous file with comments | « generated/googleapis/lib/plusdomains/v1.dart ('k') | generated/googleapis/lib/qpxexpress/v1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698