From bc4137fbda71ccbd8ac4dd9300b52dd107a67fb7 Mon Sep 17 00:00:00 2001 From: Alex Tugarev Date: Mon, 20 Nov 2023 15:51:45 +0000 Subject: [PATCH] [papi] Add proto for SCMService --- components/public-api/gitpod/v1/scm.proto | 56 ++ components/public-api/go/v1/scm.pb.go | 888 +++++++++++++++++- components/public-api/go/v1/scm_grpc.pb.go | 217 +++++ .../public-api/go/v1/v1connect/scm.connect.go | 156 +++ .../go/v1/v1connect/scm.proxy.connect.go | 60 ++ .../typescript/src/gitpod/v1/scm_connect.ts | 58 ++ .../typescript/src/gitpod/v1/scm_pb.ts | 448 +++++++++ 7 files changed, 1845 insertions(+), 38 deletions(-) create mode 100644 components/public-api/go/v1/scm_grpc.pb.go create mode 100644 components/public-api/go/v1/v1connect/scm.connect.go create mode 100644 components/public-api/go/v1/v1connect/scm.proxy.connect.go create mode 100644 components/public-api/typescript/src/gitpod/v1/scm_connect.ts diff --git a/components/public-api/gitpod/v1/scm.proto b/components/public-api/gitpod/v1/scm.proto index e515320b7fe3b1..d34e384f0923e3 100644 --- a/components/public-api/gitpod/v1/scm.proto +++ b/components/public-api/gitpod/v1/scm.proto @@ -6,6 +6,62 @@ import "google/protobuf/timestamp.proto"; option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1"; +service SCMService { + rpc GetSCMToken(GetSCMTokenRequest) returns (GetSCMTokenResponse) {} + rpc GuessTokenScopes(GuessTokenScopesRequest) returns (GuessTokenScopesResponse) {} + rpc SearchRepositories(SearchRepositoriesRequest) returns (SearchRepositoriesResponse) {} + rpc ListSuggestedRepositories(ListSuggestedRepositoriesRequest) returns (ListSuggestedRepositoriesResponse) {} +} + +message GetSCMTokenRequest { + string host = 1; +} +message GetSCMTokenResponse { + SCMToken token = 1; +} + +message GuessTokenScopesRequest { + string host = 1; + string repo_url = 2; + string git_command = 3; +} +message GuessTokenScopesResponse { + repeated string scopes = 1; + string message = 2; +} + +message SearchRepositoriesRequest { + string search_string = 1; + int32 limit = 2; +} +message SearchRepositoriesResponse { + repeated SuggestedRepository repositories = 1; +} + +message ListSuggestedRepositoriesRequest { + string organization_id = 1; +} +message ListSuggestedRepositoriesResponse { + repeated SuggestedRepository repositories = 1; +} + +message SCMToken { + string username = 1; + string value = 2; + string id_token = 3; + string refresh_token = 4; + repeated string scopes = 5; + google.protobuf.Timestamp update_date = 6; + google.protobuf.Timestamp expiry_date = 7; +} + +message SuggestedRepository { + string url = 1; + string repo_name = 2; + string configuration_id = 3; + string configuration_name = 4; +} + message Author { string name = 1; string avatar_url = 2; diff --git a/components/public-api/go/v1/scm.pb.go b/components/public-api/go/v1/scm.pb.go index cf94919099e08f..e0bb3e2d2bc04c 100644 --- a/components/public-api/go/v1/scm.pb.go +++ b/components/public-api/go/v1/scm.pb.go @@ -25,6 +25,580 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type GetSCMTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` +} + +func (x *GetSCMTokenRequest) Reset() { + *x = GetSCMTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSCMTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSCMTokenRequest) ProtoMessage() {} + +func (x *GetSCMTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSCMTokenRequest.ProtoReflect.Descriptor instead. +func (*GetSCMTokenRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{0} +} + +func (x *GetSCMTokenRequest) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +type GetSCMTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token *SCMToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *GetSCMTokenResponse) Reset() { + *x = GetSCMTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSCMTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSCMTokenResponse) ProtoMessage() {} + +func (x *GetSCMTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSCMTokenResponse.ProtoReflect.Descriptor instead. +func (*GetSCMTokenResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{1} +} + +func (x *GetSCMTokenResponse) GetToken() *SCMToken { + if x != nil { + return x.Token + } + return nil +} + +type GuessTokenScopesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + RepoUrl string `protobuf:"bytes,2,opt,name=repo_url,json=repoUrl,proto3" json:"repo_url,omitempty"` + GitCommand string `protobuf:"bytes,3,opt,name=git_command,json=gitCommand,proto3" json:"git_command,omitempty"` +} + +func (x *GuessTokenScopesRequest) Reset() { + *x = GuessTokenScopesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GuessTokenScopesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GuessTokenScopesRequest) ProtoMessage() {} + +func (x *GuessTokenScopesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GuessTokenScopesRequest.ProtoReflect.Descriptor instead. +func (*GuessTokenScopesRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{2} +} + +func (x *GuessTokenScopesRequest) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *GuessTokenScopesRequest) GetRepoUrl() string { + if x != nil { + return x.RepoUrl + } + return "" +} + +func (x *GuessTokenScopesRequest) GetGitCommand() string { + if x != nil { + return x.GitCommand + } + return "" +} + +type GuessTokenScopesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3" json:"scopes,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *GuessTokenScopesResponse) Reset() { + *x = GuessTokenScopesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GuessTokenScopesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GuessTokenScopesResponse) ProtoMessage() {} + +func (x *GuessTokenScopesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GuessTokenScopesResponse.ProtoReflect.Descriptor instead. +func (*GuessTokenScopesResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{3} +} + +func (x *GuessTokenScopesResponse) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *GuessTokenScopesResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type SearchRepositoriesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SearchString string `protobuf:"bytes,1,opt,name=search_string,json=searchString,proto3" json:"search_string,omitempty"` + Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *SearchRepositoriesRequest) Reset() { + *x = SearchRepositoriesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRepositoriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRepositoriesRequest) ProtoMessage() {} + +func (x *SearchRepositoriesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRepositoriesRequest.ProtoReflect.Descriptor instead. +func (*SearchRepositoriesRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{4} +} + +func (x *SearchRepositoriesRequest) GetSearchString() string { + if x != nil { + return x.SearchString + } + return "" +} + +func (x *SearchRepositoriesRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +type SearchRepositoriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Repositories []*SuggestedRepository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` +} + +func (x *SearchRepositoriesResponse) Reset() { + *x = SearchRepositoriesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchRepositoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchRepositoriesResponse) ProtoMessage() {} + +func (x *SearchRepositoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchRepositoriesResponse.ProtoReflect.Descriptor instead. +func (*SearchRepositoriesResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{5} +} + +func (x *SearchRepositoriesResponse) GetRepositories() []*SuggestedRepository { + if x != nil { + return x.Repositories + } + return nil +} + +type ListSuggestedRepositoriesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` +} + +func (x *ListSuggestedRepositoriesRequest) Reset() { + *x = ListSuggestedRepositoriesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSuggestedRepositoriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSuggestedRepositoriesRequest) ProtoMessage() {} + +func (x *ListSuggestedRepositoriesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSuggestedRepositoriesRequest.ProtoReflect.Descriptor instead. +func (*ListSuggestedRepositoriesRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{6} +} + +func (x *ListSuggestedRepositoriesRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +type ListSuggestedRepositoriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Repositories []*SuggestedRepository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` +} + +func (x *ListSuggestedRepositoriesResponse) Reset() { + *x = ListSuggestedRepositoriesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSuggestedRepositoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSuggestedRepositoriesResponse) ProtoMessage() {} + +func (x *ListSuggestedRepositoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSuggestedRepositoriesResponse.ProtoReflect.Descriptor instead. +func (*ListSuggestedRepositoriesResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{7} +} + +func (x *ListSuggestedRepositoriesResponse) GetRepositories() []*SuggestedRepository { + if x != nil { + return x.Repositories + } + return nil +} + +type SCMToken struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + IdToken string `protobuf:"bytes,3,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty"` + RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"` + UpdateDate *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_date,json=updateDate,proto3" json:"update_date,omitempty"` + ExpiryDate *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=expiry_date,json=expiryDate,proto3" json:"expiry_date,omitempty"` +} + +func (x *SCMToken) Reset() { + *x = SCMToken{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCMToken) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCMToken) ProtoMessage() {} + +func (x *SCMToken) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCMToken.ProtoReflect.Descriptor instead. +func (*SCMToken) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{8} +} + +func (x *SCMToken) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *SCMToken) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *SCMToken) GetIdToken() string { + if x != nil { + return x.IdToken + } + return "" +} + +func (x *SCMToken) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *SCMToken) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *SCMToken) GetUpdateDate() *timestamppb.Timestamp { + if x != nil { + return x.UpdateDate + } + return nil +} + +func (x *SCMToken) GetExpiryDate() *timestamppb.Timestamp { + if x != nil { + return x.ExpiryDate + } + return nil +} + +type SuggestedRepository struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + ConfigurationId string `protobuf:"bytes,3,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` + ConfigurationName string `protobuf:"bytes,4,opt,name=configuration_name,json=configurationName,proto3" json:"configuration_name,omitempty"` +} + +func (x *SuggestedRepository) Reset() { + *x = SuggestedRepository{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_scm_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SuggestedRepository) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SuggestedRepository) ProtoMessage() {} + +func (x *SuggestedRepository) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_scm_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SuggestedRepository.ProtoReflect.Descriptor instead. +func (*SuggestedRepository) Descriptor() ([]byte, []int) { + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{9} +} + +func (x *SuggestedRepository) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *SuggestedRepository) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *SuggestedRepository) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +func (x *SuggestedRepository) GetConfigurationName() string { + if x != nil { + return x.ConfigurationName + } + return "" +} + type Author struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -37,7 +611,7 @@ type Author struct { func (x *Author) Reset() { *x = Author{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_scm_proto_msgTypes[0] + mi := &file_gitpod_v1_scm_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -50,7 +624,7 @@ func (x *Author) String() string { func (*Author) ProtoMessage() {} func (x *Author) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_scm_proto_msgTypes[0] + mi := &file_gitpod_v1_scm_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -63,7 +637,7 @@ func (x *Author) ProtoReflect() protoreflect.Message { // Deprecated: Use Author.ProtoReflect.Descriptor instead. func (*Author) Descriptor() ([]byte, []int) { - return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{0} + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{10} } func (x *Author) GetName() string { @@ -94,7 +668,7 @@ type Commit struct { func (x *Commit) Reset() { *x = Commit{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_scm_proto_msgTypes[1] + mi := &file_gitpod_v1_scm_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -107,7 +681,7 @@ func (x *Commit) String() string { func (*Commit) ProtoMessage() {} func (x *Commit) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_scm_proto_msgTypes[1] + mi := &file_gitpod_v1_scm_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -120,7 +694,7 @@ func (x *Commit) ProtoReflect() protoreflect.Message { // Deprecated: Use Commit.ProtoReflect.Descriptor instead. func (*Commit) Descriptor() ([]byte, []int) { - return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{1} + return file_gitpod_v1_scm_proto_rawDescGZIP(), []int{11} } func (x *Commit) GetMessage() string { @@ -158,24 +732,119 @@ var file_gitpod_v1_scm_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x3b, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22, 0x9c, - 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x3b, - 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x44, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x42, 0x39, 0x5a, - 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, - 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x43, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x22, 0x40, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x53, 0x43, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x43, + 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x69, 0x0a, + 0x17, 0x47, 0x75, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x72, 0x65, 0x70, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x69, 0x74, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x69, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x4c, 0x0a, 0x18, 0x47, 0x75, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x56, 0x0a, 0x19, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x60, + 0x0a, 0x1a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, + 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, + 0x22, 0x4b, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, + 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x67, 0x0a, + 0x21, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x8e, 0x02, 0x0a, 0x08, 0x53, 0x43, 0x4d, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x3b, 0x0a, + 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x79, 0x44, 0x61, 0x74, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x13, 0x53, 0x75, 0x67, 0x67, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, + 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22, 0x9c, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x06, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x5f, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x44, 0x61, + 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x73, 0x68, 0x61, 0x32, 0x9a, 0x03, 0x0a, 0x0a, 0x53, 0x43, 0x4d, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x43, 0x4d, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x43, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x43, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x47, 0x75, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x75, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x75, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x63, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, + 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x78, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -190,20 +859,43 @@ func file_gitpod_v1_scm_proto_rawDescGZIP() []byte { return file_gitpod_v1_scm_proto_rawDescData } -var file_gitpod_v1_scm_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_gitpod_v1_scm_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_gitpod_v1_scm_proto_goTypes = []interface{}{ - (*Author)(nil), // 0: gitpod.v1.Author - (*Commit)(nil), // 1: gitpod.v1.Commit - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*GetSCMTokenRequest)(nil), // 0: gitpod.v1.GetSCMTokenRequest + (*GetSCMTokenResponse)(nil), // 1: gitpod.v1.GetSCMTokenResponse + (*GuessTokenScopesRequest)(nil), // 2: gitpod.v1.GuessTokenScopesRequest + (*GuessTokenScopesResponse)(nil), // 3: gitpod.v1.GuessTokenScopesResponse + (*SearchRepositoriesRequest)(nil), // 4: gitpod.v1.SearchRepositoriesRequest + (*SearchRepositoriesResponse)(nil), // 5: gitpod.v1.SearchRepositoriesResponse + (*ListSuggestedRepositoriesRequest)(nil), // 6: gitpod.v1.ListSuggestedRepositoriesRequest + (*ListSuggestedRepositoriesResponse)(nil), // 7: gitpod.v1.ListSuggestedRepositoriesResponse + (*SCMToken)(nil), // 8: gitpod.v1.SCMToken + (*SuggestedRepository)(nil), // 9: gitpod.v1.SuggestedRepository + (*Author)(nil), // 10: gitpod.v1.Author + (*Commit)(nil), // 11: gitpod.v1.Commit + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp } var file_gitpod_v1_scm_proto_depIdxs = []int32{ - 0, // 0: gitpod.v1.Commit.author:type_name -> gitpod.v1.Author - 2, // 1: gitpod.v1.Commit.author_date:type_name -> google.protobuf.Timestamp - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 8, // 0: gitpod.v1.GetSCMTokenResponse.token:type_name -> gitpod.v1.SCMToken + 9, // 1: gitpod.v1.SearchRepositoriesResponse.repositories:type_name -> gitpod.v1.SuggestedRepository + 9, // 2: gitpod.v1.ListSuggestedRepositoriesResponse.repositories:type_name -> gitpod.v1.SuggestedRepository + 12, // 3: gitpod.v1.SCMToken.update_date:type_name -> google.protobuf.Timestamp + 12, // 4: gitpod.v1.SCMToken.expiry_date:type_name -> google.protobuf.Timestamp + 10, // 5: gitpod.v1.Commit.author:type_name -> gitpod.v1.Author + 12, // 6: gitpod.v1.Commit.author_date:type_name -> google.protobuf.Timestamp + 0, // 7: gitpod.v1.SCMService.GetSCMToken:input_type -> gitpod.v1.GetSCMTokenRequest + 2, // 8: gitpod.v1.SCMService.GuessTokenScopes:input_type -> gitpod.v1.GuessTokenScopesRequest + 4, // 9: gitpod.v1.SCMService.SearchRepositories:input_type -> gitpod.v1.SearchRepositoriesRequest + 6, // 10: gitpod.v1.SCMService.ListSuggestedRepositories:input_type -> gitpod.v1.ListSuggestedRepositoriesRequest + 1, // 11: gitpod.v1.SCMService.GetSCMToken:output_type -> gitpod.v1.GetSCMTokenResponse + 3, // 12: gitpod.v1.SCMService.GuessTokenScopes:output_type -> gitpod.v1.GuessTokenScopesResponse + 5, // 13: gitpod.v1.SCMService.SearchRepositories:output_type -> gitpod.v1.SearchRepositoriesResponse + 7, // 14: gitpod.v1.SCMService.ListSuggestedRepositories:output_type -> gitpod.v1.ListSuggestedRepositoriesResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_gitpod_v1_scm_proto_init() } @@ -213,7 +905,7 @@ func file_gitpod_v1_scm_proto_init() { } if !protoimpl.UnsafeEnabled { file_gitpod_v1_scm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Author); i { + switch v := v.(*GetSCMTokenRequest); i { case 0: return &v.state case 1: @@ -225,6 +917,126 @@ func file_gitpod_v1_scm_proto_init() { } } file_gitpod_v1_scm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSCMTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GuessTokenScopesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GuessTokenScopesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRepositoriesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchRepositoriesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSuggestedRepositoriesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSuggestedRepositoriesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCMToken); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SuggestedRepository); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Author); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_scm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Commit); i { case 0: return &v.state @@ -243,9 +1055,9 @@ func file_gitpod_v1_scm_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gitpod_v1_scm_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 12, NumExtensions: 0, - NumServices: 0, + NumServices: 1, }, GoTypes: file_gitpod_v1_scm_proto_goTypes, DependencyIndexes: file_gitpod_v1_scm_proto_depIdxs, diff --git a/components/public-api/go/v1/scm_grpc.pb.go b/components/public-api/go/v1/scm_grpc.pb.go new file mode 100644 index 00000000000000..c1b5ec5077d91a --- /dev/null +++ b/components/public-api/go/v1/scm_grpc.pb.go @@ -0,0 +1,217 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: gitpod/v1/scm.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// SCMServiceClient is the client API for SCMService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SCMServiceClient interface { + GetSCMToken(ctx context.Context, in *GetSCMTokenRequest, opts ...grpc.CallOption) (*GetSCMTokenResponse, error) + GuessTokenScopes(ctx context.Context, in *GuessTokenScopesRequest, opts ...grpc.CallOption) (*GuessTokenScopesResponse, error) + SearchRepositories(ctx context.Context, in *SearchRepositoriesRequest, opts ...grpc.CallOption) (*SearchRepositoriesResponse, error) + ListSuggestedRepositories(ctx context.Context, in *ListSuggestedRepositoriesRequest, opts ...grpc.CallOption) (*ListSuggestedRepositoriesResponse, error) +} + +type sCMServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSCMServiceClient(cc grpc.ClientConnInterface) SCMServiceClient { + return &sCMServiceClient{cc} +} + +func (c *sCMServiceClient) GetSCMToken(ctx context.Context, in *GetSCMTokenRequest, opts ...grpc.CallOption) (*GetSCMTokenResponse, error) { + out := new(GetSCMTokenResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.SCMService/GetSCMToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sCMServiceClient) GuessTokenScopes(ctx context.Context, in *GuessTokenScopesRequest, opts ...grpc.CallOption) (*GuessTokenScopesResponse, error) { + out := new(GuessTokenScopesResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.SCMService/GuessTokenScopes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sCMServiceClient) SearchRepositories(ctx context.Context, in *SearchRepositoriesRequest, opts ...grpc.CallOption) (*SearchRepositoriesResponse, error) { + out := new(SearchRepositoriesResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.SCMService/SearchRepositories", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *sCMServiceClient) ListSuggestedRepositories(ctx context.Context, in *ListSuggestedRepositoriesRequest, opts ...grpc.CallOption) (*ListSuggestedRepositoriesResponse, error) { + out := new(ListSuggestedRepositoriesResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.SCMService/ListSuggestedRepositories", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SCMServiceServer is the server API for SCMService service. +// All implementations must embed UnimplementedSCMServiceServer +// for forward compatibility +type SCMServiceServer interface { + GetSCMToken(context.Context, *GetSCMTokenRequest) (*GetSCMTokenResponse, error) + GuessTokenScopes(context.Context, *GuessTokenScopesRequest) (*GuessTokenScopesResponse, error) + SearchRepositories(context.Context, *SearchRepositoriesRequest) (*SearchRepositoriesResponse, error) + ListSuggestedRepositories(context.Context, *ListSuggestedRepositoriesRequest) (*ListSuggestedRepositoriesResponse, error) + mustEmbedUnimplementedSCMServiceServer() +} + +// UnimplementedSCMServiceServer must be embedded to have forward compatible implementations. +type UnimplementedSCMServiceServer struct { +} + +func (UnimplementedSCMServiceServer) GetSCMToken(context.Context, *GetSCMTokenRequest) (*GetSCMTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSCMToken not implemented") +} +func (UnimplementedSCMServiceServer) GuessTokenScopes(context.Context, *GuessTokenScopesRequest) (*GuessTokenScopesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GuessTokenScopes not implemented") +} +func (UnimplementedSCMServiceServer) SearchRepositories(context.Context, *SearchRepositoriesRequest) (*SearchRepositoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchRepositories not implemented") +} +func (UnimplementedSCMServiceServer) ListSuggestedRepositories(context.Context, *ListSuggestedRepositoriesRequest) (*ListSuggestedRepositoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSuggestedRepositories not implemented") +} +func (UnimplementedSCMServiceServer) mustEmbedUnimplementedSCMServiceServer() {} + +// UnsafeSCMServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SCMServiceServer will +// result in compilation errors. +type UnsafeSCMServiceServer interface { + mustEmbedUnimplementedSCMServiceServer() +} + +func RegisterSCMServiceServer(s grpc.ServiceRegistrar, srv SCMServiceServer) { + s.RegisterService(&SCMService_ServiceDesc, srv) +} + +func _SCMService_GetSCMToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSCMTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SCMServiceServer).GetSCMToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.SCMService/GetSCMToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SCMServiceServer).GetSCMToken(ctx, req.(*GetSCMTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SCMService_GuessTokenScopes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GuessTokenScopesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SCMServiceServer).GuessTokenScopes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.SCMService/GuessTokenScopes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SCMServiceServer).GuessTokenScopes(ctx, req.(*GuessTokenScopesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SCMService_SearchRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchRepositoriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SCMServiceServer).SearchRepositories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.SCMService/SearchRepositories", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SCMServiceServer).SearchRepositories(ctx, req.(*SearchRepositoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SCMService_ListSuggestedRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSuggestedRepositoriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SCMServiceServer).ListSuggestedRepositories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.SCMService/ListSuggestedRepositories", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SCMServiceServer).ListSuggestedRepositories(ctx, req.(*ListSuggestedRepositoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SCMService_ServiceDesc is the grpc.ServiceDesc for SCMService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SCMService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gitpod.v1.SCMService", + HandlerType: (*SCMServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetSCMToken", + Handler: _SCMService_GetSCMToken_Handler, + }, + { + MethodName: "GuessTokenScopes", + Handler: _SCMService_GuessTokenScopes_Handler, + }, + { + MethodName: "SearchRepositories", + Handler: _SCMService_SearchRepositories_Handler, + }, + { + MethodName: "ListSuggestedRepositories", + Handler: _SCMService_ListSuggestedRepositories_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gitpod/v1/scm.proto", +} diff --git a/components/public-api/go/v1/v1connect/scm.connect.go b/components/public-api/go/v1/v1connect/scm.connect.go new file mode 100644 index 00000000000000..b1ba6634824070 --- /dev/null +++ b/components/public-api/go/v1/v1connect/scm.connect.go @@ -0,0 +1,156 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: gitpod/v1/scm.proto + +package v1connect + +import ( + context "context" + errors "errors" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect_go.IsAtLeastVersion0_1_0 + +const ( + // SCMServiceName is the fully-qualified name of the SCMService service. + SCMServiceName = "gitpod.v1.SCMService" +) + +// SCMServiceClient is a client for the gitpod.v1.SCMService service. +type SCMServiceClient interface { + GetSCMToken(context.Context, *connect_go.Request[v1.GetSCMTokenRequest]) (*connect_go.Response[v1.GetSCMTokenResponse], error) + GuessTokenScopes(context.Context, *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) + SearchRepositories(context.Context, *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) + ListSuggestedRepositories(context.Context, *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) +} + +// NewSCMServiceClient constructs a client for the gitpod.v1.SCMService service. By default, it uses +// the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends +// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or +// connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewSCMServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) SCMServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &sCMServiceClient{ + getSCMToken: connect_go.NewClient[v1.GetSCMTokenRequest, v1.GetSCMTokenResponse]( + httpClient, + baseURL+"/gitpod.v1.SCMService/GetSCMToken", + opts..., + ), + guessTokenScopes: connect_go.NewClient[v1.GuessTokenScopesRequest, v1.GuessTokenScopesResponse]( + httpClient, + baseURL+"/gitpod.v1.SCMService/GuessTokenScopes", + opts..., + ), + searchRepositories: connect_go.NewClient[v1.SearchRepositoriesRequest, v1.SearchRepositoriesResponse]( + httpClient, + baseURL+"/gitpod.v1.SCMService/SearchRepositories", + opts..., + ), + listSuggestedRepositories: connect_go.NewClient[v1.ListSuggestedRepositoriesRequest, v1.ListSuggestedRepositoriesResponse]( + httpClient, + baseURL+"/gitpod.v1.SCMService/ListSuggestedRepositories", + opts..., + ), + } +} + +// sCMServiceClient implements SCMServiceClient. +type sCMServiceClient struct { + getSCMToken *connect_go.Client[v1.GetSCMTokenRequest, v1.GetSCMTokenResponse] + guessTokenScopes *connect_go.Client[v1.GuessTokenScopesRequest, v1.GuessTokenScopesResponse] + searchRepositories *connect_go.Client[v1.SearchRepositoriesRequest, v1.SearchRepositoriesResponse] + listSuggestedRepositories *connect_go.Client[v1.ListSuggestedRepositoriesRequest, v1.ListSuggestedRepositoriesResponse] +} + +// GetSCMToken calls gitpod.v1.SCMService.GetSCMToken. +func (c *sCMServiceClient) GetSCMToken(ctx context.Context, req *connect_go.Request[v1.GetSCMTokenRequest]) (*connect_go.Response[v1.GetSCMTokenResponse], error) { + return c.getSCMToken.CallUnary(ctx, req) +} + +// GuessTokenScopes calls gitpod.v1.SCMService.GuessTokenScopes. +func (c *sCMServiceClient) GuessTokenScopes(ctx context.Context, req *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) { + return c.guessTokenScopes.CallUnary(ctx, req) +} + +// SearchRepositories calls gitpod.v1.SCMService.SearchRepositories. +func (c *sCMServiceClient) SearchRepositories(ctx context.Context, req *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) { + return c.searchRepositories.CallUnary(ctx, req) +} + +// ListSuggestedRepositories calls gitpod.v1.SCMService.ListSuggestedRepositories. +func (c *sCMServiceClient) ListSuggestedRepositories(ctx context.Context, req *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) { + return c.listSuggestedRepositories.CallUnary(ctx, req) +} + +// SCMServiceHandler is an implementation of the gitpod.v1.SCMService service. +type SCMServiceHandler interface { + GetSCMToken(context.Context, *connect_go.Request[v1.GetSCMTokenRequest]) (*connect_go.Response[v1.GetSCMTokenResponse], error) + GuessTokenScopes(context.Context, *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) + SearchRepositories(context.Context, *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) + ListSuggestedRepositories(context.Context, *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) +} + +// NewSCMServiceHandler builds an HTTP handler from the service implementation. It returns the path +// on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewSCMServiceHandler(svc SCMServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { + mux := http.NewServeMux() + mux.Handle("/gitpod.v1.SCMService/GetSCMToken", connect_go.NewUnaryHandler( + "/gitpod.v1.SCMService/GetSCMToken", + svc.GetSCMToken, + opts..., + )) + mux.Handle("/gitpod.v1.SCMService/GuessTokenScopes", connect_go.NewUnaryHandler( + "/gitpod.v1.SCMService/GuessTokenScopes", + svc.GuessTokenScopes, + opts..., + )) + mux.Handle("/gitpod.v1.SCMService/SearchRepositories", connect_go.NewUnaryHandler( + "/gitpod.v1.SCMService/SearchRepositories", + svc.SearchRepositories, + opts..., + )) + mux.Handle("/gitpod.v1.SCMService/ListSuggestedRepositories", connect_go.NewUnaryHandler( + "/gitpod.v1.SCMService/ListSuggestedRepositories", + svc.ListSuggestedRepositories, + opts..., + )) + return "/gitpod.v1.SCMService/", mux +} + +// UnimplementedSCMServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedSCMServiceHandler struct{} + +func (UnimplementedSCMServiceHandler) GetSCMToken(context.Context, *connect_go.Request[v1.GetSCMTokenRequest]) (*connect_go.Response[v1.GetSCMTokenResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.SCMService.GetSCMToken is not implemented")) +} + +func (UnimplementedSCMServiceHandler) GuessTokenScopes(context.Context, *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.SCMService.GuessTokenScopes is not implemented")) +} + +func (UnimplementedSCMServiceHandler) SearchRepositories(context.Context, *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.SCMService.SearchRepositories is not implemented")) +} + +func (UnimplementedSCMServiceHandler) ListSuggestedRepositories(context.Context, *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.SCMService.ListSuggestedRepositories is not implemented")) +} diff --git a/components/public-api/go/v1/v1connect/scm.proxy.connect.go b/components/public-api/go/v1/v1connect/scm.proxy.connect.go new file mode 100644 index 00000000000000..fec25736d27db7 --- /dev/null +++ b/components/public-api/go/v1/v1connect/scm.proxy.connect.go @@ -0,0 +1,60 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-proxy-gen. DO NOT EDIT. + +package v1connect + +import ( + context "context" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1" +) + +var _ SCMServiceHandler = (*ProxySCMServiceHandler)(nil) + +type ProxySCMServiceHandler struct { + Client v1.SCMServiceClient + UnimplementedSCMServiceHandler +} + +func (s *ProxySCMServiceHandler) GetSCMToken(ctx context.Context, req *connect_go.Request[v1.GetSCMTokenRequest]) (*connect_go.Response[v1.GetSCMTokenResponse], error) { + resp, err := s.Client.GetSCMToken(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxySCMServiceHandler) GuessTokenScopes(ctx context.Context, req *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) { + resp, err := s.Client.GuessTokenScopes(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxySCMServiceHandler) SearchRepositories(ctx context.Context, req *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) { + resp, err := s.Client.SearchRepositories(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxySCMServiceHandler) ListSuggestedRepositories(ctx context.Context, req *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) { + resp, err := s.Client.ListSuggestedRepositories(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} diff --git a/components/public-api/typescript/src/gitpod/v1/scm_connect.ts b/components/public-api/typescript/src/gitpod/v1/scm_connect.ts new file mode 100644 index 00000000000000..ed920bfea3710e --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/scm_connect.ts @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +// @generated by protoc-gen-connect-es v1.1.2 with parameter "target=ts" +// @generated from file gitpod/v1/scm.proto (package gitpod.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { GetSCMTokenRequest, GetSCMTokenResponse, GuessTokenScopesRequest, GuessTokenScopesResponse, ListSuggestedRepositoriesRequest, ListSuggestedRepositoriesResponse, SearchRepositoriesRequest, SearchRepositoriesResponse } from "./scm_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service gitpod.v1.SCMService + */ +export const SCMService = { + typeName: "gitpod.v1.SCMService", + methods: { + /** + * @generated from rpc gitpod.v1.SCMService.GetSCMToken + */ + getSCMToken: { + name: "GetSCMToken", + I: GetSCMTokenRequest, + O: GetSCMTokenResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.SCMService.GuessTokenScopes + */ + guessTokenScopes: { + name: "GuessTokenScopes", + I: GuessTokenScopesRequest, + O: GuessTokenScopesResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.SCMService.SearchRepositories + */ + searchRepositories: { + name: "SearchRepositories", + I: SearchRepositoriesRequest, + O: SearchRepositoriesResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.SCMService.ListSuggestedRepositories + */ + listSuggestedRepositories: { + name: "ListSuggestedRepositories", + I: ListSuggestedRepositoriesRequest, + O: ListSuggestedRepositoriesResponse, + kind: MethodKind.Unary, + }, + } +} as const; diff --git a/components/public-api/typescript/src/gitpod/v1/scm_pb.ts b/components/public-api/typescript/src/gitpod/v1/scm_pb.ts index 4ccede9793397f..c12bd8e5231194 100644 --- a/components/public-api/typescript/src/gitpod/v1/scm_pb.ts +++ b/components/public-api/typescript/src/gitpod/v1/scm_pb.ts @@ -12,6 +12,454 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; +/** + * @generated from message gitpod.v1.GetSCMTokenRequest + */ +export class GetSCMTokenRequest extends Message { + /** + * @generated from field: string host = 1; + */ + host = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetSCMTokenRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "host", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSCMTokenRequest { + return new GetSCMTokenRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSCMTokenRequest { + return new GetSCMTokenRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSCMTokenRequest { + return new GetSCMTokenRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetSCMTokenRequest | PlainMessage | undefined, b: GetSCMTokenRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSCMTokenRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.GetSCMTokenResponse + */ +export class GetSCMTokenResponse extends Message { + /** + * @generated from field: gitpod.v1.SCMToken token = 1; + */ + token?: SCMToken; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetSCMTokenResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "token", kind: "message", T: SCMToken }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSCMTokenResponse { + return new GetSCMTokenResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSCMTokenResponse { + return new GetSCMTokenResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSCMTokenResponse { + return new GetSCMTokenResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetSCMTokenResponse | PlainMessage | undefined, b: GetSCMTokenResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSCMTokenResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.GuessTokenScopesRequest + */ +export class GuessTokenScopesRequest extends Message { + /** + * @generated from field: string host = 1; + */ + host = ""; + + /** + * @generated from field: string repo_url = 2; + */ + repoUrl = ""; + + /** + * @generated from field: string git_command = 3; + */ + gitCommand = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GuessTokenScopesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "host", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "repo_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "git_command", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GuessTokenScopesRequest { + return new GuessTokenScopesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GuessTokenScopesRequest { + return new GuessTokenScopesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GuessTokenScopesRequest { + return new GuessTokenScopesRequest().fromJsonString(jsonString, options); + } + + static equals(a: GuessTokenScopesRequest | PlainMessage | undefined, b: GuessTokenScopesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GuessTokenScopesRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.GuessTokenScopesResponse + */ +export class GuessTokenScopesResponse extends Message { + /** + * @generated from field: repeated string scopes = 1; + */ + scopes: string[] = []; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GuessTokenScopesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "scopes", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GuessTokenScopesResponse { + return new GuessTokenScopesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GuessTokenScopesResponse { + return new GuessTokenScopesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GuessTokenScopesResponse { + return new GuessTokenScopesResponse().fromJsonString(jsonString, options); + } + + static equals(a: GuessTokenScopesResponse | PlainMessage | undefined, b: GuessTokenScopesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GuessTokenScopesResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.SearchRepositoriesRequest + */ +export class SearchRepositoriesRequest extends Message { + /** + * @generated from field: string search_string = 1; + */ + searchString = ""; + + /** + * @generated from field: int32 limit = 2; + */ + limit = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.SearchRepositoriesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "search_string", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "limit", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SearchRepositoriesRequest { + return new SearchRepositoriesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SearchRepositoriesRequest { + return new SearchRepositoriesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SearchRepositoriesRequest { + return new SearchRepositoriesRequest().fromJsonString(jsonString, options); + } + + static equals(a: SearchRepositoriesRequest | PlainMessage | undefined, b: SearchRepositoriesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SearchRepositoriesRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.SearchRepositoriesResponse + */ +export class SearchRepositoriesResponse extends Message { + /** + * @generated from field: repeated gitpod.v1.SuggestedRepository repositories = 1; + */ + repositories: SuggestedRepository[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.SearchRepositoriesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "repositories", kind: "message", T: SuggestedRepository, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SearchRepositoriesResponse { + return new SearchRepositoriesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SearchRepositoriesResponse { + return new SearchRepositoriesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SearchRepositoriesResponse { + return new SearchRepositoriesResponse().fromJsonString(jsonString, options); + } + + static equals(a: SearchRepositoriesResponse | PlainMessage | undefined, b: SearchRepositoriesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SearchRepositoriesResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListSuggestedRepositoriesRequest + */ +export class ListSuggestedRepositoriesRequest extends Message { + /** + * @generated from field: string organization_id = 1; + */ + organizationId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListSuggestedRepositoriesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListSuggestedRepositoriesRequest { + return new ListSuggestedRepositoriesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListSuggestedRepositoriesRequest { + return new ListSuggestedRepositoriesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListSuggestedRepositoriesRequest { + return new ListSuggestedRepositoriesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListSuggestedRepositoriesRequest | PlainMessage | undefined, b: ListSuggestedRepositoriesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListSuggestedRepositoriesRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListSuggestedRepositoriesResponse + */ +export class ListSuggestedRepositoriesResponse extends Message { + /** + * @generated from field: repeated gitpod.v1.SuggestedRepository repositories = 1; + */ + repositories: SuggestedRepository[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListSuggestedRepositoriesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "repositories", kind: "message", T: SuggestedRepository, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListSuggestedRepositoriesResponse { + return new ListSuggestedRepositoriesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListSuggestedRepositoriesResponse { + return new ListSuggestedRepositoriesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListSuggestedRepositoriesResponse { + return new ListSuggestedRepositoriesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListSuggestedRepositoriesResponse | PlainMessage | undefined, b: ListSuggestedRepositoriesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListSuggestedRepositoriesResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.SCMToken + */ +export class SCMToken extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string value = 2; + */ + value = ""; + + /** + * @generated from field: string id_token = 3; + */ + idToken = ""; + + /** + * @generated from field: string refresh_token = 4; + */ + refreshToken = ""; + + /** + * @generated from field: repeated string scopes = 5; + */ + scopes: string[] = []; + + /** + * @generated from field: google.protobuf.Timestamp update_date = 6; + */ + updateDate?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp expiry_date = 7; + */ + expiryDate?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.SCMToken"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "id_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "refresh_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "scopes", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 6, name: "update_date", kind: "message", T: Timestamp }, + { no: 7, name: "expiry_date", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SCMToken { + return new SCMToken().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SCMToken { + return new SCMToken().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SCMToken { + return new SCMToken().fromJsonString(jsonString, options); + } + + static equals(a: SCMToken | PlainMessage | undefined, b: SCMToken | PlainMessage | undefined): boolean { + return proto3.util.equals(SCMToken, a, b); + } +} + +/** + * @generated from message gitpod.v1.SuggestedRepository + */ +export class SuggestedRepository extends Message { + /** + * @generated from field: string url = 1; + */ + url = ""; + + /** + * @generated from field: string repo_name = 2; + */ + repoName = ""; + + /** + * @generated from field: string configuration_id = 3; + */ + configurationId = ""; + + /** + * @generated from field: string configuration_name = 4; + */ + configurationName = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.SuggestedRepository"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "repo_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "configuration_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SuggestedRepository { + return new SuggestedRepository().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SuggestedRepository { + return new SuggestedRepository().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SuggestedRepository { + return new SuggestedRepository().fromJsonString(jsonString, options); + } + + static equals(a: SuggestedRepository | PlainMessage | undefined, b: SuggestedRepository | PlainMessage | undefined): boolean { + return proto3.util.equals(SuggestedRepository, a, b); + } +} + /** * @generated from message gitpod.v1.Author */