1 // Copyright 2017 Google Inc.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
17 package google.devtools.sourcerepo.v1;
19 import "google/api/annotations.proto";
20 import "google/iam/v1/iam_policy.proto";
21 import "google/iam/v1/policy.proto";
22 import "google/protobuf/empty.proto";
24 option go_package = "google.golang.org/genproto/googleapis/devtools/sourcerepo/v1;sourcerepo";
25 option java_multiple_files = true;
26 option java_outer_classname = "SourceRepoProto";
27 option java_package = "com.google.devtools.sourcerepo.v1";
29 // The Source Repo API service.
31 // Returns all repos belonging to a project. The sizes of the repos are
32 // not set by ListRepos. To get the size of a repo, use GetRepo.
33 rpc ListRepos(ListReposRequest) returns (ListReposResponse) {
34 option (google.api.http) = {
35 get: "/v1/{name=projects/*}/repos"
39 // Returns information about a repo.
40 rpc GetRepo(GetRepoRequest) returns (Repo) {
41 option (google.api.http) = {
42 get: "/v1/{name=projects/*/repos/**}"
46 // Creates a repo in the given project with the given name.
48 // If the named repository already exists, `CreateRepo` returns
50 rpc CreateRepo(CreateRepoRequest) returns (Repo) {
51 option (google.api.http) = {
52 post: "/v1/{parent=projects/*}/repos"
58 rpc DeleteRepo(DeleteRepoRequest) returns (google.protobuf.Empty) {
59 option (google.api.http) = {
60 delete: "/v1/{name=projects/*/repos/**}"
64 // Sets the access control policy on the specified resource. Replaces any
66 rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
67 returns (google.iam.v1.Policy) {
68 option (google.api.http) = {
69 post: "/v1/{resource=projects/*/repos/**}:setIamPolicy"
74 // Gets the access control policy for a resource.
75 // Returns an empty policy if the resource exists and does not have a policy
77 rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
78 returns (google.iam.v1.Policy) {
79 option (google.api.http) = {
80 get: "/v1/{resource=projects/*/repos/**}:getIamPolicy"
84 // Returns permissions that a caller has on the specified resource.
85 // If the resource does not exist, this will return an empty set of
86 // permissions, not a NOT_FOUND error.
87 rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
88 returns (google.iam.v1.TestIamPermissionsResponse) {
89 option (google.api.http) = {
90 post: "/v1/{resource=projects/*/repos/**}:testIamPermissions"
96 // A repository (or repo) is a Git repository storing versioned source content.
98 // Resource name of the repository, of the form
99 // `projects/<project>/repos/<repo>`. The repo name may contain slashes.
100 // eg, `projects/myproject/repos/name/with/slash`
103 // The disk usage of the repo, in bytes. Read-only field. Size is only
104 // returned by GetRepo.
107 // URL to clone the repository from Google Cloud Source Repositories.
111 // How this repository mirrors a repository managed by another service.
113 MirrorConfig mirror_config = 4;
116 // Configuration to automatically mirror a repository from another
117 // hosting service, for example GitHub or BitBucket.
118 message MirrorConfig {
119 // URL of the main repository at the other hosting service.
122 // ID of the webhook listening to updates to trigger mirroring.
123 // Removing this webhook from the other hosting service will stop
124 // Google Cloud Source Repositories from receiving notifications,
125 // and thereby disabling mirroring.
126 string webhook_id = 2;
128 // ID of the SSH deploy key at the other hosting service.
129 // Removing this key from the other service would deauthorize
130 // Google Cloud Source Repositories from mirroring.
131 string deploy_key_id = 3;
134 // Request for GetRepo.
135 message GetRepoRequest {
136 // The name of the requested repository. Values are of the form
137 // `projects/<project>/repos/<repo>`.
141 // Request for ListRepos.
142 message ListReposRequest {
143 // The project ID whose repos should be listed. Values are of the form
144 // `projects/<project>`.
147 // Maximum number of repositories to return; between 1 and 500.
148 // If not set or zero, defaults to 100 at the server.
151 // Resume listing repositories where a prior ListReposResponse
152 // left off. This is an opaque token that must be obtained from
153 // a recent, prior ListReposResponse's next_page_token field.
154 string page_token = 3;
157 // Response for ListRepos. The size is not set in the returned repositories.
158 message ListReposResponse {
160 repeated Repo repos = 1;
162 // If non-empty, additional repositories exist within the project. These
163 // can be retrieved by including this value in the next ListReposRequest's
165 string next_page_token = 2;
168 // Request for CreateRepo
169 message CreateRepoRequest {
170 // The project in which to create the repo. Values are of the form
171 // `projects/<project>`.
174 // The repo to create. Only name should be set; setting other fields
175 // is an error. The project in the name should match the parent field.
179 // Request for DeleteRepo.
180 message DeleteRepoRequest {
181 // The name of the repo to delete. Values are of the form
182 // `projects/<project>/repos/<repo>`.