OLD | NEW |
| (Empty) |
1 // This is a generated file (see the discoveryapis_generator project). | |
2 | |
3 library googleapis_beta.ml.v1beta1; | |
4 | |
5 import 'dart:core' as core; | |
6 import 'dart:async' as async; | |
7 import 'dart:convert' as convert; | |
8 | |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | |
10 import 'package:http/http.dart' as http; | |
11 | |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | |
13 ApiRequestError, DetailedApiRequestError; | |
14 | |
15 const core.String USER_AGENT = 'dart-api-client ml/v1beta1'; | |
16 | |
17 /** An API to enable creating and using machine learning models. */ | |
18 class MlApi { | |
19 /** View and manage your data across Google Cloud Platform services */ | |
20 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | |
21 | |
22 | |
23 final commons.ApiRequester _requester; | |
24 | |
25 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | |
26 | |
27 MlApi(http.Client client, {core.String rootUrl: "https://ml.googleapis.com/",
core.String servicePath: ""}) : | |
28 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | |
29 } | |
30 | |
31 | |
32 class ProjectsResourceApi { | |
33 final commons.ApiRequester _requester; | |
34 | |
35 ProjectsJobsResourceApi get jobs => new ProjectsJobsResourceApi(_requester); | |
36 ProjectsModelsResourceApi get models => new ProjectsModelsResourceApi(_request
er); | |
37 ProjectsOperationsResourceApi get operations => new ProjectsOperationsResource
Api(_requester); | |
38 | |
39 ProjectsResourceApi(commons.ApiRequester client) : | |
40 _requester = client; | |
41 | |
42 /** | |
43 * Get the service account information associated with your project. You need | |
44 * this information in order to grant the service account persmissions for | |
45 * the Google Cloud Storage location where you put your model training code | |
46 * for training the model with Google Cloud Machine Learning. | |
47 * | |
48 * Request parameters: | |
49 * | |
50 * [name] - Required. The project name. | |
51 * | |
52 * Authorization: requires `Viewer` role on the specified project. | |
53 * Value must have pattern "^projects/[^/]+$". | |
54 * | |
55 * Completes with a [GoogleCloudMlV1beta1GetConfigResponse]. | |
56 * | |
57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
58 * error. | |
59 * | |
60 * If the used [http.Client] completes with an error when making a REST call, | |
61 * this method will complete with the same error. | |
62 */ | |
63 async.Future<GoogleCloudMlV1beta1GetConfigResponse> getConfig(core.String name
) { | |
64 var _url = null; | |
65 var _queryParams = new core.Map(); | |
66 var _uploadMedia = null; | |
67 var _uploadOptions = null; | |
68 var _downloadOptions = commons.DownloadOptions.Metadata; | |
69 var _body = null; | |
70 | |
71 if (name == null) { | |
72 throw new core.ArgumentError("Parameter name is required."); | |
73 } | |
74 | |
75 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':getCo
nfig'; | |
76 | |
77 var _response = _requester.request(_url, | |
78 "GET", | |
79 body: _body, | |
80 queryParams: _queryParams, | |
81 uploadOptions: _uploadOptions, | |
82 uploadMedia: _uploadMedia, | |
83 downloadOptions: _downloadOptions); | |
84 return _response.then((data) => new GoogleCloudMlV1beta1GetConfigResponse.fr
omJson(data)); | |
85 } | |
86 | |
87 /** | |
88 * Performs prediction on the data in the request. | |
89 * | |
90 * **** REMOVE FROM GENERATED DOCUMENTATION | |
91 * | |
92 * [request] - The metadata request object. | |
93 * | |
94 * Request parameters: | |
95 * | |
96 * [name] - Required. The resource name of a model or a version. | |
97 * | |
98 * Authorization: requires `Viewer` role on the parent project. | |
99 * Value must have pattern "^projects/.+$". | |
100 * | |
101 * Completes with a [GoogleApiHttpBody]. | |
102 * | |
103 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
104 * error. | |
105 * | |
106 * If the used [http.Client] completes with an error when making a REST call, | |
107 * this method will complete with the same error. | |
108 */ | |
109 async.Future<GoogleApiHttpBody> predict(GoogleCloudMlV1beta1PredictRequest req
uest, core.String name) { | |
110 var _url = null; | |
111 var _queryParams = new core.Map(); | |
112 var _uploadMedia = null; | |
113 var _uploadOptions = null; | |
114 var _downloadOptions = commons.DownloadOptions.Metadata; | |
115 var _body = null; | |
116 | |
117 if (request != null) { | |
118 _body = convert.JSON.encode((request).toJson()); | |
119 } | |
120 if (name == null) { | |
121 throw new core.ArgumentError("Parameter name is required."); | |
122 } | |
123 | |
124 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':predi
ct'; | |
125 | |
126 var _response = _requester.request(_url, | |
127 "POST", | |
128 body: _body, | |
129 queryParams: _queryParams, | |
130 uploadOptions: _uploadOptions, | |
131 uploadMedia: _uploadMedia, | |
132 downloadOptions: _downloadOptions); | |
133 return _response.then((data) => new GoogleApiHttpBody.fromJson(data)); | |
134 } | |
135 | |
136 } | |
137 | |
138 | |
139 class ProjectsJobsResourceApi { | |
140 final commons.ApiRequester _requester; | |
141 | |
142 ProjectsJobsResourceApi(commons.ApiRequester client) : | |
143 _requester = client; | |
144 | |
145 /** | |
146 * Cancels a running job. | |
147 * | |
148 * [request] - The metadata request object. | |
149 * | |
150 * Request parameters: | |
151 * | |
152 * [name] - Required. The name of the job to cancel. | |
153 * | |
154 * Authorization: requires `Editor` role on the parent project. | |
155 * Value must have pattern "^projects/[^/]+/jobs/[^/]+$". | |
156 * | |
157 * Completes with a [GoogleProtobufEmpty]. | |
158 * | |
159 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
160 * error. | |
161 * | |
162 * If the used [http.Client] completes with an error when making a REST call, | |
163 * this method will complete with the same error. | |
164 */ | |
165 async.Future<GoogleProtobufEmpty> cancel(GoogleCloudMlV1beta1CancelJobRequest
request, core.String name) { | |
166 var _url = null; | |
167 var _queryParams = new core.Map(); | |
168 var _uploadMedia = null; | |
169 var _uploadOptions = null; | |
170 var _downloadOptions = commons.DownloadOptions.Metadata; | |
171 var _body = null; | |
172 | |
173 if (request != null) { | |
174 _body = convert.JSON.encode((request).toJson()); | |
175 } | |
176 if (name == null) { | |
177 throw new core.ArgumentError("Parameter name is required."); | |
178 } | |
179 | |
180 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cance
l'; | |
181 | |
182 var _response = _requester.request(_url, | |
183 "POST", | |
184 body: _body, | |
185 queryParams: _queryParams, | |
186 uploadOptions: _uploadOptions, | |
187 uploadMedia: _uploadMedia, | |
188 downloadOptions: _downloadOptions); | |
189 return _response.then((data) => new GoogleProtobufEmpty.fromJson(data)); | |
190 } | |
191 | |
192 /** | |
193 * Creates a training or a batch prediction job. | |
194 * | |
195 * [request] - The metadata request object. | |
196 * | |
197 * Request parameters: | |
198 * | |
199 * [parent] - Required. The project name. | |
200 * | |
201 * Authorization: requires `Editor` role on the specified project. | |
202 * Value must have pattern "^projects/[^/]+$". | |
203 * | |
204 * Completes with a [GoogleCloudMlV1beta1Job]. | |
205 * | |
206 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
207 * error. | |
208 * | |
209 * If the used [http.Client] completes with an error when making a REST call, | |
210 * this method will complete with the same error. | |
211 */ | |
212 async.Future<GoogleCloudMlV1beta1Job> create(GoogleCloudMlV1beta1Job request,
core.String parent) { | |
213 var _url = null; | |
214 var _queryParams = new core.Map(); | |
215 var _uploadMedia = null; | |
216 var _uploadOptions = null; | |
217 var _downloadOptions = commons.DownloadOptions.Metadata; | |
218 var _body = null; | |
219 | |
220 if (request != null) { | |
221 _body = convert.JSON.encode((request).toJson()); | |
222 } | |
223 if (parent == null) { | |
224 throw new core.ArgumentError("Parameter parent is required."); | |
225 } | |
226 | |
227 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/job
s'; | |
228 | |
229 var _response = _requester.request(_url, | |
230 "POST", | |
231 body: _body, | |
232 queryParams: _queryParams, | |
233 uploadOptions: _uploadOptions, | |
234 uploadMedia: _uploadMedia, | |
235 downloadOptions: _downloadOptions); | |
236 return _response.then((data) => new GoogleCloudMlV1beta1Job.fromJson(data)); | |
237 } | |
238 | |
239 /** | |
240 * Describes a job. | |
241 * | |
242 * Request parameters: | |
243 * | |
244 * [name] - Required. The name of the job to get the description of. | |
245 * | |
246 * Authorization: requires `Viewer` role on the parent project. | |
247 * Value must have pattern "^projects/[^/]+/jobs/[^/]+$". | |
248 * | |
249 * Completes with a [GoogleCloudMlV1beta1Job]. | |
250 * | |
251 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
252 * error. | |
253 * | |
254 * If the used [http.Client] completes with an error when making a REST call, | |
255 * this method will complete with the same error. | |
256 */ | |
257 async.Future<GoogleCloudMlV1beta1Job> get(core.String name) { | |
258 var _url = null; | |
259 var _queryParams = new core.Map(); | |
260 var _uploadMedia = null; | |
261 var _uploadOptions = null; | |
262 var _downloadOptions = commons.DownloadOptions.Metadata; | |
263 var _body = null; | |
264 | |
265 if (name == null) { | |
266 throw new core.ArgumentError("Parameter name is required."); | |
267 } | |
268 | |
269 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
270 | |
271 var _response = _requester.request(_url, | |
272 "GET", | |
273 body: _body, | |
274 queryParams: _queryParams, | |
275 uploadOptions: _uploadOptions, | |
276 uploadMedia: _uploadMedia, | |
277 downloadOptions: _downloadOptions); | |
278 return _response.then((data) => new GoogleCloudMlV1beta1Job.fromJson(data)); | |
279 } | |
280 | |
281 /** | |
282 * Lists the jobs in the project. | |
283 * | |
284 * Request parameters: | |
285 * | |
286 * [parent] - Required. The name of the project for which to list jobs. | |
287 * | |
288 * Authorization: requires `Viewer` role on the specified project. | |
289 * Value must have pattern "^projects/[^/]+$". | |
290 * | |
291 * [pageToken] - Optional. A page token to request the next page of results. | |
292 * | |
293 * You get the token from the `next_page_token` field of the response from | |
294 * the previous call. | |
295 * | |
296 * [pageSize] - Optional. The number of jobs to retrieve per "page" of | |
297 * results. If there | |
298 * are more remaining results than this number, the response message will | |
299 * contain a valid value in the `next_page_token` field. | |
300 * | |
301 * The default value is 20, and the maximum page size is 100. | |
302 * | |
303 * [filter] - Optional. Specifies the subset of jobs to retrieve. | |
304 * | |
305 * Completes with a [GoogleCloudMlV1beta1ListJobsResponse]. | |
306 * | |
307 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
308 * error. | |
309 * | |
310 * If the used [http.Client] completes with an error when making a REST call, | |
311 * this method will complete with the same error. | |
312 */ | |
313 async.Future<GoogleCloudMlV1beta1ListJobsResponse> list(core.String parent, {c
ore.String pageToken, core.int pageSize, core.String filter}) { | |
314 var _url = null; | |
315 var _queryParams = new core.Map(); | |
316 var _uploadMedia = null; | |
317 var _uploadOptions = null; | |
318 var _downloadOptions = commons.DownloadOptions.Metadata; | |
319 var _body = null; | |
320 | |
321 if (parent == null) { | |
322 throw new core.ArgumentError("Parameter parent is required."); | |
323 } | |
324 if (pageToken != null) { | |
325 _queryParams["pageToken"] = [pageToken]; | |
326 } | |
327 if (pageSize != null) { | |
328 _queryParams["pageSize"] = ["${pageSize}"]; | |
329 } | |
330 if (filter != null) { | |
331 _queryParams["filter"] = [filter]; | |
332 } | |
333 | |
334 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/job
s'; | |
335 | |
336 var _response = _requester.request(_url, | |
337 "GET", | |
338 body: _body, | |
339 queryParams: _queryParams, | |
340 uploadOptions: _uploadOptions, | |
341 uploadMedia: _uploadMedia, | |
342 downloadOptions: _downloadOptions); | |
343 return _response.then((data) => new GoogleCloudMlV1beta1ListJobsResponse.fro
mJson(data)); | |
344 } | |
345 | |
346 } | |
347 | |
348 | |
349 class ProjectsModelsResourceApi { | |
350 final commons.ApiRequester _requester; | |
351 | |
352 ProjectsModelsVersionsResourceApi get versions => new ProjectsModelsVersionsRe
sourceApi(_requester); | |
353 | |
354 ProjectsModelsResourceApi(commons.ApiRequester client) : | |
355 _requester = client; | |
356 | |
357 /** | |
358 * Creates a model which will later contain one or more versions. | |
359 * | |
360 * You must add at least one version before you can request predictions from | |
361 * the model. Add versions by calling | |
362 * [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.model
s.versions/create). | |
363 * | |
364 * [request] - The metadata request object. | |
365 * | |
366 * Request parameters: | |
367 * | |
368 * [parent] - Required. The project name. | |
369 * | |
370 * Authorization: requires `Editor` role on the specified project. | |
371 * Value must have pattern "^projects/[^/]+$". | |
372 * | |
373 * Completes with a [GoogleCloudMlV1beta1Model]. | |
374 * | |
375 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
376 * error. | |
377 * | |
378 * If the used [http.Client] completes with an error when making a REST call, | |
379 * this method will complete with the same error. | |
380 */ | |
381 async.Future<GoogleCloudMlV1beta1Model> create(GoogleCloudMlV1beta1Model reque
st, core.String parent) { | |
382 var _url = null; | |
383 var _queryParams = new core.Map(); | |
384 var _uploadMedia = null; | |
385 var _uploadOptions = null; | |
386 var _downloadOptions = commons.DownloadOptions.Metadata; | |
387 var _body = null; | |
388 | |
389 if (request != null) { | |
390 _body = convert.JSON.encode((request).toJson()); | |
391 } | |
392 if (parent == null) { | |
393 throw new core.ArgumentError("Parameter parent is required."); | |
394 } | |
395 | |
396 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/mod
els'; | |
397 | |
398 var _response = _requester.request(_url, | |
399 "POST", | |
400 body: _body, | |
401 queryParams: _queryParams, | |
402 uploadOptions: _uploadOptions, | |
403 uploadMedia: _uploadMedia, | |
404 downloadOptions: _downloadOptions); | |
405 return _response.then((data) => new GoogleCloudMlV1beta1Model.fromJson(data)
); | |
406 } | |
407 | |
408 /** | |
409 * Deletes a model. | |
410 * | |
411 * You can only delete a model if there are no versions in it. You can delete | |
412 * versions by calling | |
413 * [projects.models.versions.delete](/ml/reference/rest/v1beta1/projects.model
s.versions/delete). | |
414 * | |
415 * Request parameters: | |
416 * | |
417 * [name] - Required. The name of the model. | |
418 * | |
419 * Authorization: requires `Editor` role on the parent project. | |
420 * Value must have pattern "^projects/[^/]+/models/[^/]+$". | |
421 * | |
422 * Completes with a [GoogleLongrunningOperation]. | |
423 * | |
424 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
425 * error. | |
426 * | |
427 * If the used [http.Client] completes with an error when making a REST call, | |
428 * this method will complete with the same error. | |
429 */ | |
430 async.Future<GoogleLongrunningOperation> delete(core.String name) { | |
431 var _url = null; | |
432 var _queryParams = new core.Map(); | |
433 var _uploadMedia = null; | |
434 var _uploadOptions = null; | |
435 var _downloadOptions = commons.DownloadOptions.Metadata; | |
436 var _body = null; | |
437 | |
438 if (name == null) { | |
439 throw new core.ArgumentError("Parameter name is required."); | |
440 } | |
441 | |
442 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
443 | |
444 var _response = _requester.request(_url, | |
445 "DELETE", | |
446 body: _body, | |
447 queryParams: _queryParams, | |
448 uploadOptions: _uploadOptions, | |
449 uploadMedia: _uploadMedia, | |
450 downloadOptions: _downloadOptions); | |
451 return _response.then((data) => new GoogleLongrunningOperation.fromJson(data
)); | |
452 } | |
453 | |
454 /** | |
455 * Gets information about a model, including its name, the description (if | |
456 * set), and the default version (if at least one version of the model has | |
457 * been deployed). | |
458 * | |
459 * Request parameters: | |
460 * | |
461 * [name] - Required. The name of the model. | |
462 * | |
463 * Authorization: requires `Viewer` role on the parent project. | |
464 * Value must have pattern "^projects/[^/]+/models/[^/]+$". | |
465 * | |
466 * Completes with a [GoogleCloudMlV1beta1Model]. | |
467 * | |
468 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
469 * error. | |
470 * | |
471 * If the used [http.Client] completes with an error when making a REST call, | |
472 * this method will complete with the same error. | |
473 */ | |
474 async.Future<GoogleCloudMlV1beta1Model> get(core.String name) { | |
475 var _url = null; | |
476 var _queryParams = new core.Map(); | |
477 var _uploadMedia = null; | |
478 var _uploadOptions = null; | |
479 var _downloadOptions = commons.DownloadOptions.Metadata; | |
480 var _body = null; | |
481 | |
482 if (name == null) { | |
483 throw new core.ArgumentError("Parameter name is required."); | |
484 } | |
485 | |
486 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
487 | |
488 var _response = _requester.request(_url, | |
489 "GET", | |
490 body: _body, | |
491 queryParams: _queryParams, | |
492 uploadOptions: _uploadOptions, | |
493 uploadMedia: _uploadMedia, | |
494 downloadOptions: _downloadOptions); | |
495 return _response.then((data) => new GoogleCloudMlV1beta1Model.fromJson(data)
); | |
496 } | |
497 | |
498 /** | |
499 * Lists the models in a project. | |
500 * | |
501 * Each project can contain multiple models, and each model can have multiple | |
502 * versions. | |
503 * | |
504 * Request parameters: | |
505 * | |
506 * [parent] - Required. The name of the project whose models are to be listed. | |
507 * | |
508 * Authorization: requires `Viewer` role on the specified project. | |
509 * Value must have pattern "^projects/[^/]+$". | |
510 * | |
511 * [pageToken] - Optional. A page token to request the next page of results. | |
512 * | |
513 * You get the token from the `next_page_token` field of the response from | |
514 * the previous call. | |
515 * | |
516 * [pageSize] - Optional. The number of models to retrieve per "page" of | |
517 * results. If there | |
518 * are more remaining results than this number, the response message will | |
519 * contain a valid value in the `next_page_token` field. | |
520 * | |
521 * The default value is 20, and the maximum page size is 100. | |
522 * | |
523 * Completes with a [GoogleCloudMlV1beta1ListModelsResponse]. | |
524 * | |
525 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
526 * error. | |
527 * | |
528 * If the used [http.Client] completes with an error when making a REST call, | |
529 * this method will complete with the same error. | |
530 */ | |
531 async.Future<GoogleCloudMlV1beta1ListModelsResponse> list(core.String parent,
{core.String pageToken, core.int pageSize}) { | |
532 var _url = null; | |
533 var _queryParams = new core.Map(); | |
534 var _uploadMedia = null; | |
535 var _uploadOptions = null; | |
536 var _downloadOptions = commons.DownloadOptions.Metadata; | |
537 var _body = null; | |
538 | |
539 if (parent == null) { | |
540 throw new core.ArgumentError("Parameter parent is required."); | |
541 } | |
542 if (pageToken != null) { | |
543 _queryParams["pageToken"] = [pageToken]; | |
544 } | |
545 if (pageSize != null) { | |
546 _queryParams["pageSize"] = ["${pageSize}"]; | |
547 } | |
548 | |
549 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/mod
els'; | |
550 | |
551 var _response = _requester.request(_url, | |
552 "GET", | |
553 body: _body, | |
554 queryParams: _queryParams, | |
555 uploadOptions: _uploadOptions, | |
556 uploadMedia: _uploadMedia, | |
557 downloadOptions: _downloadOptions); | |
558 return _response.then((data) => new GoogleCloudMlV1beta1ListModelsResponse.f
romJson(data)); | |
559 } | |
560 | |
561 } | |
562 | |
563 | |
564 class ProjectsModelsVersionsResourceApi { | |
565 final commons.ApiRequester _requester; | |
566 | |
567 ProjectsModelsVersionsResourceApi(commons.ApiRequester client) : | |
568 _requester = client; | |
569 | |
570 /** | |
571 * Creates a new version of a model from a trained TensorFlow model. | |
572 * | |
573 * If the version created in the cloud by this call is the first deployed | |
574 * version of the specified model, it will be made the default version of the | |
575 * model. When you add a version to a model that already has one or more | |
576 * versions, the default version does not automatically change. If you want a | |
577 * new version to be the default, you must call | |
578 * [projects.models.versions.setDefault](/ml/reference/rest/v1beta1/projects.m
odels.versions/setDefault). | |
579 * | |
580 * [request] - The metadata request object. | |
581 * | |
582 * Request parameters: | |
583 * | |
584 * [parent] - Required. The name of the model. | |
585 * | |
586 * Authorization: requires `Editor` role on the parent project. | |
587 * Value must have pattern "^projects/[^/]+/models/[^/]+$". | |
588 * | |
589 * Completes with a [GoogleLongrunningOperation]. | |
590 * | |
591 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
592 * error. | |
593 * | |
594 * If the used [http.Client] completes with an error when making a REST call, | |
595 * this method will complete with the same error. | |
596 */ | |
597 async.Future<GoogleLongrunningOperation> create(GoogleCloudMlV1beta1Version re
quest, core.String parent) { | |
598 var _url = null; | |
599 var _queryParams = new core.Map(); | |
600 var _uploadMedia = null; | |
601 var _uploadOptions = null; | |
602 var _downloadOptions = commons.DownloadOptions.Metadata; | |
603 var _body = null; | |
604 | |
605 if (request != null) { | |
606 _body = convert.JSON.encode((request).toJson()); | |
607 } | |
608 if (parent == null) { | |
609 throw new core.ArgumentError("Parameter parent is required."); | |
610 } | |
611 | |
612 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/ver
sions'; | |
613 | |
614 var _response = _requester.request(_url, | |
615 "POST", | |
616 body: _body, | |
617 queryParams: _queryParams, | |
618 uploadOptions: _uploadOptions, | |
619 uploadMedia: _uploadMedia, | |
620 downloadOptions: _downloadOptions); | |
621 return _response.then((data) => new GoogleLongrunningOperation.fromJson(data
)); | |
622 } | |
623 | |
624 /** | |
625 * Deletes a model version. | |
626 * | |
627 * Each model can have multiple versions deployed and in use at any given | |
628 * time. Use this method to remove a single version. | |
629 * | |
630 * Note: You cannot delete the version that is set as the default version | |
631 * of the model unless it is the only remaining version. | |
632 * | |
633 * Request parameters: | |
634 * | |
635 * [name] - Required. The name of the version. You can get the names of all | |
636 * the | |
637 * versions of a model by calling | |
638 * [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.
versions/list). | |
639 * | |
640 * Authorization: requires `Editor` role on the parent project. | |
641 * Value must have pattern "^projects/[^/]+/models/[^/]+/versions/[^/]+$". | |
642 * | |
643 * Completes with a [GoogleLongrunningOperation]. | |
644 * | |
645 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
646 * error. | |
647 * | |
648 * If the used [http.Client] completes with an error when making a REST call, | |
649 * this method will complete with the same error. | |
650 */ | |
651 async.Future<GoogleLongrunningOperation> delete(core.String name) { | |
652 var _url = null; | |
653 var _queryParams = new core.Map(); | |
654 var _uploadMedia = null; | |
655 var _uploadOptions = null; | |
656 var _downloadOptions = commons.DownloadOptions.Metadata; | |
657 var _body = null; | |
658 | |
659 if (name == null) { | |
660 throw new core.ArgumentError("Parameter name is required."); | |
661 } | |
662 | |
663 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
664 | |
665 var _response = _requester.request(_url, | |
666 "DELETE", | |
667 body: _body, | |
668 queryParams: _queryParams, | |
669 uploadOptions: _uploadOptions, | |
670 uploadMedia: _uploadMedia, | |
671 downloadOptions: _downloadOptions); | |
672 return _response.then((data) => new GoogleLongrunningOperation.fromJson(data
)); | |
673 } | |
674 | |
675 /** | |
676 * Gets information about a model version. | |
677 * | |
678 * Models can have multiple versions. You can call | |
679 * [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.
versions/list) | |
680 * to get the same information that this method returns for all of the | |
681 * versions of a model. | |
682 * | |
683 * Request parameters: | |
684 * | |
685 * [name] - Required. The name of the version. | |
686 * | |
687 * Authorization: requires `Viewer` role on the parent project. | |
688 * Value must have pattern "^projects/[^/]+/models/[^/]+/versions/[^/]+$". | |
689 * | |
690 * Completes with a [GoogleCloudMlV1beta1Version]. | |
691 * | |
692 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
693 * error. | |
694 * | |
695 * If the used [http.Client] completes with an error when making a REST call, | |
696 * this method will complete with the same error. | |
697 */ | |
698 async.Future<GoogleCloudMlV1beta1Version> get(core.String name) { | |
699 var _url = null; | |
700 var _queryParams = new core.Map(); | |
701 var _uploadMedia = null; | |
702 var _uploadOptions = null; | |
703 var _downloadOptions = commons.DownloadOptions.Metadata; | |
704 var _body = null; | |
705 | |
706 if (name == null) { | |
707 throw new core.ArgumentError("Parameter name is required."); | |
708 } | |
709 | |
710 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
711 | |
712 var _response = _requester.request(_url, | |
713 "GET", | |
714 body: _body, | |
715 queryParams: _queryParams, | |
716 uploadOptions: _uploadOptions, | |
717 uploadMedia: _uploadMedia, | |
718 downloadOptions: _downloadOptions); | |
719 return _response.then((data) => new GoogleCloudMlV1beta1Version.fromJson(dat
a)); | |
720 } | |
721 | |
722 /** | |
723 * Gets basic information about all the versions of a model. | |
724 * | |
725 * If you expect that a model has a lot of versions, or if you need to handle | |
726 * only a limited number of results at a time, you can request that the list | |
727 * be retrieved in batches (called pages): | |
728 * | |
729 * Request parameters: | |
730 * | |
731 * [parent] - Required. The name of the model for which to list the version. | |
732 * | |
733 * Authorization: requires `Viewer` role on the parent project. | |
734 * Value must have pattern "^projects/[^/]+/models/[^/]+$". | |
735 * | |
736 * [pageToken] - Optional. A page token to request the next page of results. | |
737 * | |
738 * You get the token from the `next_page_token` field of the response from | |
739 * the previous call. | |
740 * | |
741 * [pageSize] - Optional. The number of versions to retrieve per "page" of | |
742 * results. If | |
743 * there are more remaining results than this number, the response message | |
744 * will contain a valid value in the `next_page_token` field. | |
745 * | |
746 * The default value is 20, and the maximum page size is 100. | |
747 * | |
748 * Completes with a [GoogleCloudMlV1beta1ListVersionsResponse]. | |
749 * | |
750 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
751 * error. | |
752 * | |
753 * If the used [http.Client] completes with an error when making a REST call, | |
754 * this method will complete with the same error. | |
755 */ | |
756 async.Future<GoogleCloudMlV1beta1ListVersionsResponse> list(core.String parent
, {core.String pageToken, core.int pageSize}) { | |
757 var _url = null; | |
758 var _queryParams = new core.Map(); | |
759 var _uploadMedia = null; | |
760 var _uploadOptions = null; | |
761 var _downloadOptions = commons.DownloadOptions.Metadata; | |
762 var _body = null; | |
763 | |
764 if (parent == null) { | |
765 throw new core.ArgumentError("Parameter parent is required."); | |
766 } | |
767 if (pageToken != null) { | |
768 _queryParams["pageToken"] = [pageToken]; | |
769 } | |
770 if (pageSize != null) { | |
771 _queryParams["pageSize"] = ["${pageSize}"]; | |
772 } | |
773 | |
774 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/ver
sions'; | |
775 | |
776 var _response = _requester.request(_url, | |
777 "GET", | |
778 body: _body, | |
779 queryParams: _queryParams, | |
780 uploadOptions: _uploadOptions, | |
781 uploadMedia: _uploadMedia, | |
782 downloadOptions: _downloadOptions); | |
783 return _response.then((data) => new GoogleCloudMlV1beta1ListVersionsResponse
.fromJson(data)); | |
784 } | |
785 | |
786 /** | |
787 * Designates a version to be the default for the model. | |
788 * | |
789 * The default version is used for prediction requests made against the model | |
790 * that don't specify a version. | |
791 * | |
792 * The first version to be created for a model is automatically set as the | |
793 * default. You must make any subsequent changes to the default version | |
794 * setting manually using this method. | |
795 * | |
796 * [request] - The metadata request object. | |
797 * | |
798 * Request parameters: | |
799 * | |
800 * [name] - Required. The name of the version to make the default for the | |
801 * model. You | |
802 * can get the names of all the versions of a model by calling | |
803 * [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.
versions/list). | |
804 * | |
805 * Authorization: requires `Editor` role on the parent project. | |
806 * Value must have pattern "^projects/[^/]+/models/[^/]+/versions/[^/]+$". | |
807 * | |
808 * Completes with a [GoogleCloudMlV1beta1Version]. | |
809 * | |
810 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
811 * error. | |
812 * | |
813 * If the used [http.Client] completes with an error when making a REST call, | |
814 * this method will complete with the same error. | |
815 */ | |
816 async.Future<GoogleCloudMlV1beta1Version> setDefault(GoogleCloudMlV1beta1SetDe
faultVersionRequest request, core.String name) { | |
817 var _url = null; | |
818 var _queryParams = new core.Map(); | |
819 var _uploadMedia = null; | |
820 var _uploadOptions = null; | |
821 var _downloadOptions = commons.DownloadOptions.Metadata; | |
822 var _body = null; | |
823 | |
824 if (request != null) { | |
825 _body = convert.JSON.encode((request).toJson()); | |
826 } | |
827 if (name == null) { | |
828 throw new core.ArgumentError("Parameter name is required."); | |
829 } | |
830 | |
831 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':setDe
fault'; | |
832 | |
833 var _response = _requester.request(_url, | |
834 "POST", | |
835 body: _body, | |
836 queryParams: _queryParams, | |
837 uploadOptions: _uploadOptions, | |
838 uploadMedia: _uploadMedia, | |
839 downloadOptions: _downloadOptions); | |
840 return _response.then((data) => new GoogleCloudMlV1beta1Version.fromJson(dat
a)); | |
841 } | |
842 | |
843 } | |
844 | |
845 | |
846 class ProjectsOperationsResourceApi { | |
847 final commons.ApiRequester _requester; | |
848 | |
849 ProjectsOperationsResourceApi(commons.ApiRequester client) : | |
850 _requester = client; | |
851 | |
852 /** | |
853 * Starts asynchronous cancellation on a long-running operation. The server | |
854 * makes a best effort to cancel the operation, but success is not | |
855 * guaranteed. If the server doesn't support this method, it returns | |
856 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use | |
857 * Operations.GetOperation or | |
858 * other methods to check whether the cancellation succeeded or whether the | |
859 * operation completed despite cancellation. On successful cancellation, | |
860 * the operation is not deleted; instead, it becomes an operation with | |
861 * an Operation.error value with a google.rpc.Status.code of 1, | |
862 * corresponding to `Code.CANCELLED`. | |
863 * | |
864 * Request parameters: | |
865 * | |
866 * [name] - The name of the operation resource to be cancelled. | |
867 * Value must have pattern "^projects/[^/]+/operations/[^/]+$". | |
868 * | |
869 * Completes with a [GoogleProtobufEmpty]. | |
870 * | |
871 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
872 * error. | |
873 * | |
874 * If the used [http.Client] completes with an error when making a REST call, | |
875 * this method will complete with the same error. | |
876 */ | |
877 async.Future<GoogleProtobufEmpty> cancel(core.String name) { | |
878 var _url = null; | |
879 var _queryParams = new core.Map(); | |
880 var _uploadMedia = null; | |
881 var _uploadOptions = null; | |
882 var _downloadOptions = commons.DownloadOptions.Metadata; | |
883 var _body = null; | |
884 | |
885 if (name == null) { | |
886 throw new core.ArgumentError("Parameter name is required."); | |
887 } | |
888 | |
889 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cance
l'; | |
890 | |
891 var _response = _requester.request(_url, | |
892 "POST", | |
893 body: _body, | |
894 queryParams: _queryParams, | |
895 uploadOptions: _uploadOptions, | |
896 uploadMedia: _uploadMedia, | |
897 downloadOptions: _downloadOptions); | |
898 return _response.then((data) => new GoogleProtobufEmpty.fromJson(data)); | |
899 } | |
900 | |
901 /** | |
902 * Deletes a long-running operation. This method indicates that the client is | |
903 * no longer interested in the operation result. It does not cancel the | |
904 * operation. If the server doesn't support this method, it returns | |
905 * `google.rpc.Code.UNIMPLEMENTED`. | |
906 * | |
907 * Request parameters: | |
908 * | |
909 * [name] - The name of the operation resource to be deleted. | |
910 * Value must have pattern "^projects/[^/]+/operations/[^/]+$". | |
911 * | |
912 * Completes with a [GoogleProtobufEmpty]. | |
913 * | |
914 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
915 * error. | |
916 * | |
917 * If the used [http.Client] completes with an error when making a REST call, | |
918 * this method will complete with the same error. | |
919 */ | |
920 async.Future<GoogleProtobufEmpty> delete(core.String name) { | |
921 var _url = null; | |
922 var _queryParams = new core.Map(); | |
923 var _uploadMedia = null; | |
924 var _uploadOptions = null; | |
925 var _downloadOptions = commons.DownloadOptions.Metadata; | |
926 var _body = null; | |
927 | |
928 if (name == null) { | |
929 throw new core.ArgumentError("Parameter name is required."); | |
930 } | |
931 | |
932 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
933 | |
934 var _response = _requester.request(_url, | |
935 "DELETE", | |
936 body: _body, | |
937 queryParams: _queryParams, | |
938 uploadOptions: _uploadOptions, | |
939 uploadMedia: _uploadMedia, | |
940 downloadOptions: _downloadOptions); | |
941 return _response.then((data) => new GoogleProtobufEmpty.fromJson(data)); | |
942 } | |
943 | |
944 /** | |
945 * Gets the latest state of a long-running operation. Clients can use this | |
946 * method to poll the operation result at intervals as recommended by the API | |
947 * service. | |
948 * | |
949 * Request parameters: | |
950 * | |
951 * [name] - The name of the operation resource. | |
952 * Value must have pattern "^projects/[^/]+/operations/[^/]+$". | |
953 * | |
954 * Completes with a [GoogleLongrunningOperation]. | |
955 * | |
956 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
957 * error. | |
958 * | |
959 * If the used [http.Client] completes with an error when making a REST call, | |
960 * this method will complete with the same error. | |
961 */ | |
962 async.Future<GoogleLongrunningOperation> get(core.String name) { | |
963 var _url = null; | |
964 var _queryParams = new core.Map(); | |
965 var _uploadMedia = null; | |
966 var _uploadOptions = null; | |
967 var _downloadOptions = commons.DownloadOptions.Metadata; | |
968 var _body = null; | |
969 | |
970 if (name == null) { | |
971 throw new core.ArgumentError("Parameter name is required."); | |
972 } | |
973 | |
974 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
975 | |
976 var _response = _requester.request(_url, | |
977 "GET", | |
978 body: _body, | |
979 queryParams: _queryParams, | |
980 uploadOptions: _uploadOptions, | |
981 uploadMedia: _uploadMedia, | |
982 downloadOptions: _downloadOptions); | |
983 return _response.then((data) => new GoogleLongrunningOperation.fromJson(data
)); | |
984 } | |
985 | |
986 /** | |
987 * Lists operations that match the specified filter in the request. If the | |
988 * server doesn't support this method, it returns `UNIMPLEMENTED`. | |
989 * | |
990 * NOTE: the `name` binding below allows API services to override the binding | |
991 * to use different resource name schemes, such as `users / * /operations`. | |
992 * | |
993 * Request parameters: | |
994 * | |
995 * [name] - The name of the operation collection. | |
996 * Value must have pattern "^projects/[^/]+$". | |
997 * | |
998 * [pageToken] - The standard list page token. | |
999 * | |
1000 * [pageSize] - The standard list page size. | |
1001 * | |
1002 * [filter] - The standard list filter. | |
1003 * | |
1004 * Completes with a [GoogleLongrunningListOperationsResponse]. | |
1005 * | |
1006 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
1007 * error. | |
1008 * | |
1009 * If the used [http.Client] completes with an error when making a REST call, | |
1010 * this method will complete with the same error. | |
1011 */ | |
1012 async.Future<GoogleLongrunningListOperationsResponse> list(core.String name, {
core.String pageToken, core.int pageSize, core.String filter}) { | |
1013 var _url = null; | |
1014 var _queryParams = new core.Map(); | |
1015 var _uploadMedia = null; | |
1016 var _uploadOptions = null; | |
1017 var _downloadOptions = commons.DownloadOptions.Metadata; | |
1018 var _body = null; | |
1019 | |
1020 if (name == null) { | |
1021 throw new core.ArgumentError("Parameter name is required."); | |
1022 } | |
1023 if (pageToken != null) { | |
1024 _queryParams["pageToken"] = [pageToken]; | |
1025 } | |
1026 if (pageSize != null) { | |
1027 _queryParams["pageSize"] = ["${pageSize}"]; | |
1028 } | |
1029 if (filter != null) { | |
1030 _queryParams["filter"] = [filter]; | |
1031 } | |
1032 | |
1033 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + '/opera
tions'; | |
1034 | |
1035 var _response = _requester.request(_url, | |
1036 "GET", | |
1037 body: _body, | |
1038 queryParams: _queryParams, | |
1039 uploadOptions: _uploadOptions, | |
1040 uploadMedia: _uploadMedia, | |
1041 downloadOptions: _downloadOptions); | |
1042 return _response.then((data) => new GoogleLongrunningListOperationsResponse.
fromJson(data)); | |
1043 } | |
1044 | |
1045 } | |
1046 | |
1047 | |
1048 | |
1049 /** | |
1050 * Message that represents an arbitrary HTTP body. It should only be used for | |
1051 * payload formats that can't be represented as JSON, such as raw binary or | |
1052 * an HTML page. | |
1053 * | |
1054 * | |
1055 * This message can be used both in streaming and non-streaming API methods in | |
1056 * the request as well as the response. | |
1057 * | |
1058 * It can be used as a top-level request field, which is convenient if one | |
1059 * wants to extract parameters from either the URL or HTTP template into the | |
1060 * request fields and also want access to the raw HTTP body. | |
1061 * | |
1062 * Example: | |
1063 * | |
1064 * message GetResourceRequest { | |
1065 * // A unique request id. | |
1066 * string request_id = 1; | |
1067 * | |
1068 * // The raw HTTP body is bound to this field. | |
1069 * google.api.HttpBody http_body = 2; | |
1070 * } | |
1071 * | |
1072 * service ResourceService { | |
1073 * rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); | |
1074 * rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); | |
1075 * } | |
1076 * | |
1077 * Example with streaming methods: | |
1078 * | |
1079 * service CaldavService { | |
1080 * rpc GetCalendar(stream google.api.HttpBody) | |
1081 * returns (stream google.api.HttpBody); | |
1082 * rpc UpdateCalendar(stream google.api.HttpBody) | |
1083 * returns (stream google.api.HttpBody); | |
1084 * } | |
1085 * | |
1086 * Use of this type only changes how the request and response bodies are | |
1087 * handled, all other features will continue to work unchanged. | |
1088 */ | |
1089 class GoogleApiHttpBody { | |
1090 /** | |
1091 * The HTTP Content-Type string representing the content type of the body. | |
1092 */ | |
1093 core.String contentType; | |
1094 /** HTTP body binary data. */ | |
1095 core.String data; | |
1096 core.List<core.int> get dataAsBytes { | |
1097 return convert.BASE64.decode(data); | |
1098 } | |
1099 | |
1100 void set dataAsBytes(core.List<core.int> _bytes) { | |
1101 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | |
1102 } | |
1103 | |
1104 GoogleApiHttpBody(); | |
1105 | |
1106 GoogleApiHttpBody.fromJson(core.Map _json) { | |
1107 if (_json.containsKey("contentType")) { | |
1108 contentType = _json["contentType"]; | |
1109 } | |
1110 if (_json.containsKey("data")) { | |
1111 data = _json["data"]; | |
1112 } | |
1113 } | |
1114 | |
1115 core.Map toJson() { | |
1116 var _json = new core.Map(); | |
1117 if (contentType != null) { | |
1118 _json["contentType"] = contentType; | |
1119 } | |
1120 if (data != null) { | |
1121 _json["data"] = data; | |
1122 } | |
1123 return _json; | |
1124 } | |
1125 } | |
1126 | |
1127 /** Options for manually scaling a model. */ | |
1128 class GoogleCloudMlV1ManualScaling { | |
1129 /** | |
1130 * The number of nodes to allocate for this model. These nodes are always up, | |
1131 * starting from the time the model is deployed, so the cost of operating | |
1132 * this model will be proportional to nodes * number of hours since | |
1133 * deployment. | |
1134 */ | |
1135 core.int nodes; | |
1136 | |
1137 GoogleCloudMlV1ManualScaling(); | |
1138 | |
1139 GoogleCloudMlV1ManualScaling.fromJson(core.Map _json) { | |
1140 if (_json.containsKey("nodes")) { | |
1141 nodes = _json["nodes"]; | |
1142 } | |
1143 } | |
1144 | |
1145 core.Map toJson() { | |
1146 var _json = new core.Map(); | |
1147 if (nodes != null) { | |
1148 _json["nodes"] = nodes; | |
1149 } | |
1150 return _json; | |
1151 } | |
1152 } | |
1153 | |
1154 /** Represents the metadata of the long-running operation. */ | |
1155 class GoogleCloudMlV1OperationMetadata { | |
1156 /** The time the operation was submitted. */ | |
1157 core.String createTime; | |
1158 /** The time operation processing completed. */ | |
1159 core.String endTime; | |
1160 /** Indicates whether a request to cancel this operation has been made. */ | |
1161 core.bool isCancellationRequested; | |
1162 /** Contains the name of the model associated with the operation. */ | |
1163 core.String modelName; | |
1164 /** | |
1165 * The operation type. | |
1166 * Possible string values are: | |
1167 * - "OPERATION_TYPE_UNSPECIFIED" : Unspecified operation type. | |
1168 * - "CREATE_VERSION" : An operation to create a new version. | |
1169 * - "DELETE_VERSION" : An operation to delete an existing version. | |
1170 * - "DELETE_MODEL" : An operation to delete an existing model. | |
1171 */ | |
1172 core.String operationType; | |
1173 /** The time operation processing started. */ | |
1174 core.String startTime; | |
1175 /** Contains the version associated with the operation. */ | |
1176 GoogleCloudMlV1Version version; | |
1177 | |
1178 GoogleCloudMlV1OperationMetadata(); | |
1179 | |
1180 GoogleCloudMlV1OperationMetadata.fromJson(core.Map _json) { | |
1181 if (_json.containsKey("createTime")) { | |
1182 createTime = _json["createTime"]; | |
1183 } | |
1184 if (_json.containsKey("endTime")) { | |
1185 endTime = _json["endTime"]; | |
1186 } | |
1187 if (_json.containsKey("isCancellationRequested")) { | |
1188 isCancellationRequested = _json["isCancellationRequested"]; | |
1189 } | |
1190 if (_json.containsKey("modelName")) { | |
1191 modelName = _json["modelName"]; | |
1192 } | |
1193 if (_json.containsKey("operationType")) { | |
1194 operationType = _json["operationType"]; | |
1195 } | |
1196 if (_json.containsKey("startTime")) { | |
1197 startTime = _json["startTime"]; | |
1198 } | |
1199 if (_json.containsKey("version")) { | |
1200 version = new GoogleCloudMlV1Version.fromJson(_json["version"]); | |
1201 } | |
1202 } | |
1203 | |
1204 core.Map toJson() { | |
1205 var _json = new core.Map(); | |
1206 if (createTime != null) { | |
1207 _json["createTime"] = createTime; | |
1208 } | |
1209 if (endTime != null) { | |
1210 _json["endTime"] = endTime; | |
1211 } | |
1212 if (isCancellationRequested != null) { | |
1213 _json["isCancellationRequested"] = isCancellationRequested; | |
1214 } | |
1215 if (modelName != null) { | |
1216 _json["modelName"] = modelName; | |
1217 } | |
1218 if (operationType != null) { | |
1219 _json["operationType"] = operationType; | |
1220 } | |
1221 if (startTime != null) { | |
1222 _json["startTime"] = startTime; | |
1223 } | |
1224 if (version != null) { | |
1225 _json["version"] = (version).toJson(); | |
1226 } | |
1227 return _json; | |
1228 } | |
1229 } | |
1230 | |
1231 /** | |
1232 * Represents a version of the model. | |
1233 * | |
1234 * Each version is a trained model deployed in the cloud, ready to handle | |
1235 * prediction requests. A model can have multiple versions. You can get | |
1236 * information about all of the versions of a given model by calling | |
1237 * [projects.models.versions.list](/ml/reference/rest/v1/projects.models.version
s/list). | |
1238 */ | |
1239 class GoogleCloudMlV1Version { | |
1240 /** Output only. The time the version was created. */ | |
1241 core.String createTime; | |
1242 /** | |
1243 * Required. The Google Cloud Storage location of the trained model used to | |
1244 * create the version. See the | |
1245 * [overview of model deployment](/ml/docs/concepts/deployment-overview) for | |
1246 * more informaiton. | |
1247 * | |
1248 * When passing Version to | |
1249 * [projects.models.versions.create](/ml/reference/rest/v1/projects.models.ver
sions/create) | |
1250 * the model service uses the specified location as the source of the model. | |
1251 * Once deployed, the model version is hosted by the prediction service, so | |
1252 * this location is useful only as a historical record. | |
1253 */ | |
1254 core.String deploymentUri; | |
1255 /** | |
1256 * Optional. The description specified for the version when it was created. | |
1257 */ | |
1258 core.String description; | |
1259 /** | |
1260 * Output only. If true, this version will be used to handle prediction | |
1261 * requests that do not specify a version. | |
1262 * | |
1263 * You can change the default version by calling | |
1264 * [projects.methods.versions.setDefault](/ml/reference/rest/v1/projects.model
s.versions/setDefault). | |
1265 */ | |
1266 core.bool isDefault; | |
1267 /** Output only. The time the version was last used for prediction. */ | |
1268 core.String lastUseTime; | |
1269 /** | |
1270 * Optional. Manually select the number of nodes to use for serving the | |
1271 * model. If unset (i.e., by default), the number of nodes used to serve | |
1272 * the model automatically scales with traffic. However, care should be | |
1273 * taken to ramp up traffic according to the model's ability to scale. If | |
1274 * your model needs to handle bursts of traffic beyond it's ability to | |
1275 * scale, it is recommended you set this field appropriately. | |
1276 */ | |
1277 GoogleCloudMlV1ManualScaling manualScaling; | |
1278 /** | |
1279 * Required.The name specified for the version when it was created. | |
1280 * | |
1281 * The version name must be unique within the model it is created in. | |
1282 */ | |
1283 core.String name; | |
1284 /** | |
1285 * Optional. The Google Cloud ML runtime version to use for this deployment. | |
1286 * If not set, Google Cloud ML will choose a version. | |
1287 */ | |
1288 core.String runtimeVersion; | |
1289 | |
1290 GoogleCloudMlV1Version(); | |
1291 | |
1292 GoogleCloudMlV1Version.fromJson(core.Map _json) { | |
1293 if (_json.containsKey("createTime")) { | |
1294 createTime = _json["createTime"]; | |
1295 } | |
1296 if (_json.containsKey("deploymentUri")) { | |
1297 deploymentUri = _json["deploymentUri"]; | |
1298 } | |
1299 if (_json.containsKey("description")) { | |
1300 description = _json["description"]; | |
1301 } | |
1302 if (_json.containsKey("isDefault")) { | |
1303 isDefault = _json["isDefault"]; | |
1304 } | |
1305 if (_json.containsKey("lastUseTime")) { | |
1306 lastUseTime = _json["lastUseTime"]; | |
1307 } | |
1308 if (_json.containsKey("manualScaling")) { | |
1309 manualScaling = new GoogleCloudMlV1ManualScaling.fromJson(_json["manualSca
ling"]); | |
1310 } | |
1311 if (_json.containsKey("name")) { | |
1312 name = _json["name"]; | |
1313 } | |
1314 if (_json.containsKey("runtimeVersion")) { | |
1315 runtimeVersion = _json["runtimeVersion"]; | |
1316 } | |
1317 } | |
1318 | |
1319 core.Map toJson() { | |
1320 var _json = new core.Map(); | |
1321 if (createTime != null) { | |
1322 _json["createTime"] = createTime; | |
1323 } | |
1324 if (deploymentUri != null) { | |
1325 _json["deploymentUri"] = deploymentUri; | |
1326 } | |
1327 if (description != null) { | |
1328 _json["description"] = description; | |
1329 } | |
1330 if (isDefault != null) { | |
1331 _json["isDefault"] = isDefault; | |
1332 } | |
1333 if (lastUseTime != null) { | |
1334 _json["lastUseTime"] = lastUseTime; | |
1335 } | |
1336 if (manualScaling != null) { | |
1337 _json["manualScaling"] = (manualScaling).toJson(); | |
1338 } | |
1339 if (name != null) { | |
1340 _json["name"] = name; | |
1341 } | |
1342 if (runtimeVersion != null) { | |
1343 _json["runtimeVersion"] = runtimeVersion; | |
1344 } | |
1345 return _json; | |
1346 } | |
1347 } | |
1348 | |
1349 /** An observed value of a metric. */ | |
1350 class GoogleCloudMlV1beta1HyperparameterOutputHyperparameterMetric { | |
1351 /** The objective value at this training step. */ | |
1352 core.double objectiveValue; | |
1353 /** The global training step for this metric. */ | |
1354 core.String trainingStep; | |
1355 | |
1356 GoogleCloudMlV1beta1HyperparameterOutputHyperparameterMetric(); | |
1357 | |
1358 GoogleCloudMlV1beta1HyperparameterOutputHyperparameterMetric.fromJson(core.Map
_json) { | |
1359 if (_json.containsKey("objectiveValue")) { | |
1360 objectiveValue = _json["objectiveValue"]; | |
1361 } | |
1362 if (_json.containsKey("trainingStep")) { | |
1363 trainingStep = _json["trainingStep"]; | |
1364 } | |
1365 } | |
1366 | |
1367 core.Map toJson() { | |
1368 var _json = new core.Map(); | |
1369 if (objectiveValue != null) { | |
1370 _json["objectiveValue"] = objectiveValue; | |
1371 } | |
1372 if (trainingStep != null) { | |
1373 _json["trainingStep"] = trainingStep; | |
1374 } | |
1375 return _json; | |
1376 } | |
1377 } | |
1378 | |
1379 /** Request message for the CancelJob method. */ | |
1380 class GoogleCloudMlV1beta1CancelJobRequest { | |
1381 | |
1382 GoogleCloudMlV1beta1CancelJobRequest(); | |
1383 | |
1384 GoogleCloudMlV1beta1CancelJobRequest.fromJson(core.Map _json) { | |
1385 } | |
1386 | |
1387 core.Map toJson() { | |
1388 var _json = new core.Map(); | |
1389 return _json; | |
1390 } | |
1391 } | |
1392 | |
1393 /** Returns service account information associated with a project. */ | |
1394 class GoogleCloudMlV1beta1GetConfigResponse { | |
1395 /** The service account Cloud ML uses to access resources in the project. */ | |
1396 core.String serviceAccount; | |
1397 /** The project number for `service_account`. */ | |
1398 core.String serviceAccountProject; | |
1399 | |
1400 GoogleCloudMlV1beta1GetConfigResponse(); | |
1401 | |
1402 GoogleCloudMlV1beta1GetConfigResponse.fromJson(core.Map _json) { | |
1403 if (_json.containsKey("serviceAccount")) { | |
1404 serviceAccount = _json["serviceAccount"]; | |
1405 } | |
1406 if (_json.containsKey("serviceAccountProject")) { | |
1407 serviceAccountProject = _json["serviceAccountProject"]; | |
1408 } | |
1409 } | |
1410 | |
1411 core.Map toJson() { | |
1412 var _json = new core.Map(); | |
1413 if (serviceAccount != null) { | |
1414 _json["serviceAccount"] = serviceAccount; | |
1415 } | |
1416 if (serviceAccountProject != null) { | |
1417 _json["serviceAccountProject"] = serviceAccountProject; | |
1418 } | |
1419 return _json; | |
1420 } | |
1421 } | |
1422 | |
1423 /** | |
1424 * Represents the result of a single hyperparameter tuning trial from a | |
1425 * training job. The TrainingOutput object that is returned on successful | |
1426 * completion of a training job with hyperparameter tuning includes a list | |
1427 * of HyperparameterOutput objects, one for each successful trial. | |
1428 */ | |
1429 class GoogleCloudMlV1beta1HyperparameterOutput { | |
1430 /** All recorded object metrics for this trial. */ | |
1431 core.List<GoogleCloudMlV1beta1HyperparameterOutputHyperparameterMetric> allMet
rics; | |
1432 /** The final objective metric seen for this trial. */ | |
1433 GoogleCloudMlV1beta1HyperparameterOutputHyperparameterMetric finalMetric; | |
1434 /** The hyperparameters given to this trial. */ | |
1435 core.Map<core.String, core.String> hyperparameters; | |
1436 /** The trial id for these results. */ | |
1437 core.String trialId; | |
1438 | |
1439 GoogleCloudMlV1beta1HyperparameterOutput(); | |
1440 | |
1441 GoogleCloudMlV1beta1HyperparameterOutput.fromJson(core.Map _json) { | |
1442 if (_json.containsKey("allMetrics")) { | |
1443 allMetrics = _json["allMetrics"].map((value) => new GoogleCloudMlV1beta1Hy
perparameterOutputHyperparameterMetric.fromJson(value)).toList(); | |
1444 } | |
1445 if (_json.containsKey("finalMetric")) { | |
1446 finalMetric = new GoogleCloudMlV1beta1HyperparameterOutputHyperparameterMe
tric.fromJson(_json["finalMetric"]); | |
1447 } | |
1448 if (_json.containsKey("hyperparameters")) { | |
1449 hyperparameters = _json["hyperparameters"]; | |
1450 } | |
1451 if (_json.containsKey("trialId")) { | |
1452 trialId = _json["trialId"]; | |
1453 } | |
1454 } | |
1455 | |
1456 core.Map toJson() { | |
1457 var _json = new core.Map(); | |
1458 if (allMetrics != null) { | |
1459 _json["allMetrics"] = allMetrics.map((value) => (value).toJson()).toList()
; | |
1460 } | |
1461 if (finalMetric != null) { | |
1462 _json["finalMetric"] = (finalMetric).toJson(); | |
1463 } | |
1464 if (hyperparameters != null) { | |
1465 _json["hyperparameters"] = hyperparameters; | |
1466 } | |
1467 if (trialId != null) { | |
1468 _json["trialId"] = trialId; | |
1469 } | |
1470 return _json; | |
1471 } | |
1472 } | |
1473 | |
1474 /** Represents a set of hyperparameters to optimize. */ | |
1475 class GoogleCloudMlV1beta1HyperparameterSpec { | |
1476 /** | |
1477 * Required. The type of goal to use for tuning. Available types are | |
1478 * `MAXIMIZE` and `MINIMIZE`. | |
1479 * | |
1480 * Defaults to `MAXIMIZE`. | |
1481 * Possible string values are: | |
1482 * - "GOAL_TYPE_UNSPECIFIED" : Goal Type will default to maximize. | |
1483 * - "MAXIMIZE" : Maximize the goal metric. | |
1484 * - "MINIMIZE" : Minimize the goal metric. | |
1485 */ | |
1486 core.String goal; | |
1487 /** | |
1488 * Optional. The Tensorflow summary tag name to use for optimizing trials. For | |
1489 * current versions of Tensorflow, this tag name should exactly match what is | |
1490 * shown in Tensorboard, including all scopes. For versions of Tensorflow | |
1491 * prior to 0.12, this should be only the tag passed to tf.Summary. | |
1492 * By default, "training/hptuning/metric" will be used. | |
1493 */ | |
1494 core.String hyperparameterMetricTag; | |
1495 /** | |
1496 * Optional. The number of training trials to run concurrently. | |
1497 * You can reduce the time it takes to perform hyperparameter tuning by adding | |
1498 * trials in parallel. However, each trail only benefits from the information | |
1499 * gained in completed trials. That means that a trial does not get access to | |
1500 * the results of trials running at the same time, which could reduce the | |
1501 * quality of the overall optimization. | |
1502 * | |
1503 * Each trial will use the same scale tier and machine types. | |
1504 * | |
1505 * Defaults to one. | |
1506 */ | |
1507 core.int maxParallelTrials; | |
1508 /** | |
1509 * Optional. How many training trials should be attempted to optimize | |
1510 * the specified hyperparameters. | |
1511 * | |
1512 * Defaults to one. | |
1513 */ | |
1514 core.int maxTrials; | |
1515 /** Required. The set of parameters to tune. */ | |
1516 core.List<GoogleCloudMlV1beta1ParameterSpec> params; | |
1517 | |
1518 GoogleCloudMlV1beta1HyperparameterSpec(); | |
1519 | |
1520 GoogleCloudMlV1beta1HyperparameterSpec.fromJson(core.Map _json) { | |
1521 if (_json.containsKey("goal")) { | |
1522 goal = _json["goal"]; | |
1523 } | |
1524 if (_json.containsKey("hyperparameterMetricTag")) { | |
1525 hyperparameterMetricTag = _json["hyperparameterMetricTag"]; | |
1526 } | |
1527 if (_json.containsKey("maxParallelTrials")) { | |
1528 maxParallelTrials = _json["maxParallelTrials"]; | |
1529 } | |
1530 if (_json.containsKey("maxTrials")) { | |
1531 maxTrials = _json["maxTrials"]; | |
1532 } | |
1533 if (_json.containsKey("params")) { | |
1534 params = _json["params"].map((value) => new GoogleCloudMlV1beta1ParameterS
pec.fromJson(value)).toList(); | |
1535 } | |
1536 } | |
1537 | |
1538 core.Map toJson() { | |
1539 var _json = new core.Map(); | |
1540 if (goal != null) { | |
1541 _json["goal"] = goal; | |
1542 } | |
1543 if (hyperparameterMetricTag != null) { | |
1544 _json["hyperparameterMetricTag"] = hyperparameterMetricTag; | |
1545 } | |
1546 if (maxParallelTrials != null) { | |
1547 _json["maxParallelTrials"] = maxParallelTrials; | |
1548 } | |
1549 if (maxTrials != null) { | |
1550 _json["maxTrials"] = maxTrials; | |
1551 } | |
1552 if (params != null) { | |
1553 _json["params"] = params.map((value) => (value).toJson()).toList(); | |
1554 } | |
1555 return _json; | |
1556 } | |
1557 } | |
1558 | |
1559 /** Represents a training or prediction job. */ | |
1560 class GoogleCloudMlV1beta1Job { | |
1561 /** Output only. When the job was created. */ | |
1562 core.String createTime; | |
1563 /** Output only. When the job processing was completed. */ | |
1564 core.String endTime; | |
1565 /** Output only. The details of a failure or a cancellation. */ | |
1566 core.String errorMessage; | |
1567 /** Required. The user-specified id of the job. */ | |
1568 core.String jobId; | |
1569 /** Input parameters to create a prediction job. */ | |
1570 GoogleCloudMlV1beta1PredictionInput predictionInput; | |
1571 /** The current prediction job result. */ | |
1572 GoogleCloudMlV1beta1PredictionOutput predictionOutput; | |
1573 /** Output only. When the job processing was started. */ | |
1574 core.String startTime; | |
1575 /** | |
1576 * Output only. The detailed state of a job. | |
1577 * Possible string values are: | |
1578 * - "STATE_UNSPECIFIED" : The job state is unspecified. | |
1579 * - "QUEUED" : The job has been just created and processing has not yet | |
1580 * begun. | |
1581 * - "PREPARING" : The service is preparing to run the job. | |
1582 * - "RUNNING" : The job is in progress. | |
1583 * - "SUCCEEDED" : The job completed successfully. | |
1584 * - "FAILED" : The job failed. | |
1585 * `error_message` should contain the details of the failure. | |
1586 * - "CANCELLING" : The job is being cancelled. | |
1587 * `error_message` should describe the reason for the cancellation. | |
1588 * - "CANCELLED" : The job has been cancelled. | |
1589 * `error_message` should describe the reason for the cancellation. | |
1590 */ | |
1591 core.String state; | |
1592 /** Input parameters to create a training job. */ | |
1593 GoogleCloudMlV1beta1TrainingInput trainingInput; | |
1594 /** The current training job result. */ | |
1595 GoogleCloudMlV1beta1TrainingOutput trainingOutput; | |
1596 | |
1597 GoogleCloudMlV1beta1Job(); | |
1598 | |
1599 GoogleCloudMlV1beta1Job.fromJson(core.Map _json) { | |
1600 if (_json.containsKey("createTime")) { | |
1601 createTime = _json["createTime"]; | |
1602 } | |
1603 if (_json.containsKey("endTime")) { | |
1604 endTime = _json["endTime"]; | |
1605 } | |
1606 if (_json.containsKey("errorMessage")) { | |
1607 errorMessage = _json["errorMessage"]; | |
1608 } | |
1609 if (_json.containsKey("jobId")) { | |
1610 jobId = _json["jobId"]; | |
1611 } | |
1612 if (_json.containsKey("predictionInput")) { | |
1613 predictionInput = new GoogleCloudMlV1beta1PredictionInput.fromJson(_json["
predictionInput"]); | |
1614 } | |
1615 if (_json.containsKey("predictionOutput")) { | |
1616 predictionOutput = new GoogleCloudMlV1beta1PredictionOutput.fromJson(_json
["predictionOutput"]); | |
1617 } | |
1618 if (_json.containsKey("startTime")) { | |
1619 startTime = _json["startTime"]; | |
1620 } | |
1621 if (_json.containsKey("state")) { | |
1622 state = _json["state"]; | |
1623 } | |
1624 if (_json.containsKey("trainingInput")) { | |
1625 trainingInput = new GoogleCloudMlV1beta1TrainingInput.fromJson(_json["trai
ningInput"]); | |
1626 } | |
1627 if (_json.containsKey("trainingOutput")) { | |
1628 trainingOutput = new GoogleCloudMlV1beta1TrainingOutput.fromJson(_json["tr
ainingOutput"]); | |
1629 } | |
1630 } | |
1631 | |
1632 core.Map toJson() { | |
1633 var _json = new core.Map(); | |
1634 if (createTime != null) { | |
1635 _json["createTime"] = createTime; | |
1636 } | |
1637 if (endTime != null) { | |
1638 _json["endTime"] = endTime; | |
1639 } | |
1640 if (errorMessage != null) { | |
1641 _json["errorMessage"] = errorMessage; | |
1642 } | |
1643 if (jobId != null) { | |
1644 _json["jobId"] = jobId; | |
1645 } | |
1646 if (predictionInput != null) { | |
1647 _json["predictionInput"] = (predictionInput).toJson(); | |
1648 } | |
1649 if (predictionOutput != null) { | |
1650 _json["predictionOutput"] = (predictionOutput).toJson(); | |
1651 } | |
1652 if (startTime != null) { | |
1653 _json["startTime"] = startTime; | |
1654 } | |
1655 if (state != null) { | |
1656 _json["state"] = state; | |
1657 } | |
1658 if (trainingInput != null) { | |
1659 _json["trainingInput"] = (trainingInput).toJson(); | |
1660 } | |
1661 if (trainingOutput != null) { | |
1662 _json["trainingOutput"] = (trainingOutput).toJson(); | |
1663 } | |
1664 return _json; | |
1665 } | |
1666 } | |
1667 | |
1668 /** Response message for the ListJobs method. */ | |
1669 class GoogleCloudMlV1beta1ListJobsResponse { | |
1670 /** The list of jobs. */ | |
1671 core.List<GoogleCloudMlV1beta1Job> jobs; | |
1672 /** | |
1673 * Optional. Pass this token as the `page_token` field of the request for a | |
1674 * subsequent call. | |
1675 */ | |
1676 core.String nextPageToken; | |
1677 | |
1678 GoogleCloudMlV1beta1ListJobsResponse(); | |
1679 | |
1680 GoogleCloudMlV1beta1ListJobsResponse.fromJson(core.Map _json) { | |
1681 if (_json.containsKey("jobs")) { | |
1682 jobs = _json["jobs"].map((value) => new GoogleCloudMlV1beta1Job.fromJson(v
alue)).toList(); | |
1683 } | |
1684 if (_json.containsKey("nextPageToken")) { | |
1685 nextPageToken = _json["nextPageToken"]; | |
1686 } | |
1687 } | |
1688 | |
1689 core.Map toJson() { | |
1690 var _json = new core.Map(); | |
1691 if (jobs != null) { | |
1692 _json["jobs"] = jobs.map((value) => (value).toJson()).toList(); | |
1693 } | |
1694 if (nextPageToken != null) { | |
1695 _json["nextPageToken"] = nextPageToken; | |
1696 } | |
1697 return _json; | |
1698 } | |
1699 } | |
1700 | |
1701 /** Response message for the ListModels method. */ | |
1702 class GoogleCloudMlV1beta1ListModelsResponse { | |
1703 /** The list of models. */ | |
1704 core.List<GoogleCloudMlV1beta1Model> models; | |
1705 /** | |
1706 * Optional. Pass this token as the `page_token` field of the request for a | |
1707 * subsequent call. | |
1708 */ | |
1709 core.String nextPageToken; | |
1710 | |
1711 GoogleCloudMlV1beta1ListModelsResponse(); | |
1712 | |
1713 GoogleCloudMlV1beta1ListModelsResponse.fromJson(core.Map _json) { | |
1714 if (_json.containsKey("models")) { | |
1715 models = _json["models"].map((value) => new GoogleCloudMlV1beta1Model.from
Json(value)).toList(); | |
1716 } | |
1717 if (_json.containsKey("nextPageToken")) { | |
1718 nextPageToken = _json["nextPageToken"]; | |
1719 } | |
1720 } | |
1721 | |
1722 core.Map toJson() { | |
1723 var _json = new core.Map(); | |
1724 if (models != null) { | |
1725 _json["models"] = models.map((value) => (value).toJson()).toList(); | |
1726 } | |
1727 if (nextPageToken != null) { | |
1728 _json["nextPageToken"] = nextPageToken; | |
1729 } | |
1730 return _json; | |
1731 } | |
1732 } | |
1733 | |
1734 /** Response message for the ListVersions method. */ | |
1735 class GoogleCloudMlV1beta1ListVersionsResponse { | |
1736 /** | |
1737 * Optional. Pass this token as the `page_token` field of the request for a | |
1738 * subsequent call. | |
1739 */ | |
1740 core.String nextPageToken; | |
1741 /** The list of versions. */ | |
1742 core.List<GoogleCloudMlV1beta1Version> versions; | |
1743 | |
1744 GoogleCloudMlV1beta1ListVersionsResponse(); | |
1745 | |
1746 GoogleCloudMlV1beta1ListVersionsResponse.fromJson(core.Map _json) { | |
1747 if (_json.containsKey("nextPageToken")) { | |
1748 nextPageToken = _json["nextPageToken"]; | |
1749 } | |
1750 if (_json.containsKey("versions")) { | |
1751 versions = _json["versions"].map((value) => new GoogleCloudMlV1beta1Versio
n.fromJson(value)).toList(); | |
1752 } | |
1753 } | |
1754 | |
1755 core.Map toJson() { | |
1756 var _json = new core.Map(); | |
1757 if (nextPageToken != null) { | |
1758 _json["nextPageToken"] = nextPageToken; | |
1759 } | |
1760 if (versions != null) { | |
1761 _json["versions"] = versions.map((value) => (value).toJson()).toList(); | |
1762 } | |
1763 return _json; | |
1764 } | |
1765 } | |
1766 | |
1767 /** Options for manually scaling a model. */ | |
1768 class GoogleCloudMlV1beta1ManualScaling { | |
1769 /** | |
1770 * The number of nodes to allocate for this model. These nodes are always up, | |
1771 * starting from the time the model is deployed, so the cost of operating | |
1772 * this model will be proportional to nodes * number of hours since | |
1773 * deployment. | |
1774 */ | |
1775 core.int nodes; | |
1776 | |
1777 GoogleCloudMlV1beta1ManualScaling(); | |
1778 | |
1779 GoogleCloudMlV1beta1ManualScaling.fromJson(core.Map _json) { | |
1780 if (_json.containsKey("nodes")) { | |
1781 nodes = _json["nodes"]; | |
1782 } | |
1783 } | |
1784 | |
1785 core.Map toJson() { | |
1786 var _json = new core.Map(); | |
1787 if (nodes != null) { | |
1788 _json["nodes"] = nodes; | |
1789 } | |
1790 return _json; | |
1791 } | |
1792 } | |
1793 | |
1794 /** | |
1795 * Represents a machine learning solution. | |
1796 * | |
1797 * A model can have multiple versions, each of which is a deployed, trained | |
1798 * model ready to receive prediction requests. The model itself is just a | |
1799 * container. | |
1800 */ | |
1801 class GoogleCloudMlV1beta1Model { | |
1802 /** | |
1803 * Output only. The default version of the model. This version will be used to | |
1804 * handle prediction requests that do not specify a version. | |
1805 * | |
1806 * You can change the default version by calling | |
1807 * [projects.methods.versions.setDefault](/ml/reference/rest/v1beta1/projects.
models.versions/setDefault). | |
1808 */ | |
1809 GoogleCloudMlV1beta1Version defaultVersion; | |
1810 /** Optional. The description specified for the model when it was created. */ | |
1811 core.String description; | |
1812 /** | |
1813 * Required. The name specified for the model when it was created. | |
1814 * | |
1815 * The model name must be unique within the project it is created in. | |
1816 */ | |
1817 core.String name; | |
1818 /** | |
1819 * Optional. If true, enables StackDriver Logging for online prediction. | |
1820 * Default is false. | |
1821 */ | |
1822 core.bool onlinePredictionLogging; | |
1823 /** | |
1824 * Optional. The list of regions where the model is going to be deployed. | |
1825 * Currently only one region per model is supported. | |
1826 * Defaults to 'us-central1' if nothing is set. | |
1827 */ | |
1828 core.List<core.String> regions; | |
1829 | |
1830 GoogleCloudMlV1beta1Model(); | |
1831 | |
1832 GoogleCloudMlV1beta1Model.fromJson(core.Map _json) { | |
1833 if (_json.containsKey("defaultVersion")) { | |
1834 defaultVersion = new GoogleCloudMlV1beta1Version.fromJson(_json["defaultVe
rsion"]); | |
1835 } | |
1836 if (_json.containsKey("description")) { | |
1837 description = _json["description"]; | |
1838 } | |
1839 if (_json.containsKey("name")) { | |
1840 name = _json["name"]; | |
1841 } | |
1842 if (_json.containsKey("onlinePredictionLogging")) { | |
1843 onlinePredictionLogging = _json["onlinePredictionLogging"]; | |
1844 } | |
1845 if (_json.containsKey("regions")) { | |
1846 regions = _json["regions"]; | |
1847 } | |
1848 } | |
1849 | |
1850 core.Map toJson() { | |
1851 var _json = new core.Map(); | |
1852 if (defaultVersion != null) { | |
1853 _json["defaultVersion"] = (defaultVersion).toJson(); | |
1854 } | |
1855 if (description != null) { | |
1856 _json["description"] = description; | |
1857 } | |
1858 if (name != null) { | |
1859 _json["name"] = name; | |
1860 } | |
1861 if (onlinePredictionLogging != null) { | |
1862 _json["onlinePredictionLogging"] = onlinePredictionLogging; | |
1863 } | |
1864 if (regions != null) { | |
1865 _json["regions"] = regions; | |
1866 } | |
1867 return _json; | |
1868 } | |
1869 } | |
1870 | |
1871 /** Represents the metadata of the long-running operation. */ | |
1872 class GoogleCloudMlV1beta1OperationMetadata { | |
1873 /** The time the operation was submitted. */ | |
1874 core.String createTime; | |
1875 /** The time operation processing completed. */ | |
1876 core.String endTime; | |
1877 /** Indicates whether a request to cancel this operation has been made. */ | |
1878 core.bool isCancellationRequested; | |
1879 /** Contains the name of the model associated with the operation. */ | |
1880 core.String modelName; | |
1881 /** | |
1882 * The operation type. | |
1883 * Possible string values are: | |
1884 * - "OPERATION_TYPE_UNSPECIFIED" : Unspecified operation type. | |
1885 * - "CREATE_VERSION" : An operation to create a new version. | |
1886 * - "DELETE_VERSION" : An operation to delete an existing version. | |
1887 * - "DELETE_MODEL" : An operation to delete an existing model. | |
1888 */ | |
1889 core.String operationType; | |
1890 /** The time operation processing started. */ | |
1891 core.String startTime; | |
1892 /** Contains the version associated with the operation. */ | |
1893 GoogleCloudMlV1beta1Version version; | |
1894 | |
1895 GoogleCloudMlV1beta1OperationMetadata(); | |
1896 | |
1897 GoogleCloudMlV1beta1OperationMetadata.fromJson(core.Map _json) { | |
1898 if (_json.containsKey("createTime")) { | |
1899 createTime = _json["createTime"]; | |
1900 } | |
1901 if (_json.containsKey("endTime")) { | |
1902 endTime = _json["endTime"]; | |
1903 } | |
1904 if (_json.containsKey("isCancellationRequested")) { | |
1905 isCancellationRequested = _json["isCancellationRequested"]; | |
1906 } | |
1907 if (_json.containsKey("modelName")) { | |
1908 modelName = _json["modelName"]; | |
1909 } | |
1910 if (_json.containsKey("operationType")) { | |
1911 operationType = _json["operationType"]; | |
1912 } | |
1913 if (_json.containsKey("startTime")) { | |
1914 startTime = _json["startTime"]; | |
1915 } | |
1916 if (_json.containsKey("version")) { | |
1917 version = new GoogleCloudMlV1beta1Version.fromJson(_json["version"]); | |
1918 } | |
1919 } | |
1920 | |
1921 core.Map toJson() { | |
1922 var _json = new core.Map(); | |
1923 if (createTime != null) { | |
1924 _json["createTime"] = createTime; | |
1925 } | |
1926 if (endTime != null) { | |
1927 _json["endTime"] = endTime; | |
1928 } | |
1929 if (isCancellationRequested != null) { | |
1930 _json["isCancellationRequested"] = isCancellationRequested; | |
1931 } | |
1932 if (modelName != null) { | |
1933 _json["modelName"] = modelName; | |
1934 } | |
1935 if (operationType != null) { | |
1936 _json["operationType"] = operationType; | |
1937 } | |
1938 if (startTime != null) { | |
1939 _json["startTime"] = startTime; | |
1940 } | |
1941 if (version != null) { | |
1942 _json["version"] = (version).toJson(); | |
1943 } | |
1944 return _json; | |
1945 } | |
1946 } | |
1947 | |
1948 /** Represents a single hyperparameter to optimize. */ | |
1949 class GoogleCloudMlV1beta1ParameterSpec { | |
1950 /** Required if type is `CATEGORICAL`. The list of possible categories. */ | |
1951 core.List<core.String> categoricalValues; | |
1952 /** | |
1953 * Required if type is `DISCRETE`. | |
1954 * A list of feasible points. | |
1955 * The list should be in strictly increasing order. For instance, this | |
1956 * parameter might have possible settings of 1.5, 2.5, and 4.0. This list | |
1957 * should not contain more than 1,000 values. | |
1958 */ | |
1959 core.List<core.double> discreteValues; | |
1960 /** | |
1961 * Required if typeis `DOUBLE` or `INTEGER`. This field | |
1962 * should be unset if type is `CATEGORICAL`. This value should be integers if | |
1963 * type is `INTEGER`. | |
1964 */ | |
1965 core.double maxValue; | |
1966 /** | |
1967 * Required if type is `DOUBLE` or `INTEGER`. This field | |
1968 * should be unset if type is `CATEGORICAL`. This value should be integers if | |
1969 * type is INTEGER. | |
1970 */ | |
1971 core.double minValue; | |
1972 /** | |
1973 * Required. The parameter name must be unique amongst all ParameterConfigs in | |
1974 * a HyperparameterSpec message. E.g., "learning_rate". | |
1975 */ | |
1976 core.String parameterName; | |
1977 /** | |
1978 * Optional. How the parameter should be scaled to the hypercube. | |
1979 * Leave unset for categorical parameters. | |
1980 * Some kind of scaling is strongly recommended for real or integral | |
1981 * parameters (e.g., `UNIT_LINEAR_SCALE`). | |
1982 * Possible string values are: | |
1983 * - "NONE" : By default, no scaling is applied. | |
1984 * - "UNIT_LINEAR_SCALE" : Scales the feasible space to (0, 1) linearly. | |
1985 * - "UNIT_LOG_SCALE" : Scales the feasible space logarithmically to (0, 1). | |
1986 * The entire feasible | |
1987 * space must be strictly positive. | |
1988 * - "UNIT_REVERSE_LOG_SCALE" : Scales the feasible space "reverse" | |
1989 * logarithmically to (0, 1). The result | |
1990 * is that values close to the top of the feasible space are spread out more | |
1991 * than points near the bottom. The entire feasible space must be strictly | |
1992 * positive. | |
1993 */ | |
1994 core.String scaleType; | |
1995 /** | |
1996 * Required. The type of the parameter. | |
1997 * Possible string values are: | |
1998 * - "PARAMETER_TYPE_UNSPECIFIED" : You must specify a valid type. Using this | |
1999 * unspecified type will result in | |
2000 * an error. | |
2001 * - "DOUBLE" : Type for real-valued parameters. | |
2002 * - "INTEGER" : Type for integral parameters. | |
2003 * - "CATEGORICAL" : The parameter is categorical, with a value chosen from | |
2004 * the categories | |
2005 * field. | |
2006 * - "DISCRETE" : The parameter is real valued, with a fixed set of feasible | |
2007 * points. If | |
2008 * `type==DISCRETE`, feasible_points must be provided, and | |
2009 * {`min_value`, `max_value`} will be ignored. | |
2010 */ | |
2011 core.String type; | |
2012 | |
2013 GoogleCloudMlV1beta1ParameterSpec(); | |
2014 | |
2015 GoogleCloudMlV1beta1ParameterSpec.fromJson(core.Map _json) { | |
2016 if (_json.containsKey("categoricalValues")) { | |
2017 categoricalValues = _json["categoricalValues"]; | |
2018 } | |
2019 if (_json.containsKey("discreteValues")) { | |
2020 discreteValues = _json["discreteValues"]; | |
2021 } | |
2022 if (_json.containsKey("maxValue")) { | |
2023 maxValue = _json["maxValue"]; | |
2024 } | |
2025 if (_json.containsKey("minValue")) { | |
2026 minValue = _json["minValue"]; | |
2027 } | |
2028 if (_json.containsKey("parameterName")) { | |
2029 parameterName = _json["parameterName"]; | |
2030 } | |
2031 if (_json.containsKey("scaleType")) { | |
2032 scaleType = _json["scaleType"]; | |
2033 } | |
2034 if (_json.containsKey("type")) { | |
2035 type = _json["type"]; | |
2036 } | |
2037 } | |
2038 | |
2039 core.Map toJson() { | |
2040 var _json = new core.Map(); | |
2041 if (categoricalValues != null) { | |
2042 _json["categoricalValues"] = categoricalValues; | |
2043 } | |
2044 if (discreteValues != null) { | |
2045 _json["discreteValues"] = discreteValues; | |
2046 } | |
2047 if (maxValue != null) { | |
2048 _json["maxValue"] = maxValue; | |
2049 } | |
2050 if (minValue != null) { | |
2051 _json["minValue"] = minValue; | |
2052 } | |
2053 if (parameterName != null) { | |
2054 _json["parameterName"] = parameterName; | |
2055 } | |
2056 if (scaleType != null) { | |
2057 _json["scaleType"] = scaleType; | |
2058 } | |
2059 if (type != null) { | |
2060 _json["type"] = type; | |
2061 } | |
2062 return _json; | |
2063 } | |
2064 } | |
2065 | |
2066 /** | |
2067 * Request for predictions to be issued against a trained model. | |
2068 * | |
2069 * The body of the request is a single JSON object with a single top-level | |
2070 * field: | |
2071 * | |
2072 * <dl> | |
2073 * <dt>instances</dt> | |
2074 * <dd>A JSON array containing values representing the instances to use for | |
2075 * prediction.</dd> | |
2076 * </dl> | |
2077 * | |
2078 * The structure of each element of the instances list is determined by your | |
2079 * model's input definition. Instances can include named inputs or can contain | |
2080 * only unlabeled values. | |
2081 * | |
2082 * Not all data includes named inputs. Some instances will be simple | |
2083 * JSON values (boolean, number, or string). However, instances are often lists | |
2084 * of simple values, or complex nested lists. Here are some examples of request | |
2085 * bodies: | |
2086 * | |
2087 * CSV data with each row encoded as a string value: | |
2088 * <pre> | |
2089 * {"instances": ["1.0,true,\\"x\\"", "-2.0,false,\\"y\\""]} | |
2090 * </pre> | |
2091 * Plain text: | |
2092 * <pre> | |
2093 * {"instances": ["the quick brown fox", "la bruja le dio"]} | |
2094 * </pre> | |
2095 * Sentences encoded as lists of words (vectors of strings): | |
2096 * <pre> | |
2097 * { | |
2098 * "instances": [ | |
2099 * ["the","quick","brown"], | |
2100 * ["la","bruja","le"], | |
2101 * ... | |
2102 * ] | |
2103 * } | |
2104 * </pre> | |
2105 * Floating point scalar values: | |
2106 * <pre> | |
2107 * {"instances": [0.0, 1.1, 2.2]} | |
2108 * </pre> | |
2109 * Vectors of integers: | |
2110 * <pre> | |
2111 * { | |
2112 * "instances": [ | |
2113 * [0, 1, 2], | |
2114 * [3, 4, 5], | |
2115 * ... | |
2116 * ] | |
2117 * } | |
2118 * </pre> | |
2119 * Tensors (in this case, two-dimensional tensors): | |
2120 * <pre> | |
2121 * { | |
2122 * "instances": [ | |
2123 * [ | |
2124 * [0, 1, 2], | |
2125 * [3, 4, 5] | |
2126 * ], | |
2127 * ... | |
2128 * ] | |
2129 * } | |
2130 * </pre> | |
2131 * Images can be represented different ways. In this encoding scheme the first | |
2132 * two dimensions represent the rows and columns of the image, and the third | |
2133 * contains lists (vectors) of the R, G, and B values for each pixel. | |
2134 * <pre> | |
2135 * { | |
2136 * "instances": [ | |
2137 * [ | |
2138 * [ | |
2139 * [138, 30, 66], | |
2140 * [130, 20, 56], | |
2141 * ... | |
2142 * ], | |
2143 * [ | |
2144 * [126, 38, 61], | |
2145 * [122, 24, 57], | |
2146 * ... | |
2147 * ], | |
2148 * ... | |
2149 * ], | |
2150 * ... | |
2151 * ] | |
2152 * } | |
2153 * </pre> | |
2154 * JSON strings must be encoded as UTF-8. To send binary data, you must | |
2155 * base64-encode the data and mark it as binary. To mark a JSON string | |
2156 * as binary, replace it with a JSON object with a single attribute named `b64`: | |
2157 * <pre>{"b64": "..."} </pre> | |
2158 * For example: | |
2159 * | |
2160 * Two Serialized tf.Examples (fake data, for illustrative purposes only): | |
2161 * <pre> | |
2162 * {"instances": [{"b64": "X5ad6u"}, {"b64": "IA9j4nx"}]} | |
2163 * </pre> | |
2164 * Two JPEG image byte strings (fake data, for illustrative purposes only): | |
2165 * <pre> | |
2166 * {"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]} | |
2167 * </pre> | |
2168 * If your data includes named references, format each instance as a JSON object | |
2169 * with the named references as the keys: | |
2170 * | |
2171 * JSON input data to be preprocessed: | |
2172 * <pre> | |
2173 * { | |
2174 * "instances": [ | |
2175 * { | |
2176 * "a": 1.0, | |
2177 * "b": true, | |
2178 * "c": "x" | |
2179 * }, | |
2180 * { | |
2181 * "a": -2.0, | |
2182 * "b": false, | |
2183 * "c": "y" | |
2184 * } | |
2185 * ] | |
2186 * } | |
2187 * </pre> | |
2188 * Some models have an underlying TensorFlow graph that accepts multiple input | |
2189 * tensors. In this case, you should use the names of JSON name/value pairs to | |
2190 * identify the input tensors, as shown in the following exmaples: | |
2191 * | |
2192 * For a graph with input tensor aliases "tag" (string) and "image" | |
2193 * (base64-encoded string): | |
2194 * <pre> | |
2195 * { | |
2196 * "instances": [ | |
2197 * { | |
2198 * "tag": "beach", | |
2199 * "image": {"b64": "ASa8asdf"} | |
2200 * }, | |
2201 * { | |
2202 * "tag": "car", | |
2203 * "image": {"b64": "JLK7ljk3"} | |
2204 * } | |
2205 * ] | |
2206 * } | |
2207 * </pre> | |
2208 * For a graph with input tensor aliases "tag" (string) and "image" | |
2209 * (3-dimensional array of 8-bit ints): | |
2210 * <pre> | |
2211 * { | |
2212 * "instances": [ | |
2213 * { | |
2214 * "tag": "beach", | |
2215 * "image": [ | |
2216 * [ | |
2217 * [138, 30, 66], | |
2218 * [130, 20, 56], | |
2219 * ... | |
2220 * ], | |
2221 * [ | |
2222 * [126, 38, 61], | |
2223 * [122, 24, 57], | |
2224 * ... | |
2225 * ], | |
2226 * ... | |
2227 * ] | |
2228 * }, | |
2229 * { | |
2230 * "tag": "car", | |
2231 * "image": [ | |
2232 * [ | |
2233 * [255, 0, 102], | |
2234 * [255, 0, 97], | |
2235 * ... | |
2236 * ], | |
2237 * [ | |
2238 * [254, 1, 101], | |
2239 * [254, 2, 93], | |
2240 * ... | |
2241 * ], | |
2242 * ... | |
2243 * ] | |
2244 * }, | |
2245 * ... | |
2246 * ] | |
2247 * } | |
2248 * </pre> | |
2249 * If the call is successful, the response body will contain one prediction | |
2250 * entry per instance in the request body. If prediction fails for any | |
2251 * instance, the response body will contain no predictions and will contian | |
2252 * a single error entry instead. | |
2253 */ | |
2254 class GoogleCloudMlV1beta1PredictRequest { | |
2255 /** | |
2256 * | |
2257 * Required. The prediction request body. | |
2258 */ | |
2259 GoogleApiHttpBody httpBody; | |
2260 | |
2261 GoogleCloudMlV1beta1PredictRequest(); | |
2262 | |
2263 GoogleCloudMlV1beta1PredictRequest.fromJson(core.Map _json) { | |
2264 if (_json.containsKey("httpBody")) { | |
2265 httpBody = new GoogleApiHttpBody.fromJson(_json["httpBody"]); | |
2266 } | |
2267 } | |
2268 | |
2269 core.Map toJson() { | |
2270 var _json = new core.Map(); | |
2271 if (httpBody != null) { | |
2272 _json["httpBody"] = (httpBody).toJson(); | |
2273 } | |
2274 return _json; | |
2275 } | |
2276 } | |
2277 | |
2278 /** Represents input parameters for a prediction job. */ | |
2279 class GoogleCloudMlV1beta1PredictionInput { | |
2280 /** | |
2281 * Required. The format of the input data files. | |
2282 * Possible string values are: | |
2283 * - "DATA_FORMAT_UNSPECIFIED" : Unspecified format. | |
2284 * - "TEXT" : The source file is a text file with instances separated by the | |
2285 * new-line character. | |
2286 * - "TF_RECORD" : The source file is a TFRecord file. | |
2287 * - "TF_RECORD_GZIP" : The source file is a GZIP-compressed TFRecord file. | |
2288 */ | |
2289 core.String dataFormat; | |
2290 /** | |
2291 * Required. The Google Cloud Storage location of the input data files. | |
2292 * May contain wildcards. | |
2293 */ | |
2294 core.List<core.String> inputPaths; | |
2295 /** | |
2296 * Optional. The maximum number of workers to be used for parallel processing. | |
2297 * Defaults to 10 if not specified. | |
2298 */ | |
2299 core.String maxWorkerCount; | |
2300 /** | |
2301 * Use this field if you want to use the default version for the specified | |
2302 * model. The string must use the following format: | |
2303 * | |
2304 * `"projects/<var>[YOUR_PROJECT]</var>/models/<var>[YOUR_MODEL]</var>"` | |
2305 */ | |
2306 core.String modelName; | |
2307 /** Required. The output Google Cloud Storage location. */ | |
2308 core.String outputPath; | |
2309 /** | |
2310 * Required. The Google Compute Engine region to run the prediction job in. | |
2311 */ | |
2312 core.String region; | |
2313 /** | |
2314 * Optional. The Google Cloud ML runtime version to use for this batch | |
2315 * prediction. If not set, Google Cloud ML will pick the runtime version used | |
2316 * during the CreateVersion request for this model version, or choose the | |
2317 * latest stable version when model version information is not available | |
2318 * such as when the model is specified by uri. | |
2319 */ | |
2320 core.String runtimeVersion; | |
2321 /** | |
2322 * Use this field if you want to specify a Google Cloud Storage path for | |
2323 * the model to use. | |
2324 */ | |
2325 core.String uri; | |
2326 /** | |
2327 * Use this field if you want to specify a version of the model to use. The | |
2328 * string is formatted the same way as `model_version`, with the addition | |
2329 * of the version information: | |
2330 * | |
2331 * `"projects/<var>[YOUR_PROJECT]</var>/models/<var>YOUR_MODEL/versions/<var>[
YOUR_VERSION]</var>"` | |
2332 */ | |
2333 core.String versionName; | |
2334 | |
2335 GoogleCloudMlV1beta1PredictionInput(); | |
2336 | |
2337 GoogleCloudMlV1beta1PredictionInput.fromJson(core.Map _json) { | |
2338 if (_json.containsKey("dataFormat")) { | |
2339 dataFormat = _json["dataFormat"]; | |
2340 } | |
2341 if (_json.containsKey("inputPaths")) { | |
2342 inputPaths = _json["inputPaths"]; | |
2343 } | |
2344 if (_json.containsKey("maxWorkerCount")) { | |
2345 maxWorkerCount = _json["maxWorkerCount"]; | |
2346 } | |
2347 if (_json.containsKey("modelName")) { | |
2348 modelName = _json["modelName"]; | |
2349 } | |
2350 if (_json.containsKey("outputPath")) { | |
2351 outputPath = _json["outputPath"]; | |
2352 } | |
2353 if (_json.containsKey("region")) { | |
2354 region = _json["region"]; | |
2355 } | |
2356 if (_json.containsKey("runtimeVersion")) { | |
2357 runtimeVersion = _json["runtimeVersion"]; | |
2358 } | |
2359 if (_json.containsKey("uri")) { | |
2360 uri = _json["uri"]; | |
2361 } | |
2362 if (_json.containsKey("versionName")) { | |
2363 versionName = _json["versionName"]; | |
2364 } | |
2365 } | |
2366 | |
2367 core.Map toJson() { | |
2368 var _json = new core.Map(); | |
2369 if (dataFormat != null) { | |
2370 _json["dataFormat"] = dataFormat; | |
2371 } | |
2372 if (inputPaths != null) { | |
2373 _json["inputPaths"] = inputPaths; | |
2374 } | |
2375 if (maxWorkerCount != null) { | |
2376 _json["maxWorkerCount"] = maxWorkerCount; | |
2377 } | |
2378 if (modelName != null) { | |
2379 _json["modelName"] = modelName; | |
2380 } | |
2381 if (outputPath != null) { | |
2382 _json["outputPath"] = outputPath; | |
2383 } | |
2384 if (region != null) { | |
2385 _json["region"] = region; | |
2386 } | |
2387 if (runtimeVersion != null) { | |
2388 _json["runtimeVersion"] = runtimeVersion; | |
2389 } | |
2390 if (uri != null) { | |
2391 _json["uri"] = uri; | |
2392 } | |
2393 if (versionName != null) { | |
2394 _json["versionName"] = versionName; | |
2395 } | |
2396 return _json; | |
2397 } | |
2398 } | |
2399 | |
2400 /** Represents results of a prediction job. */ | |
2401 class GoogleCloudMlV1beta1PredictionOutput { | |
2402 /** The number of data instances which resulted in errors. */ | |
2403 core.String errorCount; | |
2404 /** Node hours used by the batch prediction job. */ | |
2405 core.double nodeHours; | |
2406 /** | |
2407 * The output Google Cloud Storage location provided at the job creation time. | |
2408 */ | |
2409 core.String outputPath; | |
2410 /** The number of generated predictions. */ | |
2411 core.String predictionCount; | |
2412 | |
2413 GoogleCloudMlV1beta1PredictionOutput(); | |
2414 | |
2415 GoogleCloudMlV1beta1PredictionOutput.fromJson(core.Map _json) { | |
2416 if (_json.containsKey("errorCount")) { | |
2417 errorCount = _json["errorCount"]; | |
2418 } | |
2419 if (_json.containsKey("nodeHours")) { | |
2420 nodeHours = _json["nodeHours"]; | |
2421 } | |
2422 if (_json.containsKey("outputPath")) { | |
2423 outputPath = _json["outputPath"]; | |
2424 } | |
2425 if (_json.containsKey("predictionCount")) { | |
2426 predictionCount = _json["predictionCount"]; | |
2427 } | |
2428 } | |
2429 | |
2430 core.Map toJson() { | |
2431 var _json = new core.Map(); | |
2432 if (errorCount != null) { | |
2433 _json["errorCount"] = errorCount; | |
2434 } | |
2435 if (nodeHours != null) { | |
2436 _json["nodeHours"] = nodeHours; | |
2437 } | |
2438 if (outputPath != null) { | |
2439 _json["outputPath"] = outputPath; | |
2440 } | |
2441 if (predictionCount != null) { | |
2442 _json["predictionCount"] = predictionCount; | |
2443 } | |
2444 return _json; | |
2445 } | |
2446 } | |
2447 | |
2448 /** Request message for the SetDefaultVersion request. */ | |
2449 class GoogleCloudMlV1beta1SetDefaultVersionRequest { | |
2450 | |
2451 GoogleCloudMlV1beta1SetDefaultVersionRequest(); | |
2452 | |
2453 GoogleCloudMlV1beta1SetDefaultVersionRequest.fromJson(core.Map _json) { | |
2454 } | |
2455 | |
2456 core.Map toJson() { | |
2457 var _json = new core.Map(); | |
2458 return _json; | |
2459 } | |
2460 } | |
2461 | |
2462 /** Represents input parameters for a training job. */ | |
2463 class GoogleCloudMlV1beta1TrainingInput { | |
2464 /** Optional. Command line arguments to pass to the program. */ | |
2465 core.List<core.String> args; | |
2466 /** Optional. The set of Hyperparameters to tune. */ | |
2467 GoogleCloudMlV1beta1HyperparameterSpec hyperparameters; | |
2468 /** | |
2469 * Optional. A Google Cloud Storage path in which to store training outputs | |
2470 * and other data needed for training. This path is passed to your TensorFlow | |
2471 * program as the 'job_dir' command-line argument. The benefit of specifying | |
2472 * this field is that Cloud ML validates the path for use in training. | |
2473 */ | |
2474 core.String jobDir; | |
2475 /** | |
2476 * Optional. Specifies the type of virtual machine to use for your training | |
2477 * job's master worker. | |
2478 * | |
2479 * The following types are supported: | |
2480 * | |
2481 * <dl> | |
2482 * <dt>standard</dt> | |
2483 * <dd> | |
2484 * A basic machine configuration suitable for training simple models with | |
2485 * small to moderate datasets. | |
2486 * </dd> | |
2487 * <dt>large_model</dt> | |
2488 * <dd> | |
2489 * A machine with a lot of memory, specially suited for parameter servers | |
2490 * when your model is large (having many hidden layers or layers with very | |
2491 * large numbers of nodes). | |
2492 * </dd> | |
2493 * <dt>complex_model_s</dt> | |
2494 * <dd> | |
2495 * A machine suitable for the master and workers of the cluster when your | |
2496 * model requires more computation than the standard machine can handle | |
2497 * satisfactorily. | |
2498 * </dd> | |
2499 * <dt>complex_model_m</dt> | |
2500 * <dd> | |
2501 * A machine with roughly twice the number of cores and roughly double the | |
2502 * memory of <code suppresswarning="true">complex_model_s</code>. | |
2503 * </dd> | |
2504 * <dt>complex_model_l</dt> | |
2505 * <dd> | |
2506 * A machine with roughly twice the number of cores and roughly double the | |
2507 * memory of <code suppresswarning="true">complex_model_m</code>. | |
2508 * </dd> | |
2509 * <dt>standard_gpu</dt> | |
2510 * <dd> | |
2511 * A machine equivalent to <code suppresswarning="true">standard</code> that | |
2512 * also includes a | |
2513 * <a href="ml/docs/how-tos/using-gpus"> | |
2514 * GPU that you can use in your trainer</a>. | |
2515 * </dd> | |
2516 * <dt>complex_model_m_gpu</dt> | |
2517 * <dd> | |
2518 * A machine equivalent to | |
2519 * <code suppresswarning="true">coplex_model_m</code> that also includes | |
2520 * four GPUs. | |
2521 * </dd> | |
2522 * </dl> | |
2523 * | |
2524 * You must set this value when `scaleTier` is set to `CUSTOM`. | |
2525 */ | |
2526 core.String masterType; | |
2527 /** | |
2528 * Required. The Google Cloud Storage location of the packages with | |
2529 * the training program and any additional dependencies. | |
2530 */ | |
2531 core.List<core.String> packageUris; | |
2532 /** | |
2533 * Optional. The number of parameter server replicas to use for the training | |
2534 * job. Each replica in the cluster will be of the type specified in | |
2535 * `parameter_server_type`. | |
2536 * | |
2537 * This value can only be used when `scale_tier` is set to `CUSTOM`.If you | |
2538 * set this value, you must also set `parameter_server_type`. | |
2539 */ | |
2540 core.String parameterServerCount; | |
2541 /** | |
2542 * Optional. Specifies the type of virtual machine to use for your training | |
2543 * job's parameter server. | |
2544 * | |
2545 * The supported values are the same as those described in the entry for | |
2546 * `master_type`. | |
2547 * | |
2548 * This value must be present when `scaleTier` is set to `CUSTOM` and | |
2549 * `parameter_server_count` is greater than zero. | |
2550 */ | |
2551 core.String parameterServerType; | |
2552 /** Required. The Python module name to run after installing the packages. */ | |
2553 core.String pythonModule; | |
2554 /** Required. The Google Compute Engine region to run the training job in. */ | |
2555 core.String region; | |
2556 /** | |
2557 * Optional. The Google Cloud ML runtime version to use for training. If not | |
2558 * set, Google Cloud ML will choose the latest stable version. | |
2559 */ | |
2560 core.String runtimeVersion; | |
2561 /** | |
2562 * Required. Specifies the machine types, the number of replicas for workers | |
2563 * and parameter servers. | |
2564 * Possible string values are: | |
2565 * - "BASIC" : A single worker instance. This tier is suitable for learning | |
2566 * how to use | |
2567 * Cloud ML, and for experimenting with new models using small datasets. | |
2568 * - "STANDARD_1" : Many workers and a few parameter servers. | |
2569 * - "PREMIUM_1" : A large number of workers with many parameter servers. | |
2570 * - "BASIC_GPU" : A single worker instance [with a | |
2571 * GPU](ml/docs/how-tos/using-gpus). | |
2572 * - "CUSTOM" : The CUSTOM tier is not a set tier, but rather enables you to | |
2573 * use your | |
2574 * own cluster specification. When you use this tier, set values to | |
2575 * configure your processing cluster according to these guidelines: | |
2576 * | |
2577 * * You _must_ set `TrainingInput.masterType` to specify the type | |
2578 * of machine to use for your master node. This is the only required | |
2579 * setting. | |
2580 * | |
2581 * * You _may_ set `TrainingInput.workerCount` to specify the number of | |
2582 * workers to use. If you specify one or more workers, you _must_ also | |
2583 * set `TrainingInput.workerType` to specify the type of machine to use | |
2584 * for your worker nodes. | |
2585 * | |
2586 * * You _may_ set `TrainingInput.parameterServerCount` to specify the | |
2587 * number of parameter servers to use. If you specify one or more | |
2588 * parameter servers, you _must_ also set | |
2589 * `TrainingInput.parameterServerType` to specify the type of machine to | |
2590 * use for your parameter servers. | |
2591 * | |
2592 * Note that all of your workers must use the same machine type, which can | |
2593 * be different from your parameter server type and master type. Your | |
2594 * parameter servers must likewise use the same machine type, which can be | |
2595 * different from your worker type and master type. | |
2596 */ | |
2597 core.String scaleTier; | |
2598 /** | |
2599 * Optional. The number of worker replicas to use for the training job. Each | |
2600 * replica in the cluster will be of the type specified in `worker_type`. | |
2601 * | |
2602 * This value can only be used when `scale_tier` is set to `CUSTOM`. If you | |
2603 * set this value, you must also set `worker_type`. | |
2604 */ | |
2605 core.String workerCount; | |
2606 /** | |
2607 * Optional. Specifies the type of virtual machine to use for your training | |
2608 * job's worker nodes. | |
2609 * | |
2610 * The supported values are the same as those described in the entry for | |
2611 * `masterType`. | |
2612 * | |
2613 * This value must be present when `scaleTier` is set to `CUSTOM` and | |
2614 * `workerCount` is greater than zero. | |
2615 */ | |
2616 core.String workerType; | |
2617 | |
2618 GoogleCloudMlV1beta1TrainingInput(); | |
2619 | |
2620 GoogleCloudMlV1beta1TrainingInput.fromJson(core.Map _json) { | |
2621 if (_json.containsKey("args")) { | |
2622 args = _json["args"]; | |
2623 } | |
2624 if (_json.containsKey("hyperparameters")) { | |
2625 hyperparameters = new GoogleCloudMlV1beta1HyperparameterSpec.fromJson(_jso
n["hyperparameters"]); | |
2626 } | |
2627 if (_json.containsKey("jobDir")) { | |
2628 jobDir = _json["jobDir"]; | |
2629 } | |
2630 if (_json.containsKey("masterType")) { | |
2631 masterType = _json["masterType"]; | |
2632 } | |
2633 if (_json.containsKey("packageUris")) { | |
2634 packageUris = _json["packageUris"]; | |
2635 } | |
2636 if (_json.containsKey("parameterServerCount")) { | |
2637 parameterServerCount = _json["parameterServerCount"]; | |
2638 } | |
2639 if (_json.containsKey("parameterServerType")) { | |
2640 parameterServerType = _json["parameterServerType"]; | |
2641 } | |
2642 if (_json.containsKey("pythonModule")) { | |
2643 pythonModule = _json["pythonModule"]; | |
2644 } | |
2645 if (_json.containsKey("region")) { | |
2646 region = _json["region"]; | |
2647 } | |
2648 if (_json.containsKey("runtimeVersion")) { | |
2649 runtimeVersion = _json["runtimeVersion"]; | |
2650 } | |
2651 if (_json.containsKey("scaleTier")) { | |
2652 scaleTier = _json["scaleTier"]; | |
2653 } | |
2654 if (_json.containsKey("workerCount")) { | |
2655 workerCount = _json["workerCount"]; | |
2656 } | |
2657 if (_json.containsKey("workerType")) { | |
2658 workerType = _json["workerType"]; | |
2659 } | |
2660 } | |
2661 | |
2662 core.Map toJson() { | |
2663 var _json = new core.Map(); | |
2664 if (args != null) { | |
2665 _json["args"] = args; | |
2666 } | |
2667 if (hyperparameters != null) { | |
2668 _json["hyperparameters"] = (hyperparameters).toJson(); | |
2669 } | |
2670 if (jobDir != null) { | |
2671 _json["jobDir"] = jobDir; | |
2672 } | |
2673 if (masterType != null) { | |
2674 _json["masterType"] = masterType; | |
2675 } | |
2676 if (packageUris != null) { | |
2677 _json["packageUris"] = packageUris; | |
2678 } | |
2679 if (parameterServerCount != null) { | |
2680 _json["parameterServerCount"] = parameterServerCount; | |
2681 } | |
2682 if (parameterServerType != null) { | |
2683 _json["parameterServerType"] = parameterServerType; | |
2684 } | |
2685 if (pythonModule != null) { | |
2686 _json["pythonModule"] = pythonModule; | |
2687 } | |
2688 if (region != null) { | |
2689 _json["region"] = region; | |
2690 } | |
2691 if (runtimeVersion != null) { | |
2692 _json["runtimeVersion"] = runtimeVersion; | |
2693 } | |
2694 if (scaleTier != null) { | |
2695 _json["scaleTier"] = scaleTier; | |
2696 } | |
2697 if (workerCount != null) { | |
2698 _json["workerCount"] = workerCount; | |
2699 } | |
2700 if (workerType != null) { | |
2701 _json["workerType"] = workerType; | |
2702 } | |
2703 return _json; | |
2704 } | |
2705 } | |
2706 | |
2707 /** Represents results of a training job. Output only. */ | |
2708 class GoogleCloudMlV1beta1TrainingOutput { | |
2709 /** | |
2710 * The number of hyperparameter tuning trials that completed successfully. | |
2711 * Only set for hyperparameter tuning jobs. | |
2712 */ | |
2713 core.String completedTrialCount; | |
2714 /** The amount of ML units consumed by the job. */ | |
2715 core.double consumedMLUnits; | |
2716 /** Whether this job is a hyperparameter tuning job. */ | |
2717 core.bool isHyperparameterTuningJob; | |
2718 /** | |
2719 * Results for individual Hyperparameter trials. | |
2720 * Only set for hyperparameter tuning jobs. | |
2721 */ | |
2722 core.List<GoogleCloudMlV1beta1HyperparameterOutput> trials; | |
2723 | |
2724 GoogleCloudMlV1beta1TrainingOutput(); | |
2725 | |
2726 GoogleCloudMlV1beta1TrainingOutput.fromJson(core.Map _json) { | |
2727 if (_json.containsKey("completedTrialCount")) { | |
2728 completedTrialCount = _json["completedTrialCount"]; | |
2729 } | |
2730 if (_json.containsKey("consumedMLUnits")) { | |
2731 consumedMLUnits = _json["consumedMLUnits"]; | |
2732 } | |
2733 if (_json.containsKey("isHyperparameterTuningJob")) { | |
2734 isHyperparameterTuningJob = _json["isHyperparameterTuningJob"]; | |
2735 } | |
2736 if (_json.containsKey("trials")) { | |
2737 trials = _json["trials"].map((value) => new GoogleCloudMlV1beta1Hyperparam
eterOutput.fromJson(value)).toList(); | |
2738 } | |
2739 } | |
2740 | |
2741 core.Map toJson() { | |
2742 var _json = new core.Map(); | |
2743 if (completedTrialCount != null) { | |
2744 _json["completedTrialCount"] = completedTrialCount; | |
2745 } | |
2746 if (consumedMLUnits != null) { | |
2747 _json["consumedMLUnits"] = consumedMLUnits; | |
2748 } | |
2749 if (isHyperparameterTuningJob != null) { | |
2750 _json["isHyperparameterTuningJob"] = isHyperparameterTuningJob; | |
2751 } | |
2752 if (trials != null) { | |
2753 _json["trials"] = trials.map((value) => (value).toJson()).toList(); | |
2754 } | |
2755 return _json; | |
2756 } | |
2757 } | |
2758 | |
2759 /** | |
2760 * Represents a version of the model. | |
2761 * | |
2762 * Each version is a trained model deployed in the cloud, ready to handle | |
2763 * prediction requests. A model can have multiple versions. You can get | |
2764 * information about all of the versions of a given model by calling | |
2765 * [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.ve
rsions/list). | |
2766 */ | |
2767 class GoogleCloudMlV1beta1Version { | |
2768 /** Output only. The time the version was created. */ | |
2769 core.String createTime; | |
2770 /** | |
2771 * Required. The Google Cloud Storage location of the trained model used to | |
2772 * create the version. See the | |
2773 * [overview of model deployment](/ml/docs/concepts/deployment-overview) for | |
2774 * more informaiton. | |
2775 * | |
2776 * When passing Version to | |
2777 * [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.model
s.versions/create) | |
2778 * the model service uses the specified location as the source of the model. | |
2779 * Once deployed, the model version is hosted by the prediction service, so | |
2780 * this location is useful only as a historical record. | |
2781 */ | |
2782 core.String deploymentUri; | |
2783 /** | |
2784 * Optional. The description specified for the version when it was created. | |
2785 */ | |
2786 core.String description; | |
2787 /** | |
2788 * Output only. If true, this version will be used to handle prediction | |
2789 * requests that do not specify a version. | |
2790 * | |
2791 * You can change the default version by calling | |
2792 * [projects.methods.versions.setDefault](/ml/reference/rest/v1beta1/projects.
models.versions/setDefault). | |
2793 */ | |
2794 core.bool isDefault; | |
2795 /** Output only. The time the version was last used for prediction. */ | |
2796 core.String lastUseTime; | |
2797 /** | |
2798 * Optional. Manually select the number of nodes to use for serving the | |
2799 * model. If unset (i.e., by default), the number of nodes used to serve | |
2800 * the model automatically scales with traffic. However, care should be | |
2801 * taken to ramp up traffic according to the model's ability to scale. If | |
2802 * your model needs to handle bursts of traffic beyond it's ability to | |
2803 * scale, it is recommended you set this field appropriately. | |
2804 */ | |
2805 GoogleCloudMlV1beta1ManualScaling manualScaling; | |
2806 /** | |
2807 * Required.The name specified for the version when it was created. | |
2808 * | |
2809 * The version name must be unique within the model it is created in. | |
2810 */ | |
2811 core.String name; | |
2812 /** | |
2813 * Optional. The Google Cloud ML runtime version to use for this deployment. | |
2814 * If not set, Google Cloud ML will choose a version. | |
2815 */ | |
2816 core.String runtimeVersion; | |
2817 | |
2818 GoogleCloudMlV1beta1Version(); | |
2819 | |
2820 GoogleCloudMlV1beta1Version.fromJson(core.Map _json) { | |
2821 if (_json.containsKey("createTime")) { | |
2822 createTime = _json["createTime"]; | |
2823 } | |
2824 if (_json.containsKey("deploymentUri")) { | |
2825 deploymentUri = _json["deploymentUri"]; | |
2826 } | |
2827 if (_json.containsKey("description")) { | |
2828 description = _json["description"]; | |
2829 } | |
2830 if (_json.containsKey("isDefault")) { | |
2831 isDefault = _json["isDefault"]; | |
2832 } | |
2833 if (_json.containsKey("lastUseTime")) { | |
2834 lastUseTime = _json["lastUseTime"]; | |
2835 } | |
2836 if (_json.containsKey("manualScaling")) { | |
2837 manualScaling = new GoogleCloudMlV1beta1ManualScaling.fromJson(_json["manu
alScaling"]); | |
2838 } | |
2839 if (_json.containsKey("name")) { | |
2840 name = _json["name"]; | |
2841 } | |
2842 if (_json.containsKey("runtimeVersion")) { | |
2843 runtimeVersion = _json["runtimeVersion"]; | |
2844 } | |
2845 } | |
2846 | |
2847 core.Map toJson() { | |
2848 var _json = new core.Map(); | |
2849 if (createTime != null) { | |
2850 _json["createTime"] = createTime; | |
2851 } | |
2852 if (deploymentUri != null) { | |
2853 _json["deploymentUri"] = deploymentUri; | |
2854 } | |
2855 if (description != null) { | |
2856 _json["description"] = description; | |
2857 } | |
2858 if (isDefault != null) { | |
2859 _json["isDefault"] = isDefault; | |
2860 } | |
2861 if (lastUseTime != null) { | |
2862 _json["lastUseTime"] = lastUseTime; | |
2863 } | |
2864 if (manualScaling != null) { | |
2865 _json["manualScaling"] = (manualScaling).toJson(); | |
2866 } | |
2867 if (name != null) { | |
2868 _json["name"] = name; | |
2869 } | |
2870 if (runtimeVersion != null) { | |
2871 _json["runtimeVersion"] = runtimeVersion; | |
2872 } | |
2873 return _json; | |
2874 } | |
2875 } | |
2876 | |
2877 /** The response message for Operations.ListOperations. */ | |
2878 class GoogleLongrunningListOperationsResponse { | |
2879 /** The standard List next-page token. */ | |
2880 core.String nextPageToken; | |
2881 /** A list of operations that matches the specified filter in the request. */ | |
2882 core.List<GoogleLongrunningOperation> operations; | |
2883 | |
2884 GoogleLongrunningListOperationsResponse(); | |
2885 | |
2886 GoogleLongrunningListOperationsResponse.fromJson(core.Map _json) { | |
2887 if (_json.containsKey("nextPageToken")) { | |
2888 nextPageToken = _json["nextPageToken"]; | |
2889 } | |
2890 if (_json.containsKey("operations")) { | |
2891 operations = _json["operations"].map((value) => new GoogleLongrunningOpera
tion.fromJson(value)).toList(); | |
2892 } | |
2893 } | |
2894 | |
2895 core.Map toJson() { | |
2896 var _json = new core.Map(); | |
2897 if (nextPageToken != null) { | |
2898 _json["nextPageToken"] = nextPageToken; | |
2899 } | |
2900 if (operations != null) { | |
2901 _json["operations"] = operations.map((value) => (value).toJson()).toList()
; | |
2902 } | |
2903 return _json; | |
2904 } | |
2905 } | |
2906 | |
2907 /** | |
2908 * This resource represents a long-running operation that is the result of a | |
2909 * network API call. | |
2910 */ | |
2911 class GoogleLongrunningOperation { | |
2912 /** | |
2913 * If the value is `false`, it means the operation is still in progress. | |
2914 * If true, the operation is completed, and either `error` or `response` is | |
2915 * available. | |
2916 */ | |
2917 core.bool done; | |
2918 /** The error result of the operation in case of failure or cancellation. */ | |
2919 GoogleRpcStatus error; | |
2920 /** | |
2921 * Service-specific metadata associated with the operation. It typically | |
2922 * contains progress information and common metadata such as create time. | |
2923 * Some services might not provide such metadata. Any method that returns a | |
2924 * long-running operation should document the metadata type, if any. | |
2925 * | |
2926 * The values for Object must be JSON objects. It can consist of `num`, | |
2927 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
2928 */ | |
2929 core.Map<core.String, core.Object> metadata; | |
2930 /** | |
2931 * The server-assigned name, which is only unique within the same service that | |
2932 * originally returns it. If you use the default HTTP mapping, the | |
2933 * `name` should have the format of `operations/some/unique/name`. | |
2934 */ | |
2935 core.String name; | |
2936 /** | |
2937 * The normal response of the operation in case of success. If the original | |
2938 * method returns no data on success, such as `Delete`, the response is | |
2939 * `google.protobuf.Empty`. If the original method is standard | |
2940 * `Get`/`Create`/`Update`, the response should be the resource. For other | |
2941 * methods, the response should have the type `XxxResponse`, where `Xxx` | |
2942 * is the original method name. For example, if the original method name | |
2943 * is `TakeSnapshot()`, the inferred response type is | |
2944 * `TakeSnapshotResponse`. | |
2945 * | |
2946 * The values for Object must be JSON objects. It can consist of `num`, | |
2947 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
2948 */ | |
2949 core.Map<core.String, core.Object> response; | |
2950 | |
2951 GoogleLongrunningOperation(); | |
2952 | |
2953 GoogleLongrunningOperation.fromJson(core.Map _json) { | |
2954 if (_json.containsKey("done")) { | |
2955 done = _json["done"]; | |
2956 } | |
2957 if (_json.containsKey("error")) { | |
2958 error = new GoogleRpcStatus.fromJson(_json["error"]); | |
2959 } | |
2960 if (_json.containsKey("metadata")) { | |
2961 metadata = _json["metadata"]; | |
2962 } | |
2963 if (_json.containsKey("name")) { | |
2964 name = _json["name"]; | |
2965 } | |
2966 if (_json.containsKey("response")) { | |
2967 response = _json["response"]; | |
2968 } | |
2969 } | |
2970 | |
2971 core.Map toJson() { | |
2972 var _json = new core.Map(); | |
2973 if (done != null) { | |
2974 _json["done"] = done; | |
2975 } | |
2976 if (error != null) { | |
2977 _json["error"] = (error).toJson(); | |
2978 } | |
2979 if (metadata != null) { | |
2980 _json["metadata"] = metadata; | |
2981 } | |
2982 if (name != null) { | |
2983 _json["name"] = name; | |
2984 } | |
2985 if (response != null) { | |
2986 _json["response"] = response; | |
2987 } | |
2988 return _json; | |
2989 } | |
2990 } | |
2991 | |
2992 /** | |
2993 * A generic empty message that you can re-use to avoid defining duplicated | |
2994 * empty messages in your APIs. A typical example is to use it as the request | |
2995 * or the response type of an API method. For instance: | |
2996 * | |
2997 * service Foo { | |
2998 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | |
2999 * } | |
3000 * | |
3001 * The JSON representation for `Empty` is empty JSON object `{}`. | |
3002 */ | |
3003 class GoogleProtobufEmpty { | |
3004 | |
3005 GoogleProtobufEmpty(); | |
3006 | |
3007 GoogleProtobufEmpty.fromJson(core.Map _json) { | |
3008 } | |
3009 | |
3010 core.Map toJson() { | |
3011 var _json = new core.Map(); | |
3012 return _json; | |
3013 } | |
3014 } | |
3015 | |
3016 /** | |
3017 * The `Status` type defines a logical error model that is suitable for | |
3018 * different | |
3019 * programming environments, including REST APIs and RPC APIs. It is used by | |
3020 * [gRPC](https://github.com/grpc). The error model is designed to be: | |
3021 * | |
3022 * - Simple to use and understand for most users | |
3023 * - Flexible enough to meet unexpected needs | |
3024 * | |
3025 * # Overview | |
3026 * | |
3027 * The `Status` message contains three pieces of data: error code, error | |
3028 * message, | |
3029 * and error details. The error code should be an enum value of | |
3030 * google.rpc.Code, but it may accept additional error codes if needed. The | |
3031 * error message should be a developer-facing English message that helps | |
3032 * developers *understand* and *resolve* the error. If a localized user-facing | |
3033 * error message is needed, put the localized message in the error details or | |
3034 * localize it in the client. The optional error details may contain arbitrary | |
3035 * information about the error. There is a predefined set of error detail types | |
3036 * in the package `google.rpc` which can be used for common error conditions. | |
3037 * | |
3038 * # Language mapping | |
3039 * | |
3040 * The `Status` message is the logical representation of the error model, but it | |
3041 * is not necessarily the actual wire format. When the `Status` message is | |
3042 * exposed in different client libraries and different wire protocols, it can be | |
3043 * mapped differently. For example, it will likely be mapped to some exceptions | |
3044 * in Java, but more likely mapped to some error codes in C. | |
3045 * | |
3046 * # Other uses | |
3047 * | |
3048 * The error model and the `Status` message can be used in a variety of | |
3049 * environments, either with or without APIs, to provide a | |
3050 * consistent developer experience across different environments. | |
3051 * | |
3052 * Example uses of this error model include: | |
3053 * | |
3054 * - Partial errors. If a service needs to return partial errors to the client, | |
3055 * it may embed the `Status` in the normal response to indicate the partial | |
3056 * errors. | |
3057 * | |
3058 * - Workflow errors. A typical workflow has multiple steps. Each step may | |
3059 * have a `Status` message for error reporting purpose. | |
3060 * | |
3061 * - Batch operations. If a client uses batch request and batch response, the | |
3062 * `Status` message should be used directly inside batch response, one for | |
3063 * each error sub-response. | |
3064 * | |
3065 * - Asynchronous operations. If an API call embeds asynchronous operation | |
3066 * results in its response, the status of those operations should be | |
3067 * represented directly using the `Status` message. | |
3068 * | |
3069 * - Logging. If some API errors are stored in logs, the message `Status` could | |
3070 * be used directly after any stripping needed for security/privacy reasons. | |
3071 */ | |
3072 class GoogleRpcStatus { | |
3073 /** The status code, which should be an enum value of google.rpc.Code. */ | |
3074 core.int code; | |
3075 /** | |
3076 * A list of messages that carry the error details. There will be a | |
3077 * common set of message types for APIs to use. | |
3078 * | |
3079 * The values for Object must be JSON objects. It can consist of `num`, | |
3080 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
3081 */ | |
3082 core.List<core.Map<core.String, core.Object>> details; | |
3083 /** | |
3084 * A developer-facing error message, which should be in English. Any | |
3085 * user-facing error message should be localized and sent in the | |
3086 * google.rpc.Status.details field, or localized by the client. | |
3087 */ | |
3088 core.String message; | |
3089 | |
3090 GoogleRpcStatus(); | |
3091 | |
3092 GoogleRpcStatus.fromJson(core.Map _json) { | |
3093 if (_json.containsKey("code")) { | |
3094 code = _json["code"]; | |
3095 } | |
3096 if (_json.containsKey("details")) { | |
3097 details = _json["details"]; | |
3098 } | |
3099 if (_json.containsKey("message")) { | |
3100 message = _json["message"]; | |
3101 } | |
3102 } | |
3103 | |
3104 core.Map toJson() { | |
3105 var _json = new core.Map(); | |
3106 if (code != null) { | |
3107 _json["code"] = code; | |
3108 } | |
3109 if (details != null) { | |
3110 _json["details"] = details; | |
3111 } | |
3112 if (message != null) { | |
3113 _json["message"] = message; | |
3114 } | |
3115 return _json; | |
3116 } | |
3117 } | |
OLD | NEW |