Path: blob/main/components/public-api/go/experimental/v1/v1connect/oidc.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/experimental/v1/oidc.proto78package v1connect910import (11context "context"12errors "errors"13connect_go "github.com/bufbuild/connect-go"14v1 "github.com/gitpod-io/gitpod/components/public-api/go/experimental/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// OIDCServiceName is the fully-qualified name of the OIDCService service.28OIDCServiceName = "gitpod.experimental.v1.OIDCService"29)3031// OIDCServiceClient is a client for the gitpod.experimental.v1.OIDCService service.32type OIDCServiceClient interface {33// Creates a new OIDC client configuration.34CreateClientConfig(context.Context, *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error)35// Retrieves an OIDC client configuration by ID.36GetClientConfig(context.Context, *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error)37// Lists OIDC client configurations.38ListClientConfigs(context.Context, *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error)39// Updates modifiable properties of an existing OIDC client configuration.40UpdateClientConfig(context.Context, *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error)41// Removes an OIDC client configuration by ID.42DeleteClientConfig(context.Context, *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error)43// Activates an OIDC client configuration by ID.44SetClientConfigActivation(context.Context, *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error)45}4647// NewOIDCServiceClient constructs a client for the gitpod.experimental.v1.OIDCService service. By48// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,49// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the50// connect.WithGRPC() or connect.WithGRPCWeb() options.51//52// The URL supplied here should be the base URL for the Connect or gRPC server (for example,53// http://api.acme.com or https://acme.com/grpc).54func NewOIDCServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) OIDCServiceClient {55baseURL = strings.TrimRight(baseURL, "/")56return &oIDCServiceClient{57createClientConfig: connect_go.NewClient[v1.CreateClientConfigRequest, v1.CreateClientConfigResponse](58httpClient,59baseURL+"/gitpod.experimental.v1.OIDCService/CreateClientConfig",60opts...,61),62getClientConfig: connect_go.NewClient[v1.GetClientConfigRequest, v1.GetClientConfigResponse](63httpClient,64baseURL+"/gitpod.experimental.v1.OIDCService/GetClientConfig",65opts...,66),67listClientConfigs: connect_go.NewClient[v1.ListClientConfigsRequest, v1.ListClientConfigsResponse](68httpClient,69baseURL+"/gitpod.experimental.v1.OIDCService/ListClientConfigs",70opts...,71),72updateClientConfig: connect_go.NewClient[v1.UpdateClientConfigRequest, v1.UpdateClientConfigResponse](73httpClient,74baseURL+"/gitpod.experimental.v1.OIDCService/UpdateClientConfig",75opts...,76),77deleteClientConfig: connect_go.NewClient[v1.DeleteClientConfigRequest, v1.DeleteClientConfigResponse](78httpClient,79baseURL+"/gitpod.experimental.v1.OIDCService/DeleteClientConfig",80opts...,81),82setClientConfigActivation: connect_go.NewClient[v1.SetClientConfigActivationRequest, v1.SetClientConfigActivationResponse](83httpClient,84baseURL+"/gitpod.experimental.v1.OIDCService/SetClientConfigActivation",85opts...,86),87}88}8990// oIDCServiceClient implements OIDCServiceClient.91type oIDCServiceClient struct {92createClientConfig *connect_go.Client[v1.CreateClientConfigRequest, v1.CreateClientConfigResponse]93getClientConfig *connect_go.Client[v1.GetClientConfigRequest, v1.GetClientConfigResponse]94listClientConfigs *connect_go.Client[v1.ListClientConfigsRequest, v1.ListClientConfigsResponse]95updateClientConfig *connect_go.Client[v1.UpdateClientConfigRequest, v1.UpdateClientConfigResponse]96deleteClientConfig *connect_go.Client[v1.DeleteClientConfigRequest, v1.DeleteClientConfigResponse]97setClientConfigActivation *connect_go.Client[v1.SetClientConfigActivationRequest, v1.SetClientConfigActivationResponse]98}99100// CreateClientConfig calls gitpod.experimental.v1.OIDCService.CreateClientConfig.101func (c *oIDCServiceClient) CreateClientConfig(ctx context.Context, req *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error) {102return c.createClientConfig.CallUnary(ctx, req)103}104105// GetClientConfig calls gitpod.experimental.v1.OIDCService.GetClientConfig.106func (c *oIDCServiceClient) GetClientConfig(ctx context.Context, req *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error) {107return c.getClientConfig.CallUnary(ctx, req)108}109110// ListClientConfigs calls gitpod.experimental.v1.OIDCService.ListClientConfigs.111func (c *oIDCServiceClient) ListClientConfigs(ctx context.Context, req *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error) {112return c.listClientConfigs.CallUnary(ctx, req)113}114115// UpdateClientConfig calls gitpod.experimental.v1.OIDCService.UpdateClientConfig.116func (c *oIDCServiceClient) UpdateClientConfig(ctx context.Context, req *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error) {117return c.updateClientConfig.CallUnary(ctx, req)118}119120// DeleteClientConfig calls gitpod.experimental.v1.OIDCService.DeleteClientConfig.121func (c *oIDCServiceClient) DeleteClientConfig(ctx context.Context, req *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error) {122return c.deleteClientConfig.CallUnary(ctx, req)123}124125// SetClientConfigActivation calls gitpod.experimental.v1.OIDCService.SetClientConfigActivation.126func (c *oIDCServiceClient) SetClientConfigActivation(ctx context.Context, req *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error) {127return c.setClientConfigActivation.CallUnary(ctx, req)128}129130// OIDCServiceHandler is an implementation of the gitpod.experimental.v1.OIDCService service.131type OIDCServiceHandler interface {132// Creates a new OIDC client configuration.133CreateClientConfig(context.Context, *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error)134// Retrieves an OIDC client configuration by ID.135GetClientConfig(context.Context, *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error)136// Lists OIDC client configurations.137ListClientConfigs(context.Context, *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error)138// Updates modifiable properties of an existing OIDC client configuration.139UpdateClientConfig(context.Context, *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error)140// Removes an OIDC client configuration by ID.141DeleteClientConfig(context.Context, *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error)142// Activates an OIDC client configuration by ID.143SetClientConfigActivation(context.Context, *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error)144}145146// NewOIDCServiceHandler builds an HTTP handler from the service implementation. It returns the path147// on which to mount the handler and the handler itself.148//149// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf150// and JSON codecs. They also support gzip compression.151func NewOIDCServiceHandler(svc OIDCServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {152mux := http.NewServeMux()153mux.Handle("/gitpod.experimental.v1.OIDCService/CreateClientConfig", connect_go.NewUnaryHandler(154"/gitpod.experimental.v1.OIDCService/CreateClientConfig",155svc.CreateClientConfig,156opts...,157))158mux.Handle("/gitpod.experimental.v1.OIDCService/GetClientConfig", connect_go.NewUnaryHandler(159"/gitpod.experimental.v1.OIDCService/GetClientConfig",160svc.GetClientConfig,161opts...,162))163mux.Handle("/gitpod.experimental.v1.OIDCService/ListClientConfigs", connect_go.NewUnaryHandler(164"/gitpod.experimental.v1.OIDCService/ListClientConfigs",165svc.ListClientConfigs,166opts...,167))168mux.Handle("/gitpod.experimental.v1.OIDCService/UpdateClientConfig", connect_go.NewUnaryHandler(169"/gitpod.experimental.v1.OIDCService/UpdateClientConfig",170svc.UpdateClientConfig,171opts...,172))173mux.Handle("/gitpod.experimental.v1.OIDCService/DeleteClientConfig", connect_go.NewUnaryHandler(174"/gitpod.experimental.v1.OIDCService/DeleteClientConfig",175svc.DeleteClientConfig,176opts...,177))178mux.Handle("/gitpod.experimental.v1.OIDCService/SetClientConfigActivation", connect_go.NewUnaryHandler(179"/gitpod.experimental.v1.OIDCService/SetClientConfigActivation",180svc.SetClientConfigActivation,181opts...,182))183return "/gitpod.experimental.v1.OIDCService/", mux184}185186// UnimplementedOIDCServiceHandler returns CodeUnimplemented from all methods.187type UnimplementedOIDCServiceHandler struct{}188189func (UnimplementedOIDCServiceHandler) CreateClientConfig(context.Context, *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error) {190return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.CreateClientConfig is not implemented"))191}192193func (UnimplementedOIDCServiceHandler) GetClientConfig(context.Context, *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error) {194return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.GetClientConfig is not implemented"))195}196197func (UnimplementedOIDCServiceHandler) ListClientConfigs(context.Context, *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error) {198return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.ListClientConfigs is not implemented"))199}200201func (UnimplementedOIDCServiceHandler) UpdateClientConfig(context.Context, *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error) {202return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.UpdateClientConfig is not implemented"))203}204205func (UnimplementedOIDCServiceHandler) DeleteClientConfig(context.Context, *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error) {206return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.DeleteClientConfig is not implemented"))207}208209func (UnimplementedOIDCServiceHandler) SetClientConfigActivation(context.Context, *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error) {210return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.SetClientConfigActivation is not implemented"))211}212213214