Skip to content

Commit cdb30b6

Browse files
Google APIscopybara-github
authored andcommitted
feat: added a new API method ListBuildTargets to list build targets that a user has access to
This API method does not require a input for the user account. It will fetch the current user account from the service account credential file automatically. PiperOrigin-RevId: 383511703
1 parent fe3cc5e commit cdb30b6

3 files changed

Lines changed: 36 additions & 6 deletions

File tree

google/chromeos/moblab/v1beta1/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ nodejs_gapic_assembly_pkg(
250250
# Ruby
251251
##############################################################################
252252
load(
253-
"@com_google_googleapis_imports//:imports.bzl",
253+
"@com_google_googleapis_imports//:imports.bzl",
254254
"ruby_cloud_gapic_library",
255255
"ruby_gapic_assembly_pkg",
256256
"ruby_grpc_library",

google/chromeos/moblab/v1beta1/build_service.proto

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ service BuildService {
3737
option (google.api.oauth_scopes) =
3838
"https://www.googleapis.com/auth/moblabapi";
3939

40+
// Lists all build targets that a user has access to.
41+
rpc ListBuildTargets(ListBuildTargetsRequest) returns (ListBuildTargetsResponse) {
42+
option (google.api.http) = {
43+
get: "/v1beta1/buildTargets"
44+
};
45+
}
46+
4047
// Lists all builds for the given build target and model in descending order
4148
// for the milestones and build versions.
4249
rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) {
@@ -73,6 +80,29 @@ service BuildService {
7380
}
7481
}
7582

83+
// Request message for listing build targets.
84+
message ListBuildTargetsRequest {
85+
// Optional. The number of build targets to return in a page.
86+
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
87+
88+
// Optional. A page token, received from a previous `ListBuildTargets` call. Provide
89+
// this to retrieve the subsequent page.
90+
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
91+
}
92+
93+
// Response message for listing build targets.
94+
message ListBuildTargetsResponse {
95+
// The list of build targets.
96+
repeated BuildTarget build_targets = 1;
97+
98+
// Token to retrieve the next page of builds. If this field is omitted, there
99+
// are no subsequent pages.
100+
string next_page_token = 2;
101+
102+
// Total number of build targets.
103+
int32 total_size = 3;
104+
}
105+
76106
// Request message for listing builds.
77107
message ListBuildsRequest {
78108
// Required. The full resource name of the model. The model id is the same as
@@ -94,14 +124,14 @@ message ListBuildsRequest {
94124
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
95125

96126
// Optional. Filter that specifies value constraints of fields. For example, the
97-
// filter can be set as `filter='milestone=milestones/80'` to only select
127+
// filter can be set as "filter='milestone=milestones/80'" to only select
98128
// builds in milestone 80.
99129
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
100130

101131
// Optional. Read mask that specifies which Build fields to return. If empty, all Build
102132
// fields will be returned.
103133
// Valid fields: name, milestone, build_version.
104-
// For example, if the read_mask is set as `read_mask='milestone'`, the
134+
// For example, if the read_mask is set as "read_mask='milestone'", the
105135
// ListBuilds will return a list of Builds object with only the milestone
106136
// field.
107137
google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL];
@@ -138,7 +168,7 @@ message CheckBuildStageStatusRequest {
138168
];
139169

140170
// Optional. Filter that specifies value constraints of fields. For example, the
141-
// filter can be set as `filter='type=release'` to only check the release
171+
// filter can be set as "filter='type=release'" to only check the release
142172
// builds.
143173
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
144174
}
@@ -168,7 +198,7 @@ message StageBuildRequest {
168198
];
169199

170200
// Optional. Filter that specifies value constraints of fields. For example, the
171-
// filter can be set as `filter='type=release'` to only check the release
201+
// filter can be set as "filter='type=release'" to only check the release
172202
// builds.
173203
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
174204
}

google/chromeos/moblab/v1beta1/resources.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ message Build {
6969
pattern: "buildTargets/{build_target}/models/{model}/builds/{build}"
7070
};
7171

72-
// The build status types.
72+
// The build status types.
7373
enum BuildStatus {
7474
// No build status is specified.
7575
BUILD_STATUS_UNSPECIFIED = 0;

0 commit comments

Comments
 (0)