-
Notifications
You must be signed in to change notification settings - Fork 0
/
tenant.connect.go
494 lines (456 loc) · 27.3 KB
/
tenant.connect.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: api/v1/tenant.proto
package apiv1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "github.com/metal-stack-cloud/api/go/api/v1"
http "net/http"
strings "strings"
)
// This is a compile-time assertion to ensure that this generated file and the connect package are
// compatible. If you get a compiler error that this constant is not defined, this code was
// generated with a version of connect newer than the one compiled into your binary. You can fix the
// problem by either regenerating this code with an older version of connect or updating the connect
// version compiled into your binary.
const _ = connect.IsAtLeastVersion1_13_0
const (
// TenantServiceName is the fully-qualified name of the TenantService service.
TenantServiceName = "api.v1.TenantService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// TenantServiceCreateProcedure is the fully-qualified name of the TenantService's Create RPC.
TenantServiceCreateProcedure = "/api.v1.TenantService/Create"
// TenantServiceCreateOrUpdateProcedure is the fully-qualified name of the TenantService's
// CreateOrUpdate RPC.
TenantServiceCreateOrUpdateProcedure = "/api.v1.TenantService/CreateOrUpdate"
// TenantServiceListProcedure is the fully-qualified name of the TenantService's List RPC.
TenantServiceListProcedure = "/api.v1.TenantService/List"
// TenantServiceGetProcedure is the fully-qualified name of the TenantService's Get RPC.
TenantServiceGetProcedure = "/api.v1.TenantService/Get"
// TenantServiceUpdateProcedure is the fully-qualified name of the TenantService's Update RPC.
TenantServiceUpdateProcedure = "/api.v1.TenantService/Update"
// TenantServiceDeleteProcedure is the fully-qualified name of the TenantService's Delete RPC.
TenantServiceDeleteProcedure = "/api.v1.TenantService/Delete"
// TenantServiceRemoveMemberProcedure is the fully-qualified name of the TenantService's
// RemoveMember RPC.
TenantServiceRemoveMemberProcedure = "/api.v1.TenantService/RemoveMember"
// TenantServiceUpdateMemberProcedure is the fully-qualified name of the TenantService's
// UpdateMember RPC.
TenantServiceUpdateMemberProcedure = "/api.v1.TenantService/UpdateMember"
// TenantServiceInviteProcedure is the fully-qualified name of the TenantService's Invite RPC.
TenantServiceInviteProcedure = "/api.v1.TenantService/Invite"
// TenantServiceInviteAcceptProcedure is the fully-qualified name of the TenantService's
// InviteAccept RPC.
TenantServiceInviteAcceptProcedure = "/api.v1.TenantService/InviteAccept"
// TenantServiceInviteDeleteProcedure is the fully-qualified name of the TenantService's
// InviteDelete RPC.
TenantServiceInviteDeleteProcedure = "/api.v1.TenantService/InviteDelete"
// TenantServiceInvitesListProcedure is the fully-qualified name of the TenantService's InvitesList
// RPC.
TenantServiceInvitesListProcedure = "/api.v1.TenantService/InvitesList"
// TenantServiceInviteGetProcedure is the fully-qualified name of the TenantService's InviteGet RPC.
TenantServiceInviteGetProcedure = "/api.v1.TenantService/InviteGet"
)
// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package.
var (
tenantServiceServiceDescriptor = v1.File_api_v1_tenant_proto.Services().ByName("TenantService")
tenantServiceCreateMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("Create")
tenantServiceCreateOrUpdateMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("CreateOrUpdate")
tenantServiceListMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("List")
tenantServiceGetMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("Get")
tenantServiceUpdateMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("Update")
tenantServiceDeleteMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("Delete")
tenantServiceRemoveMemberMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("RemoveMember")
tenantServiceUpdateMemberMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("UpdateMember")
tenantServiceInviteMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("Invite")
tenantServiceInviteAcceptMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("InviteAccept")
tenantServiceInviteDeleteMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("InviteDelete")
tenantServiceInvitesListMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("InvitesList")
tenantServiceInviteGetMethodDescriptor = tenantServiceServiceDescriptor.Methods().ByName("InviteGet")
)
// TenantServiceClient is a client for the api.v1.TenantService service.
type TenantServiceClient interface {
// Create a tenant
Create(context.Context, *connect.Request[v1.TenantServiceCreateRequest]) (*connect.Response[v1.TenantServiceCreateResponse], error)
// CreateOrUpdate should only be used from within the application
// will check if tenant already exists and updates if necessary, otherwise create a new tenant
CreateOrUpdate(context.Context, *connect.Request[v1.TenantServiceCreateOrUpdateRequest]) (*connect.Response[v1.TenantServiceCreateOrUpdateResponse], error)
// List tenants
List(context.Context, *connect.Request[v1.TenantServiceListRequest]) (*connect.Response[v1.TenantServiceListResponse], error)
// Get a tenant
Get(context.Context, *connect.Request[v1.TenantServiceGetRequest]) (*connect.Response[v1.TenantServiceGetResponse], error)
// Update a tenant
Update(context.Context, *connect.Request[v1.TenantServiceUpdateRequest]) (*connect.Response[v1.TenantServiceUpdateResponse], error)
// Delete a tenant
Delete(context.Context, *connect.Request[v1.TenantServiceDeleteRequest]) (*connect.Response[v1.TenantServiceDeleteResponse], error)
// RemoveMember remove a member of a tenant
RemoveMember(context.Context, *connect.Request[v1.TenantServiceRemoveMemberRequest]) (*connect.Response[v1.TenantServiceRemoveMemberResponse], error)
// UpdateMember update a member of a tenant
UpdateMember(context.Context, *connect.Request[v1.TenantServiceUpdateMemberRequest]) (*connect.Response[v1.TenantServiceUpdateMemberResponse], error)
// Invite a user to a tenant
Invite(context.Context, *connect.Request[v1.TenantServiceInviteRequest]) (*connect.Response[v1.TenantServiceInviteResponse], error)
// InviteAccept is called from a user to accept an invitation
InviteAccept(context.Context, *connect.Request[v1.TenantServiceInviteAcceptRequest]) (*connect.Response[v1.TenantServiceInviteAcceptResponse], error)
// InviteDelete deletes a pending invitation
InviteDelete(context.Context, *connect.Request[v1.TenantServiceInviteDeleteRequest]) (*connect.Response[v1.TenantServiceInviteDeleteResponse], error)
// InvitesList list all invites to a tenant
InvitesList(context.Context, *connect.Request[v1.TenantServiceInvitesListRequest]) (*connect.Response[v1.TenantServiceInvitesListResponse], error)
// InviteGet get an invite
InviteGet(context.Context, *connect.Request[v1.TenantServiceInviteGetRequest]) (*connect.Response[v1.TenantServiceInviteGetResponse], error)
}
// NewTenantServiceClient constructs a client for the api.v1.TenantService service. By default, it
// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
// connect.WithGRPCWeb() options.
//
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
// http://api.acme.com or https://acme.com/grpc).
func NewTenantServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TenantServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
return &tenantServiceClient{
create: connect.NewClient[v1.TenantServiceCreateRequest, v1.TenantServiceCreateResponse](
httpClient,
baseURL+TenantServiceCreateProcedure,
connect.WithSchema(tenantServiceCreateMethodDescriptor),
connect.WithClientOptions(opts...),
),
createOrUpdate: connect.NewClient[v1.TenantServiceCreateOrUpdateRequest, v1.TenantServiceCreateOrUpdateResponse](
httpClient,
baseURL+TenantServiceCreateOrUpdateProcedure,
connect.WithSchema(tenantServiceCreateOrUpdateMethodDescriptor),
connect.WithClientOptions(opts...),
),
list: connect.NewClient[v1.TenantServiceListRequest, v1.TenantServiceListResponse](
httpClient,
baseURL+TenantServiceListProcedure,
connect.WithSchema(tenantServiceListMethodDescriptor),
connect.WithClientOptions(opts...),
),
get: connect.NewClient[v1.TenantServiceGetRequest, v1.TenantServiceGetResponse](
httpClient,
baseURL+TenantServiceGetProcedure,
connect.WithSchema(tenantServiceGetMethodDescriptor),
connect.WithClientOptions(opts...),
),
update: connect.NewClient[v1.TenantServiceUpdateRequest, v1.TenantServiceUpdateResponse](
httpClient,
baseURL+TenantServiceUpdateProcedure,
connect.WithSchema(tenantServiceUpdateMethodDescriptor),
connect.WithClientOptions(opts...),
),
delete: connect.NewClient[v1.TenantServiceDeleteRequest, v1.TenantServiceDeleteResponse](
httpClient,
baseURL+TenantServiceDeleteProcedure,
connect.WithSchema(tenantServiceDeleteMethodDescriptor),
connect.WithClientOptions(opts...),
),
removeMember: connect.NewClient[v1.TenantServiceRemoveMemberRequest, v1.TenantServiceRemoveMemberResponse](
httpClient,
baseURL+TenantServiceRemoveMemberProcedure,
connect.WithSchema(tenantServiceRemoveMemberMethodDescriptor),
connect.WithClientOptions(opts...),
),
updateMember: connect.NewClient[v1.TenantServiceUpdateMemberRequest, v1.TenantServiceUpdateMemberResponse](
httpClient,
baseURL+TenantServiceUpdateMemberProcedure,
connect.WithSchema(tenantServiceUpdateMemberMethodDescriptor),
connect.WithClientOptions(opts...),
),
invite: connect.NewClient[v1.TenantServiceInviteRequest, v1.TenantServiceInviteResponse](
httpClient,
baseURL+TenantServiceInviteProcedure,
connect.WithSchema(tenantServiceInviteMethodDescriptor),
connect.WithClientOptions(opts...),
),
inviteAccept: connect.NewClient[v1.TenantServiceInviteAcceptRequest, v1.TenantServiceInviteAcceptResponse](
httpClient,
baseURL+TenantServiceInviteAcceptProcedure,
connect.WithSchema(tenantServiceInviteAcceptMethodDescriptor),
connect.WithClientOptions(opts...),
),
inviteDelete: connect.NewClient[v1.TenantServiceInviteDeleteRequest, v1.TenantServiceInviteDeleteResponse](
httpClient,
baseURL+TenantServiceInviteDeleteProcedure,
connect.WithSchema(tenantServiceInviteDeleteMethodDescriptor),
connect.WithClientOptions(opts...),
),
invitesList: connect.NewClient[v1.TenantServiceInvitesListRequest, v1.TenantServiceInvitesListResponse](
httpClient,
baseURL+TenantServiceInvitesListProcedure,
connect.WithSchema(tenantServiceInvitesListMethodDescriptor),
connect.WithClientOptions(opts...),
),
inviteGet: connect.NewClient[v1.TenantServiceInviteGetRequest, v1.TenantServiceInviteGetResponse](
httpClient,
baseURL+TenantServiceInviteGetProcedure,
connect.WithSchema(tenantServiceInviteGetMethodDescriptor),
connect.WithClientOptions(opts...),
),
}
}
// tenantServiceClient implements TenantServiceClient.
type tenantServiceClient struct {
create *connect.Client[v1.TenantServiceCreateRequest, v1.TenantServiceCreateResponse]
createOrUpdate *connect.Client[v1.TenantServiceCreateOrUpdateRequest, v1.TenantServiceCreateOrUpdateResponse]
list *connect.Client[v1.TenantServiceListRequest, v1.TenantServiceListResponse]
get *connect.Client[v1.TenantServiceGetRequest, v1.TenantServiceGetResponse]
update *connect.Client[v1.TenantServiceUpdateRequest, v1.TenantServiceUpdateResponse]
delete *connect.Client[v1.TenantServiceDeleteRequest, v1.TenantServiceDeleteResponse]
removeMember *connect.Client[v1.TenantServiceRemoveMemberRequest, v1.TenantServiceRemoveMemberResponse]
updateMember *connect.Client[v1.TenantServiceUpdateMemberRequest, v1.TenantServiceUpdateMemberResponse]
invite *connect.Client[v1.TenantServiceInviteRequest, v1.TenantServiceInviteResponse]
inviteAccept *connect.Client[v1.TenantServiceInviteAcceptRequest, v1.TenantServiceInviteAcceptResponse]
inviteDelete *connect.Client[v1.TenantServiceInviteDeleteRequest, v1.TenantServiceInviteDeleteResponse]
invitesList *connect.Client[v1.TenantServiceInvitesListRequest, v1.TenantServiceInvitesListResponse]
inviteGet *connect.Client[v1.TenantServiceInviteGetRequest, v1.TenantServiceInviteGetResponse]
}
// Create calls api.v1.TenantService.Create.
func (c *tenantServiceClient) Create(ctx context.Context, req *connect.Request[v1.TenantServiceCreateRequest]) (*connect.Response[v1.TenantServiceCreateResponse], error) {
return c.create.CallUnary(ctx, req)
}
// CreateOrUpdate calls api.v1.TenantService.CreateOrUpdate.
func (c *tenantServiceClient) CreateOrUpdate(ctx context.Context, req *connect.Request[v1.TenantServiceCreateOrUpdateRequest]) (*connect.Response[v1.TenantServiceCreateOrUpdateResponse], error) {
return c.createOrUpdate.CallUnary(ctx, req)
}
// List calls api.v1.TenantService.List.
func (c *tenantServiceClient) List(ctx context.Context, req *connect.Request[v1.TenantServiceListRequest]) (*connect.Response[v1.TenantServiceListResponse], error) {
return c.list.CallUnary(ctx, req)
}
// Get calls api.v1.TenantService.Get.
func (c *tenantServiceClient) Get(ctx context.Context, req *connect.Request[v1.TenantServiceGetRequest]) (*connect.Response[v1.TenantServiceGetResponse], error) {
return c.get.CallUnary(ctx, req)
}
// Update calls api.v1.TenantService.Update.
func (c *tenantServiceClient) Update(ctx context.Context, req *connect.Request[v1.TenantServiceUpdateRequest]) (*connect.Response[v1.TenantServiceUpdateResponse], error) {
return c.update.CallUnary(ctx, req)
}
// Delete calls api.v1.TenantService.Delete.
func (c *tenantServiceClient) Delete(ctx context.Context, req *connect.Request[v1.TenantServiceDeleteRequest]) (*connect.Response[v1.TenantServiceDeleteResponse], error) {
return c.delete.CallUnary(ctx, req)
}
// RemoveMember calls api.v1.TenantService.RemoveMember.
func (c *tenantServiceClient) RemoveMember(ctx context.Context, req *connect.Request[v1.TenantServiceRemoveMemberRequest]) (*connect.Response[v1.TenantServiceRemoveMemberResponse], error) {
return c.removeMember.CallUnary(ctx, req)
}
// UpdateMember calls api.v1.TenantService.UpdateMember.
func (c *tenantServiceClient) UpdateMember(ctx context.Context, req *connect.Request[v1.TenantServiceUpdateMemberRequest]) (*connect.Response[v1.TenantServiceUpdateMemberResponse], error) {
return c.updateMember.CallUnary(ctx, req)
}
// Invite calls api.v1.TenantService.Invite.
func (c *tenantServiceClient) Invite(ctx context.Context, req *connect.Request[v1.TenantServiceInviteRequest]) (*connect.Response[v1.TenantServiceInviteResponse], error) {
return c.invite.CallUnary(ctx, req)
}
// InviteAccept calls api.v1.TenantService.InviteAccept.
func (c *tenantServiceClient) InviteAccept(ctx context.Context, req *connect.Request[v1.TenantServiceInviteAcceptRequest]) (*connect.Response[v1.TenantServiceInviteAcceptResponse], error) {
return c.inviteAccept.CallUnary(ctx, req)
}
// InviteDelete calls api.v1.TenantService.InviteDelete.
func (c *tenantServiceClient) InviteDelete(ctx context.Context, req *connect.Request[v1.TenantServiceInviteDeleteRequest]) (*connect.Response[v1.TenantServiceInviteDeleteResponse], error) {
return c.inviteDelete.CallUnary(ctx, req)
}
// InvitesList calls api.v1.TenantService.InvitesList.
func (c *tenantServiceClient) InvitesList(ctx context.Context, req *connect.Request[v1.TenantServiceInvitesListRequest]) (*connect.Response[v1.TenantServiceInvitesListResponse], error) {
return c.invitesList.CallUnary(ctx, req)
}
// InviteGet calls api.v1.TenantService.InviteGet.
func (c *tenantServiceClient) InviteGet(ctx context.Context, req *connect.Request[v1.TenantServiceInviteGetRequest]) (*connect.Response[v1.TenantServiceInviteGetResponse], error) {
return c.inviteGet.CallUnary(ctx, req)
}
// TenantServiceHandler is an implementation of the api.v1.TenantService service.
type TenantServiceHandler interface {
// Create a tenant
Create(context.Context, *connect.Request[v1.TenantServiceCreateRequest]) (*connect.Response[v1.TenantServiceCreateResponse], error)
// CreateOrUpdate should only be used from within the application
// will check if tenant already exists and updates if necessary, otherwise create a new tenant
CreateOrUpdate(context.Context, *connect.Request[v1.TenantServiceCreateOrUpdateRequest]) (*connect.Response[v1.TenantServiceCreateOrUpdateResponse], error)
// List tenants
List(context.Context, *connect.Request[v1.TenantServiceListRequest]) (*connect.Response[v1.TenantServiceListResponse], error)
// Get a tenant
Get(context.Context, *connect.Request[v1.TenantServiceGetRequest]) (*connect.Response[v1.TenantServiceGetResponse], error)
// Update a tenant
Update(context.Context, *connect.Request[v1.TenantServiceUpdateRequest]) (*connect.Response[v1.TenantServiceUpdateResponse], error)
// Delete a tenant
Delete(context.Context, *connect.Request[v1.TenantServiceDeleteRequest]) (*connect.Response[v1.TenantServiceDeleteResponse], error)
// RemoveMember remove a member of a tenant
RemoveMember(context.Context, *connect.Request[v1.TenantServiceRemoveMemberRequest]) (*connect.Response[v1.TenantServiceRemoveMemberResponse], error)
// UpdateMember update a member of a tenant
UpdateMember(context.Context, *connect.Request[v1.TenantServiceUpdateMemberRequest]) (*connect.Response[v1.TenantServiceUpdateMemberResponse], error)
// Invite a user to a tenant
Invite(context.Context, *connect.Request[v1.TenantServiceInviteRequest]) (*connect.Response[v1.TenantServiceInviteResponse], error)
// InviteAccept is called from a user to accept an invitation
InviteAccept(context.Context, *connect.Request[v1.TenantServiceInviteAcceptRequest]) (*connect.Response[v1.TenantServiceInviteAcceptResponse], error)
// InviteDelete deletes a pending invitation
InviteDelete(context.Context, *connect.Request[v1.TenantServiceInviteDeleteRequest]) (*connect.Response[v1.TenantServiceInviteDeleteResponse], error)
// InvitesList list all invites to a tenant
InvitesList(context.Context, *connect.Request[v1.TenantServiceInvitesListRequest]) (*connect.Response[v1.TenantServiceInvitesListResponse], error)
// InviteGet get an invite
InviteGet(context.Context, *connect.Request[v1.TenantServiceInviteGetRequest]) (*connect.Response[v1.TenantServiceInviteGetResponse], error)
}
// NewTenantServiceHandler builds an HTTP handler from the service implementation. It returns the
// path on which to mount the handler and the handler itself.
//
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
// and JSON codecs. They also support gzip compression.
func NewTenantServiceHandler(svc TenantServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
tenantServiceCreateHandler := connect.NewUnaryHandler(
TenantServiceCreateProcedure,
svc.Create,
connect.WithSchema(tenantServiceCreateMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceCreateOrUpdateHandler := connect.NewUnaryHandler(
TenantServiceCreateOrUpdateProcedure,
svc.CreateOrUpdate,
connect.WithSchema(tenantServiceCreateOrUpdateMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceListHandler := connect.NewUnaryHandler(
TenantServiceListProcedure,
svc.List,
connect.WithSchema(tenantServiceListMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceGetHandler := connect.NewUnaryHandler(
TenantServiceGetProcedure,
svc.Get,
connect.WithSchema(tenantServiceGetMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceUpdateHandler := connect.NewUnaryHandler(
TenantServiceUpdateProcedure,
svc.Update,
connect.WithSchema(tenantServiceUpdateMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceDeleteHandler := connect.NewUnaryHandler(
TenantServiceDeleteProcedure,
svc.Delete,
connect.WithSchema(tenantServiceDeleteMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceRemoveMemberHandler := connect.NewUnaryHandler(
TenantServiceRemoveMemberProcedure,
svc.RemoveMember,
connect.WithSchema(tenantServiceRemoveMemberMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceUpdateMemberHandler := connect.NewUnaryHandler(
TenantServiceUpdateMemberProcedure,
svc.UpdateMember,
connect.WithSchema(tenantServiceUpdateMemberMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceInviteHandler := connect.NewUnaryHandler(
TenantServiceInviteProcedure,
svc.Invite,
connect.WithSchema(tenantServiceInviteMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceInviteAcceptHandler := connect.NewUnaryHandler(
TenantServiceInviteAcceptProcedure,
svc.InviteAccept,
connect.WithSchema(tenantServiceInviteAcceptMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceInviteDeleteHandler := connect.NewUnaryHandler(
TenantServiceInviteDeleteProcedure,
svc.InviteDelete,
connect.WithSchema(tenantServiceInviteDeleteMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceInvitesListHandler := connect.NewUnaryHandler(
TenantServiceInvitesListProcedure,
svc.InvitesList,
connect.WithSchema(tenantServiceInvitesListMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
tenantServiceInviteGetHandler := connect.NewUnaryHandler(
TenantServiceInviteGetProcedure,
svc.InviteGet,
connect.WithSchema(tenantServiceInviteGetMethodDescriptor),
connect.WithHandlerOptions(opts...),
)
return "/api.v1.TenantService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case TenantServiceCreateProcedure:
tenantServiceCreateHandler.ServeHTTP(w, r)
case TenantServiceCreateOrUpdateProcedure:
tenantServiceCreateOrUpdateHandler.ServeHTTP(w, r)
case TenantServiceListProcedure:
tenantServiceListHandler.ServeHTTP(w, r)
case TenantServiceGetProcedure:
tenantServiceGetHandler.ServeHTTP(w, r)
case TenantServiceUpdateProcedure:
tenantServiceUpdateHandler.ServeHTTP(w, r)
case TenantServiceDeleteProcedure:
tenantServiceDeleteHandler.ServeHTTP(w, r)
case TenantServiceRemoveMemberProcedure:
tenantServiceRemoveMemberHandler.ServeHTTP(w, r)
case TenantServiceUpdateMemberProcedure:
tenantServiceUpdateMemberHandler.ServeHTTP(w, r)
case TenantServiceInviteProcedure:
tenantServiceInviteHandler.ServeHTTP(w, r)
case TenantServiceInviteAcceptProcedure:
tenantServiceInviteAcceptHandler.ServeHTTP(w, r)
case TenantServiceInviteDeleteProcedure:
tenantServiceInviteDeleteHandler.ServeHTTP(w, r)
case TenantServiceInvitesListProcedure:
tenantServiceInvitesListHandler.ServeHTTP(w, r)
case TenantServiceInviteGetProcedure:
tenantServiceInviteGetHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedTenantServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedTenantServiceHandler struct{}
func (UnimplementedTenantServiceHandler) Create(context.Context, *connect.Request[v1.TenantServiceCreateRequest]) (*connect.Response[v1.TenantServiceCreateResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.Create is not implemented"))
}
func (UnimplementedTenantServiceHandler) CreateOrUpdate(context.Context, *connect.Request[v1.TenantServiceCreateOrUpdateRequest]) (*connect.Response[v1.TenantServiceCreateOrUpdateResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.CreateOrUpdate is not implemented"))
}
func (UnimplementedTenantServiceHandler) List(context.Context, *connect.Request[v1.TenantServiceListRequest]) (*connect.Response[v1.TenantServiceListResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.List is not implemented"))
}
func (UnimplementedTenantServiceHandler) Get(context.Context, *connect.Request[v1.TenantServiceGetRequest]) (*connect.Response[v1.TenantServiceGetResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.Get is not implemented"))
}
func (UnimplementedTenantServiceHandler) Update(context.Context, *connect.Request[v1.TenantServiceUpdateRequest]) (*connect.Response[v1.TenantServiceUpdateResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.Update is not implemented"))
}
func (UnimplementedTenantServiceHandler) Delete(context.Context, *connect.Request[v1.TenantServiceDeleteRequest]) (*connect.Response[v1.TenantServiceDeleteResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.Delete is not implemented"))
}
func (UnimplementedTenantServiceHandler) RemoveMember(context.Context, *connect.Request[v1.TenantServiceRemoveMemberRequest]) (*connect.Response[v1.TenantServiceRemoveMemberResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.RemoveMember is not implemented"))
}
func (UnimplementedTenantServiceHandler) UpdateMember(context.Context, *connect.Request[v1.TenantServiceUpdateMemberRequest]) (*connect.Response[v1.TenantServiceUpdateMemberResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.UpdateMember is not implemented"))
}
func (UnimplementedTenantServiceHandler) Invite(context.Context, *connect.Request[v1.TenantServiceInviteRequest]) (*connect.Response[v1.TenantServiceInviteResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.Invite is not implemented"))
}
func (UnimplementedTenantServiceHandler) InviteAccept(context.Context, *connect.Request[v1.TenantServiceInviteAcceptRequest]) (*connect.Response[v1.TenantServiceInviteAcceptResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.InviteAccept is not implemented"))
}
func (UnimplementedTenantServiceHandler) InviteDelete(context.Context, *connect.Request[v1.TenantServiceInviteDeleteRequest]) (*connect.Response[v1.TenantServiceInviteDeleteResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.InviteDelete is not implemented"))
}
func (UnimplementedTenantServiceHandler) InvitesList(context.Context, *connect.Request[v1.TenantServiceInvitesListRequest]) (*connect.Response[v1.TenantServiceInvitesListResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.InvitesList is not implemented"))
}
func (UnimplementedTenantServiceHandler) InviteGet(context.Context, *connect.Request[v1.TenantServiceInviteGetRequest]) (*connect.Response[v1.TenantServiceInviteGetResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("api.v1.TenantService.InviteGet is not implemented"))
}