OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.cloudbuild.v1; | 3 library googleapis.cloudbuild.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 26 matching lines...) Expand all Loading... |
37 _requester = client; | 37 _requester = client; |
38 | 38 |
39 /** | 39 /** |
40 * Gets the latest state of a long-running operation. Clients can use this | 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 | 41 * method to poll the operation result at intervals as recommended by the API |
42 * service. | 42 * service. |
43 * | 43 * |
44 * Request parameters: | 44 * Request parameters: |
45 * | 45 * |
46 * [name] - The name of the operation resource. | 46 * [name] - The name of the operation resource. |
47 * Value must have pattern "^operations/.*$". | 47 * Value must have pattern "^operations/.+$". |
48 * | 48 * |
49 * Completes with a [Operation]. | 49 * Completes with a [Operation]. |
50 * | 50 * |
51 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 51 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
52 * error. | 52 * error. |
53 * | 53 * |
54 * If the used [http.Client] completes with an error when making a REST call, | 54 * If the used [http.Client] completes with an error when making a REST call, |
55 * this method will complete with the same error. | 55 * this method will complete with the same error. |
56 */ | 56 */ |
57 async.Future<Operation> get(core.String name) { | 57 async.Future<Operation> get(core.String name) { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 * | 306 * |
307 * Previously requested builds may still be in-progress, or may have finished | 307 * Previously requested builds may still be in-progress, or may have finished |
308 * successfully or unsuccessfully. | 308 * successfully or unsuccessfully. |
309 * | 309 * |
310 * Request parameters: | 310 * Request parameters: |
311 * | 311 * |
312 * [projectId] - ID of the project. | 312 * [projectId] - ID of the project. |
313 * | 313 * |
314 * [pageSize] - Number of results to return in the list. | 314 * [pageSize] - Number of results to return in the list. |
315 * | 315 * |
| 316 * [filter] - The raw filter text to constrain the results. |
| 317 * |
316 * [pageToken] - Token to provide to skip to a particular spot in the list. | 318 * [pageToken] - Token to provide to skip to a particular spot in the list. |
317 * | 319 * |
318 * Completes with a [ListBuildsResponse]. | 320 * Completes with a [ListBuildsResponse]. |
319 * | 321 * |
320 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 322 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
321 * error. | 323 * error. |
322 * | 324 * |
323 * If the used [http.Client] completes with an error when making a REST call, | 325 * If the used [http.Client] completes with an error when making a REST call, |
324 * this method will complete with the same error. | 326 * this method will complete with the same error. |
325 */ | 327 */ |
326 async.Future<ListBuildsResponse> list(core.String projectId, {core.int pageSiz
e, core.String pageToken}) { | 328 async.Future<ListBuildsResponse> list(core.String projectId, {core.int pageSiz
e, core.String filter, core.String pageToken}) { |
327 var _url = null; | 329 var _url = null; |
328 var _queryParams = new core.Map(); | 330 var _queryParams = new core.Map(); |
329 var _uploadMedia = null; | 331 var _uploadMedia = null; |
330 var _uploadOptions = null; | 332 var _uploadOptions = null; |
331 var _downloadOptions = commons.DownloadOptions.Metadata; | 333 var _downloadOptions = commons.DownloadOptions.Metadata; |
332 var _body = null; | 334 var _body = null; |
333 | 335 |
334 if (projectId == null) { | 336 if (projectId == null) { |
335 throw new core.ArgumentError("Parameter projectId is required."); | 337 throw new core.ArgumentError("Parameter projectId is required."); |
336 } | 338 } |
337 if (pageSize != null) { | 339 if (pageSize != null) { |
338 _queryParams["pageSize"] = ["${pageSize}"]; | 340 _queryParams["pageSize"] = ["${pageSize}"]; |
339 } | 341 } |
| 342 if (filter != null) { |
| 343 _queryParams["filter"] = [filter]; |
| 344 } |
340 if (pageToken != null) { | 345 if (pageToken != null) { |
341 _queryParams["pageToken"] = [pageToken]; | 346 _queryParams["pageToken"] = [pageToken]; |
342 } | 347 } |
343 | 348 |
344 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/buil
ds'; | 349 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/buil
ds'; |
345 | 350 |
346 var _response = _requester.request(_url, | 351 var _response = _requester.request(_url, |
347 "GET", | 352 "GET", |
348 body: _body, | 353 body: _body, |
349 queryParams: _queryParams, | 354 queryParams: _queryParams, |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 } | 600 } |
596 | 601 |
597 | 602 |
598 | 603 |
599 /** | 604 /** |
600 * A build resource in the Container Builder API. | 605 * A build resource in the Container Builder API. |
601 * | 606 * |
602 * At a high level, a Build describes where to find source code, how to build | 607 * At a high level, a Build describes where to find source code, how to build |
603 * it (for example, the builder image to run on the source), and what tag to | 608 * it (for example, the builder image to run on the source), and what tag to |
604 * apply to the built image when it is pushed to Google Container Registry. | 609 * apply to the built image when it is pushed to Google Container Registry. |
| 610 * |
| 611 * Fields can include the following variables which will be expanded when the |
| 612 * build is created: |
| 613 * |
| 614 * - $PROJECT_ID: the project ID of the build. |
| 615 * - $BUILD_ID: the autogenerated ID of the build. |
| 616 * - $REPO_NAME: the source repository name specified by RepoSource. |
| 617 * - $BRANCH_NAME: the branch name specified by RepoSource. |
| 618 * - $TAG_NAME: the tag name specified by RepoSource. |
| 619 * - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or |
| 620 * resolved from the specified branch or tag. |
605 */ | 621 */ |
606 class Build { | 622 class Build { |
607 /** | 623 /** |
| 624 * The ID of the BuildTrigger that triggered this build, if it was |
| 625 * triggered automatically. |
| 626 * @OutputOnly |
| 627 */ |
| 628 core.String buildTriggerId; |
| 629 /** |
608 * Time at which the build was created. | 630 * Time at which the build was created. |
609 * @OutputOnly | 631 * @OutputOnly |
610 */ | 632 */ |
611 core.String createTime; | 633 core.String createTime; |
612 /** | 634 /** |
613 * Time at which execution of the build was finished. | 635 * Time at which execution of the build was finished. |
614 * @OutputOnly | 636 * @OutputOnly |
615 */ | 637 */ |
616 core.String finishTime; | 638 core.String finishTime; |
617 /** | 639 /** |
618 * Unique identifier of the build. | 640 * Unique identifier of the build. |
619 * @OutputOnly | 641 * @OutputOnly |
620 */ | 642 */ |
621 core.String id; | 643 core.String id; |
622 /** | 644 /** |
623 * List of images expected to be built and pushed to Google Container | 645 * A list of images to be pushed upon the successful completion of all build |
624 * Registry. If an image is listed here and the image is not produced by | 646 * steps. |
625 * one of the build steps, the build will fail. Any images present when | 647 * |
626 * the build steps are complete will be pushed to Container Registry. | 648 * The images will be pushed using the builder |
| 649 * service account's credentials. |
| 650 * |
| 651 * The digests of the pushed images will be stored in the Build resource's |
| 652 * results field. |
| 653 * |
| 654 * If any of the images fail to be pushed, the build is marked FAILURE. |
627 */ | 655 */ |
628 core.List<core.String> images; | 656 core.List<core.String> images; |
629 /** | 657 /** |
630 * URL to logs for this build in Google Cloud Logging. | 658 * URL to logs for this build in Google Cloud Logging. |
631 * @OutputOnly | 659 * @OutputOnly |
632 */ | 660 */ |
633 core.String logUrl; | 661 core.String logUrl; |
634 /** | 662 /** |
635 * Google Cloud Storage bucket where logs should be written (see | 663 * Google Cloud Storage bucket where logs should be written (see |
636 * [Bucket Name | 664 * [Bucket Name |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 * granularity. If this amount of time elapses, work on the build will cease | 717 * granularity. If this amount of time elapses, work on the build will cease |
690 * and the build status will be TIMEOUT. | 718 * and the build status will be TIMEOUT. |
691 * | 719 * |
692 * Default time is ten minutes. | 720 * Default time is ten minutes. |
693 */ | 721 */ |
694 core.String timeout; | 722 core.String timeout; |
695 | 723 |
696 Build(); | 724 Build(); |
697 | 725 |
698 Build.fromJson(core.Map _json) { | 726 Build.fromJson(core.Map _json) { |
| 727 if (_json.containsKey("buildTriggerId")) { |
| 728 buildTriggerId = _json["buildTriggerId"]; |
| 729 } |
699 if (_json.containsKey("createTime")) { | 730 if (_json.containsKey("createTime")) { |
700 createTime = _json["createTime"]; | 731 createTime = _json["createTime"]; |
701 } | 732 } |
702 if (_json.containsKey("finishTime")) { | 733 if (_json.containsKey("finishTime")) { |
703 finishTime = _json["finishTime"]; | 734 finishTime = _json["finishTime"]; |
704 } | 735 } |
705 if (_json.containsKey("id")) { | 736 if (_json.containsKey("id")) { |
706 id = _json["id"]; | 737 id = _json["id"]; |
707 } | 738 } |
708 if (_json.containsKey("images")) { | 739 if (_json.containsKey("images")) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 if (_json.containsKey("steps")) { | 772 if (_json.containsKey("steps")) { |
742 steps = _json["steps"].map((value) => new BuildStep.fromJson(value)).toLis
t(); | 773 steps = _json["steps"].map((value) => new BuildStep.fromJson(value)).toLis
t(); |
743 } | 774 } |
744 if (_json.containsKey("timeout")) { | 775 if (_json.containsKey("timeout")) { |
745 timeout = _json["timeout"]; | 776 timeout = _json["timeout"]; |
746 } | 777 } |
747 } | 778 } |
748 | 779 |
749 core.Map toJson() { | 780 core.Map toJson() { |
750 var _json = new core.Map(); | 781 var _json = new core.Map(); |
| 782 if (buildTriggerId != null) { |
| 783 _json["buildTriggerId"] = buildTriggerId; |
| 784 } |
751 if (createTime != null) { | 785 if (createTime != null) { |
752 _json["createTime"] = createTime; | 786 _json["createTime"] = createTime; |
753 } | 787 } |
754 if (finishTime != null) { | 788 if (finishTime != null) { |
755 _json["finishTime"] = finishTime; | 789 _json["finishTime"] = finishTime; |
756 } | 790 } |
757 if (id != null) { | 791 if (id != null) { |
758 _json["id"] = id; | 792 _json["id"] = id; |
759 } | 793 } |
760 if (images != null) { | 794 if (images != null) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 if (build != null) { | 852 if (build != null) { |
819 _json["build"] = (build).toJson(); | 853 _json["build"] = (build).toJson(); |
820 } | 854 } |
821 return _json; | 855 return _json; |
822 } | 856 } |
823 } | 857 } |
824 | 858 |
825 /** Optional arguments to enable specific features of builds. */ | 859 /** Optional arguments to enable specific features of builds. */ |
826 class BuildOptions { | 860 class BuildOptions { |
827 /** | 861 /** |
828 * Options for a verifiable build with details uploaded to the Analysis API. | 862 * Requested verifiability options. |
829 * Possible string values are: | 863 * Possible string values are: |
830 * - "NOT_VERIFIED" : Not a verifiable build. (default) | 864 * - "NOT_VERIFIED" : Not a verifiable build. (default) |
831 * - "VERIFIED" : Verified build. | 865 * - "VERIFIED" : Verified build. |
832 */ | 866 */ |
833 core.String requestedVerifyOption; | 867 core.String requestedVerifyOption; |
834 /** Requested hash for SourceProvenance. */ | 868 /** Requested hash for SourceProvenance. */ |
835 core.List<core.String> sourceProvenanceHash; | 869 core.List<core.String> sourceProvenanceHash; |
836 | 870 |
837 BuildOptions(); | 871 BuildOptions(); |
838 | 872 |
(...skipping 13 matching lines...) Expand all Loading... |
852 } | 886 } |
853 if (sourceProvenanceHash != null) { | 887 if (sourceProvenanceHash != null) { |
854 _json["sourceProvenanceHash"] = sourceProvenanceHash; | 888 _json["sourceProvenanceHash"] = sourceProvenanceHash; |
855 } | 889 } |
856 return _json; | 890 return _json; |
857 } | 891 } |
858 } | 892 } |
859 | 893 |
860 /** BuildStep describes a step to perform in the build pipeline. */ | 894 /** BuildStep describes a step to perform in the build pipeline. */ |
861 class BuildStep { | 895 class BuildStep { |
862 /** Command-line arguments to use when running this step's container. */ | 896 /** |
| 897 * A list of arguments that will be presented to the step when it is started. |
| 898 * |
| 899 * If the image used to run the step's container has an entrypoint, these args |
| 900 * will be used as arguments to that entrypoint. If the image does not define |
| 901 * an entrypoint, the first element in args will be used as the entrypoint, |
| 902 * and the remainder will be used as arguments. |
| 903 */ |
863 core.List<core.String> args; | 904 core.List<core.String> args; |
864 /** | 905 /** |
865 * Working directory (relative to project source root) to use when running | 906 * Working directory (relative to project source root) to use when running |
866 * this operation's container. | 907 * this operation's container. |
867 */ | 908 */ |
868 core.String dir; | 909 core.String dir; |
869 /** Additional environment variables to set for this step's container. */ | 910 /** |
| 911 * A list of environment variable definitions to be used when running a step. |
| 912 * |
| 913 * The elements are of the form "KEY=VALUE" for the environment variable "KEY" |
| 914 * being given the value "VALUE". |
| 915 */ |
870 core.List<core.String> env; | 916 core.List<core.String> env; |
871 /** | 917 /** |
872 * Optional unique identifier for this build step, used in wait_for to | 918 * Optional unique identifier for this build step, used in wait_for to |
873 * reference this build step as a dependency. | 919 * reference this build step as a dependency. |
874 */ | 920 */ |
875 core.String id; | 921 core.String id; |
876 /** | 922 /** |
877 * Name of the container image to use for creating this stage in the | 923 * The name of the container image that will run this particular build step. |
878 * pipeline, as presented to `docker pull`. | 924 * |
| 925 * If the image is already available in the host's |
| 926 * Docker daemon's cache, it will be run directly. If not, the host will |
| 927 * attempt to pull the image first, using the builder service account's |
| 928 * credentials if necessary. |
| 929 * |
| 930 * The Docker daemon's cache will already have the latest versions of all of |
| 931 * the officially supported build steps |
| 932 * (https://github.com/GoogleCloudPlatform/cloud-builders). The Docker daemon |
| 933 * will also have cached many of the layers for some popular images, like |
| 934 * "ubuntu", "debian", but they will be refreshed at the time you attempt to |
| 935 * use them. |
| 936 * |
| 937 * If you built an image in a previous build step, it will be stored in the |
| 938 * host's Docker daemon's cache and is available to use as the name for a |
| 939 * later build step. |
879 */ | 940 */ |
880 core.String name; | 941 core.String name; |
881 /** | 942 /** |
882 * The ID(s) of the step(s) that this build step depends on. | 943 * The ID(s) of the step(s) that this build step depends on. |
883 * This build step will not start until all the build steps in wait_for | 944 * This build step will not start until all the build steps in wait_for |
884 * have completed successfully. If wait_for is empty, this build step will | 945 * have completed successfully. If wait_for is empty, this build step will |
885 * start when all previous build steps in the Build.Steps list have completed | 946 * start when all previous build steps in the Build.Steps list have completed |
886 * successfully. | 947 * successfully. |
887 */ | 948 */ |
888 core.List<core.String> waitFor; | 949 core.List<core.String> waitFor; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 */ | 1001 */ |
941 class BuildTrigger { | 1002 class BuildTrigger { |
942 /** Contents of the build template. */ | 1003 /** Contents of the build template. */ |
943 Build build; | 1004 Build build; |
944 /** | 1005 /** |
945 * Time when the trigger was created. | 1006 * Time when the trigger was created. |
946 * | 1007 * |
947 * @OutputOnly | 1008 * @OutputOnly |
948 */ | 1009 */ |
949 core.String createTime; | 1010 core.String createTime; |
| 1011 /** Human-readable description of this trigger. */ |
| 1012 core.String description; |
| 1013 /** If true, the trigger will never result in a build. */ |
| 1014 core.bool disabled; |
950 /** | 1015 /** |
951 * Path, from the source root, to a file whose contents is used for the | 1016 * Path, from the source root, to a file whose contents is used for the |
952 * template. | 1017 * template. |
953 */ | 1018 */ |
954 core.String filename; | 1019 core.String filename; |
955 /** | 1020 /** |
956 * Unique identifier of the trigger. | 1021 * Unique identifier of the trigger. |
957 * | 1022 * |
958 * @OutputOnly | 1023 * @OutputOnly |
959 */ | 1024 */ |
960 core.String id; | 1025 core.String id; |
961 /** | 1026 /** |
962 * Template describing the types of source changes to trigger a build. | 1027 * Template describing the types of source changes to trigger a build. |
963 * | 1028 * |
964 * Branch and tag names in trigger templates are interpreted as regular | 1029 * Branch and tag names in trigger templates are interpreted as regular |
965 * expressions. Any branch or tag change that matches that regular expression | 1030 * expressions. Any branch or tag change that matches that regular expression |
966 * will trigger a build. | 1031 * will trigger a build. |
967 */ | 1032 */ |
968 RepoSource triggerTemplate; | 1033 RepoSource triggerTemplate; |
969 | 1034 |
970 BuildTrigger(); | 1035 BuildTrigger(); |
971 | 1036 |
972 BuildTrigger.fromJson(core.Map _json) { | 1037 BuildTrigger.fromJson(core.Map _json) { |
973 if (_json.containsKey("build")) { | 1038 if (_json.containsKey("build")) { |
974 build = new Build.fromJson(_json["build"]); | 1039 build = new Build.fromJson(_json["build"]); |
975 } | 1040 } |
976 if (_json.containsKey("createTime")) { | 1041 if (_json.containsKey("createTime")) { |
977 createTime = _json["createTime"]; | 1042 createTime = _json["createTime"]; |
978 } | 1043 } |
| 1044 if (_json.containsKey("description")) { |
| 1045 description = _json["description"]; |
| 1046 } |
| 1047 if (_json.containsKey("disabled")) { |
| 1048 disabled = _json["disabled"]; |
| 1049 } |
979 if (_json.containsKey("filename")) { | 1050 if (_json.containsKey("filename")) { |
980 filename = _json["filename"]; | 1051 filename = _json["filename"]; |
981 } | 1052 } |
982 if (_json.containsKey("id")) { | 1053 if (_json.containsKey("id")) { |
983 id = _json["id"]; | 1054 id = _json["id"]; |
984 } | 1055 } |
985 if (_json.containsKey("triggerTemplate")) { | 1056 if (_json.containsKey("triggerTemplate")) { |
986 triggerTemplate = new RepoSource.fromJson(_json["triggerTemplate"]); | 1057 triggerTemplate = new RepoSource.fromJson(_json["triggerTemplate"]); |
987 } | 1058 } |
988 } | 1059 } |
989 | 1060 |
990 core.Map toJson() { | 1061 core.Map toJson() { |
991 var _json = new core.Map(); | 1062 var _json = new core.Map(); |
992 if (build != null) { | 1063 if (build != null) { |
993 _json["build"] = (build).toJson(); | 1064 _json["build"] = (build).toJson(); |
994 } | 1065 } |
995 if (createTime != null) { | 1066 if (createTime != null) { |
996 _json["createTime"] = createTime; | 1067 _json["createTime"] = createTime; |
997 } | 1068 } |
| 1069 if (description != null) { |
| 1070 _json["description"] = description; |
| 1071 } |
| 1072 if (disabled != null) { |
| 1073 _json["disabled"] = disabled; |
| 1074 } |
998 if (filename != null) { | 1075 if (filename != null) { |
999 _json["filename"] = filename; | 1076 _json["filename"] = filename; |
1000 } | 1077 } |
1001 if (id != null) { | 1078 if (id != null) { |
1002 _json["id"] = id; | 1079 _json["id"] = id; |
1003 } | 1080 } |
1004 if (triggerTemplate != null) { | 1081 if (triggerTemplate != null) { |
1005 _json["triggerTemplate"] = (triggerTemplate).toJson(); | 1082 _json["triggerTemplate"] = (triggerTemplate).toJson(); |
1006 } | 1083 } |
1007 return _json; | 1084 return _json; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 * This resource represents a long-running operation that is the result of a | 1309 * This resource represents a long-running operation that is the result of a |
1233 * network API call. | 1310 * network API call. |
1234 */ | 1311 */ |
1235 class Operation { | 1312 class Operation { |
1236 /** | 1313 /** |
1237 * If the value is `false`, it means the operation is still in progress. | 1314 * If the value is `false`, it means the operation is still in progress. |
1238 * If true, the operation is completed, and either `error` or `response` is | 1315 * If true, the operation is completed, and either `error` or `response` is |
1239 * available. | 1316 * available. |
1240 */ | 1317 */ |
1241 core.bool done; | 1318 core.bool done; |
1242 /** The error result of the operation in case of failure. */ | 1319 /** The error result of the operation in case of failure or cancellation. */ |
1243 Status error; | 1320 Status error; |
1244 /** | 1321 /** |
1245 * Service-specific metadata associated with the operation. It typically | 1322 * Service-specific metadata associated with the operation. It typically |
1246 * contains progress information and common metadata such as create time. | 1323 * contains progress information and common metadata such as create time. |
1247 * Some services might not provide such metadata. Any method that returns a | 1324 * Some services might not provide such metadata. Any method that returns a |
1248 * long-running operation should document the metadata type, if any. | 1325 * long-running operation should document the metadata type, if any. |
1249 * | 1326 * |
1250 * The values for Object must be JSON objects. It can consist of `num`, | 1327 * The values for Object must be JSON objects. It can consist of `num`, |
1251 * `String`, `bool` and `null` as well as `Map` and `List` values. | 1328 * `String`, `bool` and `null` as well as `Map` and `List` values. |
1252 */ | 1329 */ |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 } | 1724 } |
1648 if (generation != null) { | 1725 if (generation != null) { |
1649 _json["generation"] = generation; | 1726 _json["generation"] = generation; |
1650 } | 1727 } |
1651 if (object != null) { | 1728 if (object != null) { |
1652 _json["object"] = object; | 1729 _json["object"] = object; |
1653 } | 1730 } |
1654 return _json; | 1731 return _json; |
1655 } | 1732 } |
1656 } | 1733 } |
OLD | NEW |