Path: blob/main/components/public-api/go/v1/v1connect/prebuild.connect.go
2501 views
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-connect-go. DO NOT EDIT.5//6// Source: gitpod/v1/prebuild.proto78package v1connect910import (11context "context"12errors "errors"13connect_go "github.com/bufbuild/connect-go"14v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1"15http "net/http"16strings "strings"17)1819// This is a compile-time assertion to ensure that this generated file and the connect package are20// compatible. If you get a compiler error that this constant is not defined, this code was21// generated with a version of connect newer than the one compiled into your binary. You can fix the22// problem by either regenerating this code with an older version of connect or updating the connect23// version compiled into your binary.24const _ = connect_go.IsAtLeastVersion0_1_02526const (27// PrebuildServiceName is the fully-qualified name of the PrebuildService service.28PrebuildServiceName = "gitpod.v1.PrebuildService"29)3031// PrebuildServiceClient is a client for the gitpod.v1.PrebuildService service.32type PrebuildServiceClient interface {33StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error)34CancelPrebuild(context.Context, *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error)35GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error)36ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error)37WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest]) (*connect_go.ServerStreamForClient[v1.WatchPrebuildResponse], error)38// ListOrganizationPrebuilds lists all prebuilds of an organization39ListOrganizationPrebuilds(context.Context, *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error)40}4142// NewPrebuildServiceClient constructs a client for the gitpod.v1.PrebuildService service. By43// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,44// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the45// connect.WithGRPC() or connect.WithGRPCWeb() options.46//47// The URL supplied here should be the base URL for the Connect or gRPC server (for example,48// http://api.acme.com or https://acme.com/grpc).49func NewPrebuildServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) PrebuildServiceClient {50baseURL = strings.TrimRight(baseURL, "/")51return &prebuildServiceClient{52startPrebuild: connect_go.NewClient[v1.StartPrebuildRequest, v1.StartPrebuildResponse](53httpClient,54baseURL+"/gitpod.v1.PrebuildService/StartPrebuild",55opts...,56),57cancelPrebuild: connect_go.NewClient[v1.CancelPrebuildRequest, v1.CancelPrebuildResponse](58httpClient,59baseURL+"/gitpod.v1.PrebuildService/CancelPrebuild",60opts...,61),62getPrebuild: connect_go.NewClient[v1.GetPrebuildRequest, v1.GetPrebuildResponse](63httpClient,64baseURL+"/gitpod.v1.PrebuildService/GetPrebuild",65opts...,66),67listPrebuilds: connect_go.NewClient[v1.ListPrebuildsRequest, v1.ListPrebuildsResponse](68httpClient,69baseURL+"/gitpod.v1.PrebuildService/ListPrebuilds",70opts...,71),72watchPrebuild: connect_go.NewClient[v1.WatchPrebuildRequest, v1.WatchPrebuildResponse](73httpClient,74baseURL+"/gitpod.v1.PrebuildService/WatchPrebuild",75opts...,76),77listOrganizationPrebuilds: connect_go.NewClient[v1.ListOrganizationPrebuildsRequest, v1.ListOrganizationPrebuildsResponse](78httpClient,79baseURL+"/gitpod.v1.PrebuildService/ListOrganizationPrebuilds",80opts...,81),82}83}8485// prebuildServiceClient implements PrebuildServiceClient.86type prebuildServiceClient struct {87startPrebuild *connect_go.Client[v1.StartPrebuildRequest, v1.StartPrebuildResponse]88cancelPrebuild *connect_go.Client[v1.CancelPrebuildRequest, v1.CancelPrebuildResponse]89getPrebuild *connect_go.Client[v1.GetPrebuildRequest, v1.GetPrebuildResponse]90listPrebuilds *connect_go.Client[v1.ListPrebuildsRequest, v1.ListPrebuildsResponse]91watchPrebuild *connect_go.Client[v1.WatchPrebuildRequest, v1.WatchPrebuildResponse]92listOrganizationPrebuilds *connect_go.Client[v1.ListOrganizationPrebuildsRequest, v1.ListOrganizationPrebuildsResponse]93}9495// StartPrebuild calls gitpod.v1.PrebuildService.StartPrebuild.96func (c *prebuildServiceClient) StartPrebuild(ctx context.Context, req *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) {97return c.startPrebuild.CallUnary(ctx, req)98}99100// CancelPrebuild calls gitpod.v1.PrebuildService.CancelPrebuild.101func (c *prebuildServiceClient) CancelPrebuild(ctx context.Context, req *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error) {102return c.cancelPrebuild.CallUnary(ctx, req)103}104105// GetPrebuild calls gitpod.v1.PrebuildService.GetPrebuild.106func (c *prebuildServiceClient) GetPrebuild(ctx context.Context, req *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) {107return c.getPrebuild.CallUnary(ctx, req)108}109110// ListPrebuilds calls gitpod.v1.PrebuildService.ListPrebuilds.111func (c *prebuildServiceClient) ListPrebuilds(ctx context.Context, req *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) {112return c.listPrebuilds.CallUnary(ctx, req)113}114115// WatchPrebuild calls gitpod.v1.PrebuildService.WatchPrebuild.116func (c *prebuildServiceClient) WatchPrebuild(ctx context.Context, req *connect_go.Request[v1.WatchPrebuildRequest]) (*connect_go.ServerStreamForClient[v1.WatchPrebuildResponse], error) {117return c.watchPrebuild.CallServerStream(ctx, req)118}119120// ListOrganizationPrebuilds calls gitpod.v1.PrebuildService.ListOrganizationPrebuilds.121func (c *prebuildServiceClient) ListOrganizationPrebuilds(ctx context.Context, req *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error) {122return c.listOrganizationPrebuilds.CallUnary(ctx, req)123}124125// PrebuildServiceHandler is an implementation of the gitpod.v1.PrebuildService service.126type PrebuildServiceHandler interface {127StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error)128CancelPrebuild(context.Context, *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error)129GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error)130ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error)131WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest], *connect_go.ServerStream[v1.WatchPrebuildResponse]) error132// ListOrganizationPrebuilds lists all prebuilds of an organization133ListOrganizationPrebuilds(context.Context, *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error)134}135136// NewPrebuildServiceHandler builds an HTTP handler from the service implementation. It returns the137// path on which to mount the handler and the handler itself.138//139// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf140// and JSON codecs. They also support gzip compression.141func NewPrebuildServiceHandler(svc PrebuildServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {142mux := http.NewServeMux()143mux.Handle("/gitpod.v1.PrebuildService/StartPrebuild", connect_go.NewUnaryHandler(144"/gitpod.v1.PrebuildService/StartPrebuild",145svc.StartPrebuild,146opts...,147))148mux.Handle("/gitpod.v1.PrebuildService/CancelPrebuild", connect_go.NewUnaryHandler(149"/gitpod.v1.PrebuildService/CancelPrebuild",150svc.CancelPrebuild,151opts...,152))153mux.Handle("/gitpod.v1.PrebuildService/GetPrebuild", connect_go.NewUnaryHandler(154"/gitpod.v1.PrebuildService/GetPrebuild",155svc.GetPrebuild,156opts...,157))158mux.Handle("/gitpod.v1.PrebuildService/ListPrebuilds", connect_go.NewUnaryHandler(159"/gitpod.v1.PrebuildService/ListPrebuilds",160svc.ListPrebuilds,161opts...,162))163mux.Handle("/gitpod.v1.PrebuildService/WatchPrebuild", connect_go.NewServerStreamHandler(164"/gitpod.v1.PrebuildService/WatchPrebuild",165svc.WatchPrebuild,166opts...,167))168mux.Handle("/gitpod.v1.PrebuildService/ListOrganizationPrebuilds", connect_go.NewUnaryHandler(169"/gitpod.v1.PrebuildService/ListOrganizationPrebuilds",170svc.ListOrganizationPrebuilds,171opts...,172))173return "/gitpod.v1.PrebuildService/", mux174}175176// UnimplementedPrebuildServiceHandler returns CodeUnimplemented from all methods.177type UnimplementedPrebuildServiceHandler struct{}178179func (UnimplementedPrebuildServiceHandler) StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) {180return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.StartPrebuild is not implemented"))181}182183func (UnimplementedPrebuildServiceHandler) CancelPrebuild(context.Context, *connect_go.Request[v1.CancelPrebuildRequest]) (*connect_go.Response[v1.CancelPrebuildResponse], error) {184return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.CancelPrebuild is not implemented"))185}186187func (UnimplementedPrebuildServiceHandler) GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) {188return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.GetPrebuild is not implemented"))189}190191func (UnimplementedPrebuildServiceHandler) ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) {192return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.ListPrebuilds is not implemented"))193}194195func (UnimplementedPrebuildServiceHandler) WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest], *connect_go.ServerStream[v1.WatchPrebuildResponse]) error {196return connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.WatchPrebuild is not implemented"))197}198199func (UnimplementedPrebuildServiceHandler) ListOrganizationPrebuilds(context.Context, *connect_go.Request[v1.ListOrganizationPrebuildsRequest]) (*connect_go.Response[v1.ListOrganizationPrebuildsResponse], error) {200return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.ListOrganizationPrebuilds is not implemented"))201}202203204