Path: blob/main/components/public-api/go/experimental/v1/v1connect/user.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/user.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// UserServiceName is the fully-qualified name of the UserService service.28UserServiceName = "gitpod.experimental.v1.UserService"29)3031// UserServiceClient is a client for the gitpod.experimental.v1.UserService service.32type UserServiceClient interface {33// GetAuthenticatedUser gets the user info.34GetAuthenticatedUser(context.Context, *connect_go.Request[v1.GetAuthenticatedUserRequest]) (*connect_go.Response[v1.GetAuthenticatedUserResponse], error)35// ListSSHKeys lists the public SSH keys.36ListSSHKeys(context.Context, *connect_go.Request[v1.ListSSHKeysRequest]) (*connect_go.Response[v1.ListSSHKeysResponse], error)37// CreateSSHKey adds a public SSH key.38CreateSSHKey(context.Context, *connect_go.Request[v1.CreateSSHKeyRequest]) (*connect_go.Response[v1.CreateSSHKeyResponse], error)39// GetSSHKey retrieves an ssh key by ID.40GetSSHKey(context.Context, *connect_go.Request[v1.GetSSHKeyRequest]) (*connect_go.Response[v1.GetSSHKeyResponse], error)41// DeleteSSHKey removes a public SSH key.42DeleteSSHKey(context.Context, *connect_go.Request[v1.DeleteSSHKeyRequest]) (*connect_go.Response[v1.DeleteSSHKeyResponse], error)43GetGitToken(context.Context, *connect_go.Request[v1.GetGitTokenRequest]) (*connect_go.Response[v1.GetGitTokenResponse], error)44BlockUser(context.Context, *connect_go.Request[v1.BlockUserRequest]) (*connect_go.Response[v1.BlockUserResponse], error)45}4647// NewUserServiceClient constructs a client for the gitpod.experimental.v1.UserService 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 NewUserServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) UserServiceClient {55baseURL = strings.TrimRight(baseURL, "/")56return &userServiceClient{57getAuthenticatedUser: connect_go.NewClient[v1.GetAuthenticatedUserRequest, v1.GetAuthenticatedUserResponse](58httpClient,59baseURL+"/gitpod.experimental.v1.UserService/GetAuthenticatedUser",60opts...,61),62listSSHKeys: connect_go.NewClient[v1.ListSSHKeysRequest, v1.ListSSHKeysResponse](63httpClient,64baseURL+"/gitpod.experimental.v1.UserService/ListSSHKeys",65opts...,66),67createSSHKey: connect_go.NewClient[v1.CreateSSHKeyRequest, v1.CreateSSHKeyResponse](68httpClient,69baseURL+"/gitpod.experimental.v1.UserService/CreateSSHKey",70opts...,71),72getSSHKey: connect_go.NewClient[v1.GetSSHKeyRequest, v1.GetSSHKeyResponse](73httpClient,74baseURL+"/gitpod.experimental.v1.UserService/GetSSHKey",75opts...,76),77deleteSSHKey: connect_go.NewClient[v1.DeleteSSHKeyRequest, v1.DeleteSSHKeyResponse](78httpClient,79baseURL+"/gitpod.experimental.v1.UserService/DeleteSSHKey",80opts...,81),82getGitToken: connect_go.NewClient[v1.GetGitTokenRequest, v1.GetGitTokenResponse](83httpClient,84baseURL+"/gitpod.experimental.v1.UserService/GetGitToken",85opts...,86),87blockUser: connect_go.NewClient[v1.BlockUserRequest, v1.BlockUserResponse](88httpClient,89baseURL+"/gitpod.experimental.v1.UserService/BlockUser",90opts...,91),92}93}9495// userServiceClient implements UserServiceClient.96type userServiceClient struct {97getAuthenticatedUser *connect_go.Client[v1.GetAuthenticatedUserRequest, v1.GetAuthenticatedUserResponse]98listSSHKeys *connect_go.Client[v1.ListSSHKeysRequest, v1.ListSSHKeysResponse]99createSSHKey *connect_go.Client[v1.CreateSSHKeyRequest, v1.CreateSSHKeyResponse]100getSSHKey *connect_go.Client[v1.GetSSHKeyRequest, v1.GetSSHKeyResponse]101deleteSSHKey *connect_go.Client[v1.DeleteSSHKeyRequest, v1.DeleteSSHKeyResponse]102getGitToken *connect_go.Client[v1.GetGitTokenRequest, v1.GetGitTokenResponse]103blockUser *connect_go.Client[v1.BlockUserRequest, v1.BlockUserResponse]104}105106// GetAuthenticatedUser calls gitpod.experimental.v1.UserService.GetAuthenticatedUser.107func (c *userServiceClient) GetAuthenticatedUser(ctx context.Context, req *connect_go.Request[v1.GetAuthenticatedUserRequest]) (*connect_go.Response[v1.GetAuthenticatedUserResponse], error) {108return c.getAuthenticatedUser.CallUnary(ctx, req)109}110111// ListSSHKeys calls gitpod.experimental.v1.UserService.ListSSHKeys.112func (c *userServiceClient) ListSSHKeys(ctx context.Context, req *connect_go.Request[v1.ListSSHKeysRequest]) (*connect_go.Response[v1.ListSSHKeysResponse], error) {113return c.listSSHKeys.CallUnary(ctx, req)114}115116// CreateSSHKey calls gitpod.experimental.v1.UserService.CreateSSHKey.117func (c *userServiceClient) CreateSSHKey(ctx context.Context, req *connect_go.Request[v1.CreateSSHKeyRequest]) (*connect_go.Response[v1.CreateSSHKeyResponse], error) {118return c.createSSHKey.CallUnary(ctx, req)119}120121// GetSSHKey calls gitpod.experimental.v1.UserService.GetSSHKey.122func (c *userServiceClient) GetSSHKey(ctx context.Context, req *connect_go.Request[v1.GetSSHKeyRequest]) (*connect_go.Response[v1.GetSSHKeyResponse], error) {123return c.getSSHKey.CallUnary(ctx, req)124}125126// DeleteSSHKey calls gitpod.experimental.v1.UserService.DeleteSSHKey.127func (c *userServiceClient) DeleteSSHKey(ctx context.Context, req *connect_go.Request[v1.DeleteSSHKeyRequest]) (*connect_go.Response[v1.DeleteSSHKeyResponse], error) {128return c.deleteSSHKey.CallUnary(ctx, req)129}130131// GetGitToken calls gitpod.experimental.v1.UserService.GetGitToken.132func (c *userServiceClient) GetGitToken(ctx context.Context, req *connect_go.Request[v1.GetGitTokenRequest]) (*connect_go.Response[v1.GetGitTokenResponse], error) {133return c.getGitToken.CallUnary(ctx, req)134}135136// BlockUser calls gitpod.experimental.v1.UserService.BlockUser.137func (c *userServiceClient) BlockUser(ctx context.Context, req *connect_go.Request[v1.BlockUserRequest]) (*connect_go.Response[v1.BlockUserResponse], error) {138return c.blockUser.CallUnary(ctx, req)139}140141// UserServiceHandler is an implementation of the gitpod.experimental.v1.UserService service.142type UserServiceHandler interface {143// GetAuthenticatedUser gets the user info.144GetAuthenticatedUser(context.Context, *connect_go.Request[v1.GetAuthenticatedUserRequest]) (*connect_go.Response[v1.GetAuthenticatedUserResponse], error)145// ListSSHKeys lists the public SSH keys.146ListSSHKeys(context.Context, *connect_go.Request[v1.ListSSHKeysRequest]) (*connect_go.Response[v1.ListSSHKeysResponse], error)147// CreateSSHKey adds a public SSH key.148CreateSSHKey(context.Context, *connect_go.Request[v1.CreateSSHKeyRequest]) (*connect_go.Response[v1.CreateSSHKeyResponse], error)149// GetSSHKey retrieves an ssh key by ID.150GetSSHKey(context.Context, *connect_go.Request[v1.GetSSHKeyRequest]) (*connect_go.Response[v1.GetSSHKeyResponse], error)151// DeleteSSHKey removes a public SSH key.152DeleteSSHKey(context.Context, *connect_go.Request[v1.DeleteSSHKeyRequest]) (*connect_go.Response[v1.DeleteSSHKeyResponse], error)153GetGitToken(context.Context, *connect_go.Request[v1.GetGitTokenRequest]) (*connect_go.Response[v1.GetGitTokenResponse], error)154BlockUser(context.Context, *connect_go.Request[v1.BlockUserRequest]) (*connect_go.Response[v1.BlockUserResponse], error)155}156157// NewUserServiceHandler builds an HTTP handler from the service implementation. It returns the path158// on which to mount the handler and the handler itself.159//160// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf161// and JSON codecs. They also support gzip compression.162func NewUserServiceHandler(svc UserServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {163mux := http.NewServeMux()164mux.Handle("/gitpod.experimental.v1.UserService/GetAuthenticatedUser", connect_go.NewUnaryHandler(165"/gitpod.experimental.v1.UserService/GetAuthenticatedUser",166svc.GetAuthenticatedUser,167opts...,168))169mux.Handle("/gitpod.experimental.v1.UserService/ListSSHKeys", connect_go.NewUnaryHandler(170"/gitpod.experimental.v1.UserService/ListSSHKeys",171svc.ListSSHKeys,172opts...,173))174mux.Handle("/gitpod.experimental.v1.UserService/CreateSSHKey", connect_go.NewUnaryHandler(175"/gitpod.experimental.v1.UserService/CreateSSHKey",176svc.CreateSSHKey,177opts...,178))179mux.Handle("/gitpod.experimental.v1.UserService/GetSSHKey", connect_go.NewUnaryHandler(180"/gitpod.experimental.v1.UserService/GetSSHKey",181svc.GetSSHKey,182opts...,183))184mux.Handle("/gitpod.experimental.v1.UserService/DeleteSSHKey", connect_go.NewUnaryHandler(185"/gitpod.experimental.v1.UserService/DeleteSSHKey",186svc.DeleteSSHKey,187opts...,188))189mux.Handle("/gitpod.experimental.v1.UserService/GetGitToken", connect_go.NewUnaryHandler(190"/gitpod.experimental.v1.UserService/GetGitToken",191svc.GetGitToken,192opts...,193))194mux.Handle("/gitpod.experimental.v1.UserService/BlockUser", connect_go.NewUnaryHandler(195"/gitpod.experimental.v1.UserService/BlockUser",196svc.BlockUser,197opts...,198))199return "/gitpod.experimental.v1.UserService/", mux200}201202// UnimplementedUserServiceHandler returns CodeUnimplemented from all methods.203type UnimplementedUserServiceHandler struct{}204205func (UnimplementedUserServiceHandler) GetAuthenticatedUser(context.Context, *connect_go.Request[v1.GetAuthenticatedUserRequest]) (*connect_go.Response[v1.GetAuthenticatedUserResponse], error) {206return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.GetAuthenticatedUser is not implemented"))207}208209func (UnimplementedUserServiceHandler) ListSSHKeys(context.Context, *connect_go.Request[v1.ListSSHKeysRequest]) (*connect_go.Response[v1.ListSSHKeysResponse], error) {210return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.ListSSHKeys is not implemented"))211}212213func (UnimplementedUserServiceHandler) CreateSSHKey(context.Context, *connect_go.Request[v1.CreateSSHKeyRequest]) (*connect_go.Response[v1.CreateSSHKeyResponse], error) {214return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.CreateSSHKey is not implemented"))215}216217func (UnimplementedUserServiceHandler) GetSSHKey(context.Context, *connect_go.Request[v1.GetSSHKeyRequest]) (*connect_go.Response[v1.GetSSHKeyResponse], error) {218return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.GetSSHKey is not implemented"))219}220221func (UnimplementedUserServiceHandler) DeleteSSHKey(context.Context, *connect_go.Request[v1.DeleteSSHKeyRequest]) (*connect_go.Response[v1.DeleteSSHKeyResponse], error) {222return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.DeleteSSHKey is not implemented"))223}224225func (UnimplementedUserServiceHandler) GetGitToken(context.Context, *connect_go.Request[v1.GetGitTokenRequest]) (*connect_go.Response[v1.GetGitTokenResponse], error) {226return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.GetGitToken is not implemented"))227}228229func (UnimplementedUserServiceHandler) BlockUser(context.Context, *connect_go.Request[v1.BlockUserRequest]) (*connect_go.Response[v1.BlockUserResponse], error) {230return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.UserService.BlockUser is not implemented"))231}232233234