Path: blob/main/components/public-api/go/v1/v1connect/configuration.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/configuration.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// ConfigurationServiceName is the fully-qualified name of the ConfigurationService service.28ConfigurationServiceName = "gitpod.v1.ConfigurationService"29)3031// ConfigurationServiceClient is a client for the gitpod.v1.ConfigurationService service.32type ConfigurationServiceClient interface {33// Creates a new configuration.34CreateConfiguration(context.Context, *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error)35// Retrieves a configuration.36GetConfiguration(context.Context, *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error)37// Lists configurations.38ListConfigurations(context.Context, *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error)39// Updates a configuration.40UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error)41// Deletes a configuration.42DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error)43}4445// NewConfigurationServiceClient constructs a client for the gitpod.v1.ConfigurationService service.46// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped47// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the48// connect.WithGRPC() or connect.WithGRPCWeb() options.49//50// The URL supplied here should be the base URL for the Connect or gRPC server (for example,51// http://api.acme.com or https://acme.com/grpc).52func NewConfigurationServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) ConfigurationServiceClient {53baseURL = strings.TrimRight(baseURL, "/")54return &configurationServiceClient{55createConfiguration: connect_go.NewClient[v1.CreateConfigurationRequest, v1.CreateConfigurationResponse](56httpClient,57baseURL+"/gitpod.v1.ConfigurationService/CreateConfiguration",58opts...,59),60getConfiguration: connect_go.NewClient[v1.GetConfigurationRequest, v1.GetConfigurationResponse](61httpClient,62baseURL+"/gitpod.v1.ConfigurationService/GetConfiguration",63opts...,64),65listConfigurations: connect_go.NewClient[v1.ListConfigurationsRequest, v1.ListConfigurationsResponse](66httpClient,67baseURL+"/gitpod.v1.ConfigurationService/ListConfigurations",68opts...,69),70updateConfiguration: connect_go.NewClient[v1.UpdateConfigurationRequest, v1.UpdateConfigurationResponse](71httpClient,72baseURL+"/gitpod.v1.ConfigurationService/UpdateConfiguration",73opts...,74),75deleteConfiguration: connect_go.NewClient[v1.DeleteConfigurationRequest, v1.DeleteConfigurationResponse](76httpClient,77baseURL+"/gitpod.v1.ConfigurationService/DeleteConfiguration",78opts...,79),80}81}8283// configurationServiceClient implements ConfigurationServiceClient.84type configurationServiceClient struct {85createConfiguration *connect_go.Client[v1.CreateConfigurationRequest, v1.CreateConfigurationResponse]86getConfiguration *connect_go.Client[v1.GetConfigurationRequest, v1.GetConfigurationResponse]87listConfigurations *connect_go.Client[v1.ListConfigurationsRequest, v1.ListConfigurationsResponse]88updateConfiguration *connect_go.Client[v1.UpdateConfigurationRequest, v1.UpdateConfigurationResponse]89deleteConfiguration *connect_go.Client[v1.DeleteConfigurationRequest, v1.DeleteConfigurationResponse]90}9192// CreateConfiguration calls gitpod.v1.ConfigurationService.CreateConfiguration.93func (c *configurationServiceClient) CreateConfiguration(ctx context.Context, req *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error) {94return c.createConfiguration.CallUnary(ctx, req)95}9697// GetConfiguration calls gitpod.v1.ConfigurationService.GetConfiguration.98func (c *configurationServiceClient) GetConfiguration(ctx context.Context, req *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error) {99return c.getConfiguration.CallUnary(ctx, req)100}101102// ListConfigurations calls gitpod.v1.ConfigurationService.ListConfigurations.103func (c *configurationServiceClient) ListConfigurations(ctx context.Context, req *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error) {104return c.listConfigurations.CallUnary(ctx, req)105}106107// UpdateConfiguration calls gitpod.v1.ConfigurationService.UpdateConfiguration.108func (c *configurationServiceClient) UpdateConfiguration(ctx context.Context, req *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error) {109return c.updateConfiguration.CallUnary(ctx, req)110}111112// DeleteConfiguration calls gitpod.v1.ConfigurationService.DeleteConfiguration.113func (c *configurationServiceClient) DeleteConfiguration(ctx context.Context, req *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) {114return c.deleteConfiguration.CallUnary(ctx, req)115}116117// ConfigurationServiceHandler is an implementation of the gitpod.v1.ConfigurationService service.118type ConfigurationServiceHandler interface {119// Creates a new configuration.120CreateConfiguration(context.Context, *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error)121// Retrieves a configuration.122GetConfiguration(context.Context, *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error)123// Lists configurations.124ListConfigurations(context.Context, *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error)125// Updates a configuration.126UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error)127// Deletes a configuration.128DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error)129}130131// NewConfigurationServiceHandler builds an HTTP handler from the service implementation. It returns132// the path on which to mount the handler and the handler itself.133//134// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf135// and JSON codecs. They also support gzip compression.136func NewConfigurationServiceHandler(svc ConfigurationServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {137mux := http.NewServeMux()138mux.Handle("/gitpod.v1.ConfigurationService/CreateConfiguration", connect_go.NewUnaryHandler(139"/gitpod.v1.ConfigurationService/CreateConfiguration",140svc.CreateConfiguration,141opts...,142))143mux.Handle("/gitpod.v1.ConfigurationService/GetConfiguration", connect_go.NewUnaryHandler(144"/gitpod.v1.ConfigurationService/GetConfiguration",145svc.GetConfiguration,146opts...,147))148mux.Handle("/gitpod.v1.ConfigurationService/ListConfigurations", connect_go.NewUnaryHandler(149"/gitpod.v1.ConfigurationService/ListConfigurations",150svc.ListConfigurations,151opts...,152))153mux.Handle("/gitpod.v1.ConfigurationService/UpdateConfiguration", connect_go.NewUnaryHandler(154"/gitpod.v1.ConfigurationService/UpdateConfiguration",155svc.UpdateConfiguration,156opts...,157))158mux.Handle("/gitpod.v1.ConfigurationService/DeleteConfiguration", connect_go.NewUnaryHandler(159"/gitpod.v1.ConfigurationService/DeleteConfiguration",160svc.DeleteConfiguration,161opts...,162))163return "/gitpod.v1.ConfigurationService/", mux164}165166// UnimplementedConfigurationServiceHandler returns CodeUnimplemented from all methods.167type UnimplementedConfigurationServiceHandler struct{}168169func (UnimplementedConfigurationServiceHandler) CreateConfiguration(context.Context, *connect_go.Request[v1.CreateConfigurationRequest]) (*connect_go.Response[v1.CreateConfigurationResponse], error) {170return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.CreateConfiguration is not implemented"))171}172173func (UnimplementedConfigurationServiceHandler) GetConfiguration(context.Context, *connect_go.Request[v1.GetConfigurationRequest]) (*connect_go.Response[v1.GetConfigurationResponse], error) {174return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.GetConfiguration is not implemented"))175}176177func (UnimplementedConfigurationServiceHandler) ListConfigurations(context.Context, *connect_go.Request[v1.ListConfigurationsRequest]) (*connect_go.Response[v1.ListConfigurationsResponse], error) {178return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.ListConfigurations is not implemented"))179}180181func (UnimplementedConfigurationServiceHandler) UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error) {182return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.UpdateConfiguration is not implemented"))183}184185func (UnimplementedConfigurationServiceHandler) DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) {186return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.DeleteConfiguration is not implemented"))187}188189190