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