Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/public-api/go/v1/v1connect/verification.connect.go
2501 views
1
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
6
//
7
// Source: gitpod/v1/verification.proto
8
9
package v1connect
10
11
import (
12
context "context"
13
errors "errors"
14
connect_go "github.com/bufbuild/connect-go"
15
v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1"
16
http "net/http"
17
strings "strings"
18
)
19
20
// This is a compile-time assertion to ensure that this generated file and the connect package are
21
// compatible. If you get a compiler error that this constant is not defined, this code was
22
// generated with a version of connect newer than the one compiled into your binary. You can fix the
23
// problem by either regenerating this code with an older version of connect or updating the connect
24
// version compiled into your binary.
25
const _ = connect_go.IsAtLeastVersion0_1_0
26
27
const (
28
// VerificationServiceName is the fully-qualified name of the VerificationService service.
29
VerificationServiceName = "gitpod.v1.VerificationService"
30
)
31
32
// VerificationServiceClient is a client for the gitpod.v1.VerificationService service.
33
type VerificationServiceClient interface {
34
// SendPhoneNumberVerificationToken sends a verification token to the
35
// specified phone number.
36
SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error)
37
// VerifyPhoneNumberVerificationToken verifies the specified verification
38
// token.
39
VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error)
40
}
41
42
// NewVerificationServiceClient constructs a client for the gitpod.v1.VerificationService service.
43
// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped
44
// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
45
// 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).
49
func NewVerificationServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) VerificationServiceClient {
50
baseURL = strings.TrimRight(baseURL, "/")
51
return &verificationServiceClient{
52
sendPhoneNumberVerificationToken: connect_go.NewClient[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse](
53
httpClient,
54
baseURL+"/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken",
55
opts...,
56
),
57
verifyPhoneNumberVerificationToken: connect_go.NewClient[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse](
58
httpClient,
59
baseURL+"/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken",
60
opts...,
61
),
62
}
63
}
64
65
// verificationServiceClient implements VerificationServiceClient.
66
type verificationServiceClient struct {
67
sendPhoneNumberVerificationToken *connect_go.Client[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse]
68
verifyPhoneNumberVerificationToken *connect_go.Client[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse]
69
}
70
71
// SendPhoneNumberVerificationToken calls
72
// gitpod.v1.VerificationService.SendPhoneNumberVerificationToken.
73
func (c *verificationServiceClient) SendPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) {
74
return c.sendPhoneNumberVerificationToken.CallUnary(ctx, req)
75
}
76
77
// VerifyPhoneNumberVerificationToken calls
78
// gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken.
79
func (c *verificationServiceClient) VerifyPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) {
80
return c.verifyPhoneNumberVerificationToken.CallUnary(ctx, req)
81
}
82
83
// VerificationServiceHandler is an implementation of the gitpod.v1.VerificationService service.
84
type VerificationServiceHandler interface {
85
// SendPhoneNumberVerificationToken sends a verification token to the
86
// specified phone number.
87
SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error)
88
// VerifyPhoneNumberVerificationToken verifies the specified verification
89
// token.
90
VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error)
91
}
92
93
// NewVerificationServiceHandler builds an HTTP handler from the service implementation. It returns
94
// the path on which to mount the handler and the handler itself.
95
//
96
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
97
// and JSON codecs. They also support gzip compression.
98
func NewVerificationServiceHandler(svc VerificationServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
99
mux := http.NewServeMux()
100
mux.Handle("/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", connect_go.NewUnaryHandler(
101
"/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken",
102
svc.SendPhoneNumberVerificationToken,
103
opts...,
104
))
105
mux.Handle("/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", connect_go.NewUnaryHandler(
106
"/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken",
107
svc.VerifyPhoneNumberVerificationToken,
108
opts...,
109
))
110
return "/gitpod.v1.VerificationService/", mux
111
}
112
113
// UnimplementedVerificationServiceHandler returns CodeUnimplemented from all methods.
114
type UnimplementedVerificationServiceHandler struct{}
115
116
func (UnimplementedVerificationServiceHandler) SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) {
117
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.SendPhoneNumberVerificationToken is not implemented"))
118
}
119
120
func (UnimplementedVerificationServiceHandler) VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) {
121
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken is not implemented"))
122
}
123
124