Path: blob/main/components/public-api/go/v1/v1connect/verification.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/verification.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// VerificationServiceName is the fully-qualified name of the VerificationService service.28VerificationServiceName = "gitpod.v1.VerificationService"29)3031// VerificationServiceClient is a client for the gitpod.v1.VerificationService service.32type VerificationServiceClient interface {33// SendPhoneNumberVerificationToken sends a verification token to the34// specified phone number.35SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error)36// VerifyPhoneNumberVerificationToken verifies the specified verification37// token.38VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error)39}4041// NewVerificationServiceClient constructs a client for the gitpod.v1.VerificationService service.42// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped43// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the44// connect.WithGRPC() or connect.WithGRPCWeb() options.45//46// The URL supplied here should be the base URL for the Connect or gRPC server (for example,47// http://api.acme.com or https://acme.com/grpc).48func NewVerificationServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) VerificationServiceClient {49baseURL = strings.TrimRight(baseURL, "/")50return &verificationServiceClient{51sendPhoneNumberVerificationToken: connect_go.NewClient[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse](52httpClient,53baseURL+"/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken",54opts...,55),56verifyPhoneNumberVerificationToken: connect_go.NewClient[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse](57httpClient,58baseURL+"/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken",59opts...,60),61}62}6364// verificationServiceClient implements VerificationServiceClient.65type verificationServiceClient struct {66sendPhoneNumberVerificationToken *connect_go.Client[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse]67verifyPhoneNumberVerificationToken *connect_go.Client[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse]68}6970// SendPhoneNumberVerificationToken calls71// gitpod.v1.VerificationService.SendPhoneNumberVerificationToken.72func (c *verificationServiceClient) SendPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) {73return c.sendPhoneNumberVerificationToken.CallUnary(ctx, req)74}7576// VerifyPhoneNumberVerificationToken calls77// gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken.78func (c *verificationServiceClient) VerifyPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) {79return c.verifyPhoneNumberVerificationToken.CallUnary(ctx, req)80}8182// VerificationServiceHandler is an implementation of the gitpod.v1.VerificationService service.83type VerificationServiceHandler interface {84// SendPhoneNumberVerificationToken sends a verification token to the85// specified phone number.86SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error)87// VerifyPhoneNumberVerificationToken verifies the specified verification88// token.89VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error)90}9192// NewVerificationServiceHandler builds an HTTP handler from the service implementation. It returns93// the path on which to mount the handler and the handler itself.94//95// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf96// and JSON codecs. They also support gzip compression.97func NewVerificationServiceHandler(svc VerificationServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {98mux := http.NewServeMux()99mux.Handle("/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", connect_go.NewUnaryHandler(100"/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken",101svc.SendPhoneNumberVerificationToken,102opts...,103))104mux.Handle("/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", connect_go.NewUnaryHandler(105"/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken",106svc.VerifyPhoneNumberVerificationToken,107opts...,108))109return "/gitpod.v1.VerificationService/", mux110}111112// UnimplementedVerificationServiceHandler returns CodeUnimplemented from all methods.113type UnimplementedVerificationServiceHandler struct{}114115func (UnimplementedVerificationServiceHandler) SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) {116return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.SendPhoneNumberVerificationToken is not implemented"))117}118119func (UnimplementedVerificationServiceHandler) VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) {120return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken is not implemented"))121}122123124