OLD | NEW |
| (Empty) |
1 // This is a generated file (see the discoveryapis_generator project). | |
2 | |
3 library googleapis.cloudbuild.v1; | |
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 cloudbuild/v1'; | |
16 | |
17 /** Builds container images in the cloud. */ | |
18 class CloudbuildApi { | |
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 OperationsResourceApi get operations => new OperationsResourceApi(_requester); | |
26 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | |
27 | |
28 CloudbuildApi(http.Client client, {core.String rootUrl: "https://cloudbuild.go
ogleapis.com/", core.String servicePath: ""}) : | |
29 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | |
30 } | |
31 | |
32 | |
33 class OperationsResourceApi { | |
34 final commons.ApiRequester _requester; | |
35 | |
36 OperationsResourceApi(commons.ApiRequester client) : | |
37 _requester = client; | |
38 | |
39 /** | |
40 * Gets the latest state of a long-running operation. Clients can use this | |
41 * method to poll the operation result at intervals as recommended by the API | |
42 * service. | |
43 * | |
44 * Request parameters: | |
45 * | |
46 * [name] - The name of the operation resource. | |
47 * Value must have pattern "^operations/.*$". | |
48 * | |
49 * Completes with a [Operation]. | |
50 * | |
51 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
52 * error. | |
53 * | |
54 * If the used [http.Client] completes with an error when making a REST call, | |
55 * this method will complete with the same error. | |
56 */ | |
57 async.Future<Operation> get(core.String name) { | |
58 var _url = null; | |
59 var _queryParams = new core.Map(); | |
60 var _uploadMedia = null; | |
61 var _uploadOptions = null; | |
62 var _downloadOptions = commons.DownloadOptions.Metadata; | |
63 var _body = null; | |
64 | |
65 if (name == null) { | |
66 throw new core.ArgumentError("Parameter name is required."); | |
67 } | |
68 | |
69 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
70 | |
71 var _response = _requester.request(_url, | |
72 "GET", | |
73 body: _body, | |
74 queryParams: _queryParams, | |
75 uploadOptions: _uploadOptions, | |
76 uploadMedia: _uploadMedia, | |
77 downloadOptions: _downloadOptions); | |
78 return _response.then((data) => new Operation.fromJson(data)); | |
79 } | |
80 | |
81 /** | |
82 * Lists operations that match the specified filter in the request. If the | |
83 * server doesn't support this method, it returns `UNIMPLEMENTED`. | |
84 * | |
85 * NOTE: the `name` binding below allows API services to override the binding | |
86 * to use different resource name schemes, such as `users / * /operations`. | |
87 * | |
88 * Request parameters: | |
89 * | |
90 * [name] - The name of the operation collection. | |
91 * Value must have pattern "^operations$". | |
92 * | |
93 * [pageSize] - The standard list page size. | |
94 * | |
95 * [filter] - The standard list filter. | |
96 * | |
97 * [pageToken] - The standard list page token. | |
98 * | |
99 * Completes with a [ListOperationsResponse]. | |
100 * | |
101 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
102 * error. | |
103 * | |
104 * If the used [http.Client] completes with an error when making a REST call, | |
105 * this method will complete with the same error. | |
106 */ | |
107 async.Future<ListOperationsResponse> list(core.String name, {core.int pageSize
, core.String filter, core.String pageToken}) { | |
108 var _url = null; | |
109 var _queryParams = new core.Map(); | |
110 var _uploadMedia = null; | |
111 var _uploadOptions = null; | |
112 var _downloadOptions = commons.DownloadOptions.Metadata; | |
113 var _body = null; | |
114 | |
115 if (name == null) { | |
116 throw new core.ArgumentError("Parameter name is required."); | |
117 } | |
118 if (pageSize != null) { | |
119 _queryParams["pageSize"] = ["${pageSize}"]; | |
120 } | |
121 if (filter != null) { | |
122 _queryParams["filter"] = [filter]; | |
123 } | |
124 if (pageToken != null) { | |
125 _queryParams["pageToken"] = [pageToken]; | |
126 } | |
127 | |
128 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
129 | |
130 var _response = _requester.request(_url, | |
131 "GET", | |
132 body: _body, | |
133 queryParams: _queryParams, | |
134 uploadOptions: _uploadOptions, | |
135 uploadMedia: _uploadMedia, | |
136 downloadOptions: _downloadOptions); | |
137 return _response.then((data) => new ListOperationsResponse.fromJson(data)); | |
138 } | |
139 | |
140 } | |
141 | |
142 | |
143 class ProjectsResourceApi { | |
144 final commons.ApiRequester _requester; | |
145 | |
146 ProjectsBuildsResourceApi get builds => new ProjectsBuildsResourceApi(_request
er); | |
147 | |
148 ProjectsResourceApi(commons.ApiRequester client) : | |
149 _requester = client; | |
150 } | |
151 | |
152 | |
153 class ProjectsBuildsResourceApi { | |
154 final commons.ApiRequester _requester; | |
155 | |
156 ProjectsBuildsResourceApi(commons.ApiRequester client) : | |
157 _requester = client; | |
158 | |
159 /** | |
160 * Cancels a requested build in progress. | |
161 * | |
162 * [request] - The metadata request object. | |
163 * | |
164 * Request parameters: | |
165 * | |
166 * [projectId] - ID of the project. | |
167 * | |
168 * [id] - ID of the build. | |
169 * | |
170 * Completes with a [Build]. | |
171 * | |
172 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
173 * error. | |
174 * | |
175 * If the used [http.Client] completes with an error when making a REST call, | |
176 * this method will complete with the same error. | |
177 */ | |
178 async.Future<Build> cancel(CancelBuildRequest request, core.String projectId,
core.String id) { | |
179 var _url = null; | |
180 var _queryParams = new core.Map(); | |
181 var _uploadMedia = null; | |
182 var _uploadOptions = null; | |
183 var _downloadOptions = commons.DownloadOptions.Metadata; | |
184 var _body = null; | |
185 | |
186 if (request != null) { | |
187 _body = convert.JSON.encode((request).toJson()); | |
188 } | |
189 if (projectId == null) { | |
190 throw new core.ArgumentError("Parameter projectId is required."); | |
191 } | |
192 if (id == null) { | |
193 throw new core.ArgumentError("Parameter id is required."); | |
194 } | |
195 | |
196 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/buil
ds/' + commons.Escaper.ecapeVariable('$id') + ':cancel'; | |
197 | |
198 var _response = _requester.request(_url, | |
199 "POST", | |
200 body: _body, | |
201 queryParams: _queryParams, | |
202 uploadOptions: _uploadOptions, | |
203 uploadMedia: _uploadMedia, | |
204 downloadOptions: _downloadOptions); | |
205 return _response.then((data) => new Build.fromJson(data)); | |
206 } | |
207 | |
208 /** | |
209 * Starts a build with the specified configuration. | |
210 * | |
211 * The long-running Operation returned by this method will include the ID of | |
212 * the build, which can be passed to GetBuild to determine its status (e.g., | |
213 * success or failure). | |
214 * | |
215 * [request] - The metadata request object. | |
216 * | |
217 * Request parameters: | |
218 * | |
219 * [projectId] - ID of the project. | |
220 * | |
221 * Completes with a [Operation]. | |
222 * | |
223 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
224 * error. | |
225 * | |
226 * If the used [http.Client] completes with an error when making a REST call, | |
227 * this method will complete with the same error. | |
228 */ | |
229 async.Future<Operation> create(Build request, core.String projectId) { | |
230 var _url = null; | |
231 var _queryParams = new core.Map(); | |
232 var _uploadMedia = null; | |
233 var _uploadOptions = null; | |
234 var _downloadOptions = commons.DownloadOptions.Metadata; | |
235 var _body = null; | |
236 | |
237 if (request != null) { | |
238 _body = convert.JSON.encode((request).toJson()); | |
239 } | |
240 if (projectId == null) { | |
241 throw new core.ArgumentError("Parameter projectId is required."); | |
242 } | |
243 | |
244 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/buil
ds'; | |
245 | |
246 var _response = _requester.request(_url, | |
247 "POST", | |
248 body: _body, | |
249 queryParams: _queryParams, | |
250 uploadOptions: _uploadOptions, | |
251 uploadMedia: _uploadMedia, | |
252 downloadOptions: _downloadOptions); | |
253 return _response.then((data) => new Operation.fromJson(data)); | |
254 } | |
255 | |
256 /** | |
257 * Returns information about a previously requested build. | |
258 * | |
259 * The Build that is returned includes its status (e.g., success or failure, | |
260 * or in-progress), and timing information. | |
261 * | |
262 * Request parameters: | |
263 * | |
264 * [projectId] - ID of the project. | |
265 * | |
266 * [id] - ID of the build. | |
267 * | |
268 * Completes with a [Build]. | |
269 * | |
270 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
271 * error. | |
272 * | |
273 * If the used [http.Client] completes with an error when making a REST call, | |
274 * this method will complete with the same error. | |
275 */ | |
276 async.Future<Build> get(core.String projectId, core.String id) { | |
277 var _url = null; | |
278 var _queryParams = new core.Map(); | |
279 var _uploadMedia = null; | |
280 var _uploadOptions = null; | |
281 var _downloadOptions = commons.DownloadOptions.Metadata; | |
282 var _body = null; | |
283 | |
284 if (projectId == null) { | |
285 throw new core.ArgumentError("Parameter projectId is required."); | |
286 } | |
287 if (id == null) { | |
288 throw new core.ArgumentError("Parameter id is required."); | |
289 } | |
290 | |
291 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/buil
ds/' + commons.Escaper.ecapeVariable('$id'); | |
292 | |
293 var _response = _requester.request(_url, | |
294 "GET", | |
295 body: _body, | |
296 queryParams: _queryParams, | |
297 uploadOptions: _uploadOptions, | |
298 uploadMedia: _uploadMedia, | |
299 downloadOptions: _downloadOptions); | |
300 return _response.then((data) => new Build.fromJson(data)); | |
301 } | |
302 | |
303 /** | |
304 * Lists previously requested builds. | |
305 * | |
306 * Previously requested builds may still be in-progress, or may have finished | |
307 * successfully or unsuccessfully. | |
308 * | |
309 * Request parameters: | |
310 * | |
311 * [projectId] - ID of the project. | |
312 * | |
313 * [pageSize] - Number of results to return in the list. | |
314 * | |
315 * [pageToken] - Token to provide to skip to a particular spot in the list. | |
316 * | |
317 * Completes with a [ListBuildsResponse]. | |
318 * | |
319 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
320 * error. | |
321 * | |
322 * If the used [http.Client] completes with an error when making a REST call, | |
323 * this method will complete with the same error. | |
324 */ | |
325 async.Future<ListBuildsResponse> list(core.String projectId, {core.int pageSiz
e, core.String pageToken}) { | |
326 var _url = null; | |
327 var _queryParams = new core.Map(); | |
328 var _uploadMedia = null; | |
329 var _uploadOptions = null; | |
330 var _downloadOptions = commons.DownloadOptions.Metadata; | |
331 var _body = null; | |
332 | |
333 if (projectId == null) { | |
334 throw new core.ArgumentError("Parameter projectId is required."); | |
335 } | |
336 if (pageSize != null) { | |
337 _queryParams["pageSize"] = ["${pageSize}"]; | |
338 } | |
339 if (pageToken != null) { | |
340 _queryParams["pageToken"] = [pageToken]; | |
341 } | |
342 | |
343 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/buil
ds'; | |
344 | |
345 var _response = _requester.request(_url, | |
346 "GET", | |
347 body: _body, | |
348 queryParams: _queryParams, | |
349 uploadOptions: _uploadOptions, | |
350 uploadMedia: _uploadMedia, | |
351 downloadOptions: _downloadOptions); | |
352 return _response.then((data) => new ListBuildsResponse.fromJson(data)); | |
353 } | |
354 | |
355 } | |
356 | |
357 | |
358 | |
359 /** | |
360 * A build resource in the Container Builder API. | |
361 * | |
362 * At a high level, a Build describes where to find source code, how to build | |
363 * it (for example, the builder image to run on the source), and what tag to | |
364 * apply to the built image when it is pushed to Google Container Registry. | |
365 */ | |
366 class Build { | |
367 /** | |
368 * Time at which the build was created. | |
369 * @OutputOnly | |
370 */ | |
371 core.String createTime; | |
372 /** | |
373 * Time at which execution of the build was finished. | |
374 * @OutputOnly | |
375 */ | |
376 core.String finishTime; | |
377 /** | |
378 * Unique identifier of the build. | |
379 * @OutputOnly | |
380 */ | |
381 core.String id; | |
382 /** | |
383 * List of images expected to be built and pushed to Google Container | |
384 * Registry. If an image is listed here and the image is not produced by | |
385 * one of the build steps, the build will fail. Any images present when | |
386 * the build steps are complete will be pushed to Container Registry. | |
387 */ | |
388 core.List<core.String> images; | |
389 /** | |
390 * Google Cloud Storage bucket where logs should be written (see | |
391 * [Bucket Name | |
392 * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requireme
nts)). | |
393 * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. | |
394 */ | |
395 core.String logsBucket; | |
396 /** | |
397 * ID of the project. | |
398 * @OutputOnly. | |
399 */ | |
400 core.String projectId; | |
401 /** | |
402 * Results of the build. | |
403 * @OutputOnly | |
404 */ | |
405 Results results; | |
406 /** Describes where to find the source files to build. */ | |
407 Source source; | |
408 /** | |
409 * Time at which execution of the build was started. | |
410 * @OutputOnly | |
411 */ | |
412 core.String startTime; | |
413 /** | |
414 * Status of the build. | |
415 * @OutputOnly | |
416 * Possible string values are: | |
417 * - "STATUS_UNKNOWN" : Status of the build is unknown. | |
418 * - "QUEUED" : Build is queued, work has not yet begun. | |
419 * - "WORKING" : Build is being executed. | |
420 * - "SUCCESS" : Build finished successfully. | |
421 * - "FAILURE" : Build failed to complete successfully. | |
422 * - "INTERNAL_ERROR" : Build failed due to an internal cause. | |
423 * - "TIMEOUT" : Build took longer than was allowed. | |
424 * - "CANCELLED" : Build was canceled by a user. | |
425 */ | |
426 core.String status; | |
427 /** | |
428 * Customer-readable message about the current status. | |
429 * @OutputOnly | |
430 */ | |
431 core.String statusDetail; | |
432 /** Describes the operations to be performed on the workspace. */ | |
433 core.List<BuildStep> steps; | |
434 /** | |
435 * Amount of time that this build should be allowed to run, to second | |
436 * granularity. If this amount of time elapses, work on the build will cease | |
437 * and the build status will be TIMEOUT. | |
438 * | |
439 * Default time is ten minutes. | |
440 */ | |
441 core.String timeout; | |
442 | |
443 Build(); | |
444 | |
445 Build.fromJson(core.Map _json) { | |
446 if (_json.containsKey("createTime")) { | |
447 createTime = _json["createTime"]; | |
448 } | |
449 if (_json.containsKey("finishTime")) { | |
450 finishTime = _json["finishTime"]; | |
451 } | |
452 if (_json.containsKey("id")) { | |
453 id = _json["id"]; | |
454 } | |
455 if (_json.containsKey("images")) { | |
456 images = _json["images"]; | |
457 } | |
458 if (_json.containsKey("logsBucket")) { | |
459 logsBucket = _json["logsBucket"]; | |
460 } | |
461 if (_json.containsKey("projectId")) { | |
462 projectId = _json["projectId"]; | |
463 } | |
464 if (_json.containsKey("results")) { | |
465 results = new Results.fromJson(_json["results"]); | |
466 } | |
467 if (_json.containsKey("source")) { | |
468 source = new Source.fromJson(_json["source"]); | |
469 } | |
470 if (_json.containsKey("startTime")) { | |
471 startTime = _json["startTime"]; | |
472 } | |
473 if (_json.containsKey("status")) { | |
474 status = _json["status"]; | |
475 } | |
476 if (_json.containsKey("statusDetail")) { | |
477 statusDetail = _json["statusDetail"]; | |
478 } | |
479 if (_json.containsKey("steps")) { | |
480 steps = _json["steps"].map((value) => new BuildStep.fromJson(value)).toLis
t(); | |
481 } | |
482 if (_json.containsKey("timeout")) { | |
483 timeout = _json["timeout"]; | |
484 } | |
485 } | |
486 | |
487 core.Map toJson() { | |
488 var _json = new core.Map(); | |
489 if (createTime != null) { | |
490 _json["createTime"] = createTime; | |
491 } | |
492 if (finishTime != null) { | |
493 _json["finishTime"] = finishTime; | |
494 } | |
495 if (id != null) { | |
496 _json["id"] = id; | |
497 } | |
498 if (images != null) { | |
499 _json["images"] = images; | |
500 } | |
501 if (logsBucket != null) { | |
502 _json["logsBucket"] = logsBucket; | |
503 } | |
504 if (projectId != null) { | |
505 _json["projectId"] = projectId; | |
506 } | |
507 if (results != null) { | |
508 _json["results"] = (results).toJson(); | |
509 } | |
510 if (source != null) { | |
511 _json["source"] = (source).toJson(); | |
512 } | |
513 if (startTime != null) { | |
514 _json["startTime"] = startTime; | |
515 } | |
516 if (status != null) { | |
517 _json["status"] = status; | |
518 } | |
519 if (statusDetail != null) { | |
520 _json["statusDetail"] = statusDetail; | |
521 } | |
522 if (steps != null) { | |
523 _json["steps"] = steps.map((value) => (value).toJson()).toList(); | |
524 } | |
525 if (timeout != null) { | |
526 _json["timeout"] = timeout; | |
527 } | |
528 return _json; | |
529 } | |
530 } | |
531 | |
532 /** Metadata for build operations. */ | |
533 class BuildOperationMetadata { | |
534 /** The build that the operation is tracking. */ | |
535 Build build; | |
536 | |
537 BuildOperationMetadata(); | |
538 | |
539 BuildOperationMetadata.fromJson(core.Map _json) { | |
540 if (_json.containsKey("build")) { | |
541 build = new Build.fromJson(_json["build"]); | |
542 } | |
543 } | |
544 | |
545 core.Map toJson() { | |
546 var _json = new core.Map(); | |
547 if (build != null) { | |
548 _json["build"] = (build).toJson(); | |
549 } | |
550 return _json; | |
551 } | |
552 } | |
553 | |
554 /** BuildStep describes a step to perform in the build pipeline. */ | |
555 class BuildStep { | |
556 /** Command-line arguments to use when running this step's container. */ | |
557 core.List<core.String> args; | |
558 /** | |
559 * Working directory (relative to project source root) to use when running | |
560 * this operation's container. | |
561 */ | |
562 core.String dir; | |
563 /** Additional environment variables to set for this step's container. */ | |
564 core.List<core.String> env; | |
565 /** | |
566 * Name of the container image to use for creating this stage in the | |
567 * pipeline, as presented to `docker pull`. | |
568 */ | |
569 core.String name; | |
570 | |
571 BuildStep(); | |
572 | |
573 BuildStep.fromJson(core.Map _json) { | |
574 if (_json.containsKey("args")) { | |
575 args = _json["args"]; | |
576 } | |
577 if (_json.containsKey("dir")) { | |
578 dir = _json["dir"]; | |
579 } | |
580 if (_json.containsKey("env")) { | |
581 env = _json["env"]; | |
582 } | |
583 if (_json.containsKey("name")) { | |
584 name = _json["name"]; | |
585 } | |
586 } | |
587 | |
588 core.Map toJson() { | |
589 var _json = new core.Map(); | |
590 if (args != null) { | |
591 _json["args"] = args; | |
592 } | |
593 if (dir != null) { | |
594 _json["dir"] = dir; | |
595 } | |
596 if (env != null) { | |
597 _json["env"] = env; | |
598 } | |
599 if (name != null) { | |
600 _json["name"] = name; | |
601 } | |
602 return _json; | |
603 } | |
604 } | |
605 | |
606 /** BuiltImage describes an image built by the pipeline. */ | |
607 class BuiltImage { | |
608 /** Docker Registry 2.0 digest. */ | |
609 core.String digest; | |
610 /** | |
611 * Name used to push the container image to Google Container Registry, as | |
612 * presented to `docker push`. | |
613 */ | |
614 core.String name; | |
615 | |
616 BuiltImage(); | |
617 | |
618 BuiltImage.fromJson(core.Map _json) { | |
619 if (_json.containsKey("digest")) { | |
620 digest = _json["digest"]; | |
621 } | |
622 if (_json.containsKey("name")) { | |
623 name = _json["name"]; | |
624 } | |
625 } | |
626 | |
627 core.Map toJson() { | |
628 var _json = new core.Map(); | |
629 if (digest != null) { | |
630 _json["digest"] = digest; | |
631 } | |
632 if (name != null) { | |
633 _json["name"] = name; | |
634 } | |
635 return _json; | |
636 } | |
637 } | |
638 | |
639 /** Request to cancel an ongoing build. */ | |
640 class CancelBuildRequest { | |
641 | |
642 CancelBuildRequest(); | |
643 | |
644 CancelBuildRequest.fromJson(core.Map _json) { | |
645 } | |
646 | |
647 core.Map toJson() { | |
648 var _json = new core.Map(); | |
649 return _json; | |
650 } | |
651 } | |
652 | |
653 /** Response including listed builds. */ | |
654 class ListBuildsResponse { | |
655 /** Builds will be sorted by create_time, descending. */ | |
656 core.List<Build> builds; | |
657 /** Token to receive the next page of results. */ | |
658 core.String nextPageToken; | |
659 | |
660 ListBuildsResponse(); | |
661 | |
662 ListBuildsResponse.fromJson(core.Map _json) { | |
663 if (_json.containsKey("builds")) { | |
664 builds = _json["builds"].map((value) => new Build.fromJson(value)).toList(
); | |
665 } | |
666 if (_json.containsKey("nextPageToken")) { | |
667 nextPageToken = _json["nextPageToken"]; | |
668 } | |
669 } | |
670 | |
671 core.Map toJson() { | |
672 var _json = new core.Map(); | |
673 if (builds != null) { | |
674 _json["builds"] = builds.map((value) => (value).toJson()).toList(); | |
675 } | |
676 if (nextPageToken != null) { | |
677 _json["nextPageToken"] = nextPageToken; | |
678 } | |
679 return _json; | |
680 } | |
681 } | |
682 | |
683 /** The response message for Operations.ListOperations. */ | |
684 class ListOperationsResponse { | |
685 /** The standard List next-page token. */ | |
686 core.String nextPageToken; | |
687 /** A list of operations that matches the specified filter in the request. */ | |
688 core.List<Operation> operations; | |
689 | |
690 ListOperationsResponse(); | |
691 | |
692 ListOperationsResponse.fromJson(core.Map _json) { | |
693 if (_json.containsKey("nextPageToken")) { | |
694 nextPageToken = _json["nextPageToken"]; | |
695 } | |
696 if (_json.containsKey("operations")) { | |
697 operations = _json["operations"].map((value) => new Operation.fromJson(val
ue)).toList(); | |
698 } | |
699 } | |
700 | |
701 core.Map toJson() { | |
702 var _json = new core.Map(); | |
703 if (nextPageToken != null) { | |
704 _json["nextPageToken"] = nextPageToken; | |
705 } | |
706 if (operations != null) { | |
707 _json["operations"] = operations.map((value) => (value).toJson()).toList()
; | |
708 } | |
709 return _json; | |
710 } | |
711 } | |
712 | |
713 /** | |
714 * This resource represents a long-running operation that is the result of a | |
715 * network API call. | |
716 */ | |
717 class Operation { | |
718 /** | |
719 * If the value is `false`, it means the operation is still in progress. | |
720 * If true, the operation is completed, and either `error` or `response` is | |
721 * available. | |
722 */ | |
723 core.bool done; | |
724 /** The error result of the operation in case of failure. */ | |
725 Status error; | |
726 /** | |
727 * Service-specific metadata associated with the operation. It typically | |
728 * contains progress information and common metadata such as create time. | |
729 * Some services might not provide such metadata. Any method that returns a | |
730 * long-running operation should document the metadata type, if any. | |
731 * | |
732 * The values for Object must be JSON objects. It can consist of `num`, | |
733 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
734 */ | |
735 core.Map<core.String, core.Object> metadata; | |
736 /** | |
737 * The server-assigned name, which is only unique within the same service that | |
738 * originally returns it. If you use the default HTTP mapping, the | |
739 * `name` should have the format of `operations/some/unique/name`. | |
740 */ | |
741 core.String name; | |
742 /** | |
743 * The normal response of the operation in case of success. If the original | |
744 * method returns no data on success, such as `Delete`, the response is | |
745 * `google.protobuf.Empty`. If the original method is standard | |
746 * `Get`/`Create`/`Update`, the response should be the resource. For other | |
747 * methods, the response should have the type `XxxResponse`, where `Xxx` | |
748 * is the original method name. For example, if the original method name | |
749 * is `TakeSnapshot()`, the inferred response type is | |
750 * `TakeSnapshotResponse`. | |
751 * | |
752 * The values for Object must be JSON objects. It can consist of `num`, | |
753 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
754 */ | |
755 core.Map<core.String, core.Object> response; | |
756 | |
757 Operation(); | |
758 | |
759 Operation.fromJson(core.Map _json) { | |
760 if (_json.containsKey("done")) { | |
761 done = _json["done"]; | |
762 } | |
763 if (_json.containsKey("error")) { | |
764 error = new Status.fromJson(_json["error"]); | |
765 } | |
766 if (_json.containsKey("metadata")) { | |
767 metadata = _json["metadata"]; | |
768 } | |
769 if (_json.containsKey("name")) { | |
770 name = _json["name"]; | |
771 } | |
772 if (_json.containsKey("response")) { | |
773 response = _json["response"]; | |
774 } | |
775 } | |
776 | |
777 core.Map toJson() { | |
778 var _json = new core.Map(); | |
779 if (done != null) { | |
780 _json["done"] = done; | |
781 } | |
782 if (error != null) { | |
783 _json["error"] = (error).toJson(); | |
784 } | |
785 if (metadata != null) { | |
786 _json["metadata"] = metadata; | |
787 } | |
788 if (name != null) { | |
789 _json["name"] = name; | |
790 } | |
791 if (response != null) { | |
792 _json["response"] = response; | |
793 } | |
794 return _json; | |
795 } | |
796 } | |
797 | |
798 /** Results describes the artifacts created by the build pipeline. */ | |
799 class Results { | |
800 /** Images that were built as a part of the build. */ | |
801 core.List<BuiltImage> images; | |
802 | |
803 Results(); | |
804 | |
805 Results.fromJson(core.Map _json) { | |
806 if (_json.containsKey("images")) { | |
807 images = _json["images"].map((value) => new BuiltImage.fromJson(value)).to
List(); | |
808 } | |
809 } | |
810 | |
811 core.Map toJson() { | |
812 var _json = new core.Map(); | |
813 if (images != null) { | |
814 _json["images"] = images.map((value) => (value).toJson()).toList(); | |
815 } | |
816 return _json; | |
817 } | |
818 } | |
819 | |
820 /** | |
821 * Source describes the location of the source in a supported storage | |
822 * service. | |
823 */ | |
824 class Source { | |
825 /** | |
826 * If provided, get the source from this location in in Google Cloud | |
827 * Storage. | |
828 */ | |
829 StorageSource storageSource; | |
830 | |
831 Source(); | |
832 | |
833 Source.fromJson(core.Map _json) { | |
834 if (_json.containsKey("storageSource")) { | |
835 storageSource = new StorageSource.fromJson(_json["storageSource"]); | |
836 } | |
837 } | |
838 | |
839 core.Map toJson() { | |
840 var _json = new core.Map(); | |
841 if (storageSource != null) { | |
842 _json["storageSource"] = (storageSource).toJson(); | |
843 } | |
844 return _json; | |
845 } | |
846 } | |
847 | |
848 /** | |
849 * The `Status` type defines a logical error model that is suitable for | |
850 * different | |
851 * programming environments, including REST APIs and RPC APIs. It is used by | |
852 * [gRPC](https://github.com/grpc). The error model is designed to be: | |
853 * | |
854 * - Simple to use and understand for most users | |
855 * - Flexible enough to meet unexpected needs | |
856 * | |
857 * # Overview | |
858 * | |
859 * The `Status` message contains three pieces of data: error code, error | |
860 * message, | |
861 * and error details. The error code should be an enum value of | |
862 * google.rpc.Code, but it may accept additional error codes if needed. The | |
863 * error message should be a developer-facing English message that helps | |
864 * developers *understand* and *resolve* the error. If a localized user-facing | |
865 * error message is needed, put the localized message in the error details or | |
866 * localize it in the client. The optional error details may contain arbitrary | |
867 * information about the error. There is a predefined set of error detail types | |
868 * in the package `google.rpc` which can be used for common error conditions. | |
869 * | |
870 * # Language mapping | |
871 * | |
872 * The `Status` message is the logical representation of the error model, but it | |
873 * is not necessarily the actual wire format. When the `Status` message is | |
874 * exposed in different client libraries and different wire protocols, it can be | |
875 * mapped differently. For example, it will likely be mapped to some exceptions | |
876 * in Java, but more likely mapped to some error codes in C. | |
877 * | |
878 * # Other uses | |
879 * | |
880 * The error model and the `Status` message can be used in a variety of | |
881 * environments, either with or without APIs, to provide a | |
882 * consistent developer experience across different environments. | |
883 * | |
884 * Example uses of this error model include: | |
885 * | |
886 * - Partial errors. If a service needs to return partial errors to the client, | |
887 * it may embed the `Status` in the normal response to indicate the partial | |
888 * errors. | |
889 * | |
890 * - Workflow errors. A typical workflow has multiple steps. Each step may | |
891 * have a `Status` message for error reporting purpose. | |
892 * | |
893 * - Batch operations. If a client uses batch request and batch response, the | |
894 * `Status` message should be used directly inside batch response, one for | |
895 * each error sub-response. | |
896 * | |
897 * - Asynchronous operations. If an API call embeds asynchronous operation | |
898 * results in its response, the status of those operations should be | |
899 * represented directly using the `Status` message. | |
900 * | |
901 * - Logging. If some API errors are stored in logs, the message `Status` could | |
902 * be used directly after any stripping needed for security/privacy reasons. | |
903 */ | |
904 class Status { | |
905 /** The status code, which should be an enum value of google.rpc.Code. */ | |
906 core.int code; | |
907 /** | |
908 * A list of messages that carry the error details. There will be a | |
909 * common set of message types for APIs to use. | |
910 * | |
911 * The values for Object must be JSON objects. It can consist of `num`, | |
912 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
913 */ | |
914 core.List<core.Map<core.String, core.Object>> details; | |
915 /** | |
916 * A developer-facing error message, which should be in English. Any | |
917 * user-facing error message should be localized and sent in the | |
918 * google.rpc.Status.details field, or localized by the client. | |
919 */ | |
920 core.String message; | |
921 | |
922 Status(); | |
923 | |
924 Status.fromJson(core.Map _json) { | |
925 if (_json.containsKey("code")) { | |
926 code = _json["code"]; | |
927 } | |
928 if (_json.containsKey("details")) { | |
929 details = _json["details"]; | |
930 } | |
931 if (_json.containsKey("message")) { | |
932 message = _json["message"]; | |
933 } | |
934 } | |
935 | |
936 core.Map toJson() { | |
937 var _json = new core.Map(); | |
938 if (code != null) { | |
939 _json["code"] = code; | |
940 } | |
941 if (details != null) { | |
942 _json["details"] = details; | |
943 } | |
944 if (message != null) { | |
945 _json["message"] = message; | |
946 } | |
947 return _json; | |
948 } | |
949 } | |
950 | |
951 /** | |
952 * StorageSource describes the location of the source in an archive file in | |
953 * Google Cloud Storage. | |
954 */ | |
955 class StorageSource { | |
956 /** | |
957 * Google Cloud Storage bucket containing source (see | |
958 * [Bucket Name | |
959 * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requireme
nts)). | |
960 */ | |
961 core.String bucket; | |
962 /** | |
963 * Google Cloud Storage generation for the object. If the generation is | |
964 * omitted, the latest generation will be used. | |
965 */ | |
966 core.String generation; | |
967 /** | |
968 * Google Cloud Storage object containing source. | |
969 * | |
970 * This object must be a gzipped archive file (.tar.gz) containing source to | |
971 * build. | |
972 */ | |
973 core.String object; | |
974 | |
975 StorageSource(); | |
976 | |
977 StorageSource.fromJson(core.Map _json) { | |
978 if (_json.containsKey("bucket")) { | |
979 bucket = _json["bucket"]; | |
980 } | |
981 if (_json.containsKey("generation")) { | |
982 generation = _json["generation"]; | |
983 } | |
984 if (_json.containsKey("object")) { | |
985 object = _json["object"]; | |
986 } | |
987 } | |
988 | |
989 core.Map toJson() { | |
990 var _json = new core.Map(); | |
991 if (bucket != null) { | |
992 _json["bucket"] = bucket; | |
993 } | |
994 if (generation != null) { | |
995 _json["generation"] = generation; | |
996 } | |
997 if (object != null) { | |
998 _json["object"] = object; | |
999 } | |
1000 return _json; | |
1001 } | |
1002 } | |
OLD | NEW |