Passed
Push — master ( 09f49b...fd2e87 )
by Tolga
01:35
created

basev1.request_Data_ReadAttributes_0   B

Complexity

Conditions 6

Size

Total Lines 22
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 17
nop 5
dl 0
loc 22
rs 8.6166
c 0
b 0
f 0
1
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
2
// source: base/v1/service.proto
3
4
/*
5
Package basev1 is a reverse proxy.
6
7
It translates gRPC into RESTful JSON APIs.
8
*/
9
package basev1
10
11
import (
12
	"context"
13
	"errors"
14
	"io"
15
	"net/http"
16
17
	"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
18
	"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
19
	"google.golang.org/grpc"
20
	"google.golang.org/grpc/codes"
21
	"google.golang.org/grpc/grpclog"
22
	"google.golang.org/grpc/metadata"
23
	"google.golang.org/grpc/status"
24
	"google.golang.org/protobuf/proto"
25
)
26
27
// Suppress "imported and not used" errors
28
var (
29
	_ codes.Code
30
	_ io.Reader
31
	_ status.Status
32
	_ = errors.New
33
	_ = runtime.String
34
	_ = utilities.NewDoubleArray
35
	_ = metadata.Join
36
)
37
38
func request_Permission_Check_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
39
	var (
40
		protoReq PermissionCheckRequest
41
		metadata runtime.ServerMetadata
42
		err      error
43
	)
44
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
45
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
46
	}
47
	if req.Body != nil {
48
		_, _ = io.Copy(io.Discard, req.Body)
49
	}
50
	val, ok := pathParams["tenant_id"]
51
	if !ok {
52
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
53
	}
54
	protoReq.TenantId, err = runtime.String(val)
55
	if err != nil {
56
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
57
	}
58
	msg, err := client.Check(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
59
	return msg, metadata, err
60
}
61
62
func local_request_Permission_Check_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
63
	var (
64
		protoReq PermissionCheckRequest
65
		metadata runtime.ServerMetadata
66
		err      error
67
	)
68
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
69
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
70
	}
71
	val, ok := pathParams["tenant_id"]
72
	if !ok {
73
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
74
	}
75
	protoReq.TenantId, err = runtime.String(val)
76
	if err != nil {
77
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
78
	}
79
	msg, err := server.Check(ctx, &protoReq)
80
	return msg, metadata, err
81
}
82
83
func request_Permission_Expand_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
84
	var (
85
		protoReq PermissionExpandRequest
86
		metadata runtime.ServerMetadata
87
		err      error
88
	)
89
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
90
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
91
	}
92
	if req.Body != nil {
93
		_, _ = io.Copy(io.Discard, req.Body)
94
	}
95
	val, ok := pathParams["tenant_id"]
96
	if !ok {
97
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
98
	}
99
	protoReq.TenantId, err = runtime.String(val)
100
	if err != nil {
101
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
102
	}
103
	msg, err := client.Expand(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
104
	return msg, metadata, err
105
}
106
107
func local_request_Permission_Expand_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
108
	var (
109
		protoReq PermissionExpandRequest
110
		metadata runtime.ServerMetadata
111
		err      error
112
	)
113
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
114
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
115
	}
116
	val, ok := pathParams["tenant_id"]
117
	if !ok {
118
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
119
	}
120
	protoReq.TenantId, err = runtime.String(val)
121
	if err != nil {
122
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
123
	}
124
	msg, err := server.Expand(ctx, &protoReq)
125
	return msg, metadata, err
126
}
127
128
func request_Permission_LookupEntity_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
129
	var (
130
		protoReq PermissionLookupEntityRequest
131
		metadata runtime.ServerMetadata
132
		err      error
133
	)
134
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
135
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
136
	}
137
	if req.Body != nil {
138
		_, _ = io.Copy(io.Discard, req.Body)
139
	}
140
	val, ok := pathParams["tenant_id"]
141
	if !ok {
142
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
143
	}
144
	protoReq.TenantId, err = runtime.String(val)
145
	if err != nil {
146
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
147
	}
148
	msg, err := client.LookupEntity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
149
	return msg, metadata, err
150
}
151
152
func local_request_Permission_LookupEntity_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
153
	var (
154
		protoReq PermissionLookupEntityRequest
155
		metadata runtime.ServerMetadata
156
		err      error
157
	)
158
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
159
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
160
	}
161
	val, ok := pathParams["tenant_id"]
162
	if !ok {
163
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
164
	}
165
	protoReq.TenantId, err = runtime.String(val)
166
	if err != nil {
167
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
168
	}
169
	msg, err := server.LookupEntity(ctx, &protoReq)
170
	return msg, metadata, err
171
}
172
173
func request_Permission_LookupEntityStream_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionClient, req *http.Request, pathParams map[string]string) (Permission_LookupEntityStreamClient, runtime.ServerMetadata, error) {
174
	var (
175
		protoReq PermissionLookupEntityRequest
176
		metadata runtime.ServerMetadata
177
		err      error
178
	)
179
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
180
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
181
	}
182
	if req.Body != nil {
183
		_, _ = io.Copy(io.Discard, req.Body)
184
	}
185
	val, ok := pathParams["tenant_id"]
186
	if !ok {
187
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
188
	}
189
	protoReq.TenantId, err = runtime.String(val)
190
	if err != nil {
191
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
192
	}
193
	stream, err := client.LookupEntityStream(ctx, &protoReq)
194
	if err != nil {
195
		return nil, metadata, err
196
	}
197
	header, err := stream.Header()
198
	if err != nil {
199
		return nil, metadata, err
200
	}
201
	metadata.HeaderMD = header
202
	return stream, metadata, nil
203
}
204
205
func request_Permission_LookupSubject_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
206
	var (
207
		protoReq PermissionLookupSubjectRequest
208
		metadata runtime.ServerMetadata
209
		err      error
210
	)
211
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
212
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
213
	}
214
	if req.Body != nil {
215
		_, _ = io.Copy(io.Discard, req.Body)
216
	}
217
	val, ok := pathParams["tenant_id"]
218
	if !ok {
219
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
220
	}
221
	protoReq.TenantId, err = runtime.String(val)
222
	if err != nil {
223
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
224
	}
225
	msg, err := client.LookupSubject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
226
	return msg, metadata, err
227
}
228
229
func local_request_Permission_LookupSubject_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
230
	var (
231
		protoReq PermissionLookupSubjectRequest
232
		metadata runtime.ServerMetadata
233
		err      error
234
	)
235
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
236
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
237
	}
238
	val, ok := pathParams["tenant_id"]
239
	if !ok {
240
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
241
	}
242
	protoReq.TenantId, err = runtime.String(val)
243
	if err != nil {
244
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
245
	}
246
	msg, err := server.LookupSubject(ctx, &protoReq)
247
	return msg, metadata, err
248
}
249
250
func request_Permission_SubjectPermission_0(ctx context.Context, marshaler runtime.Marshaler, client PermissionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
251
	var (
252
		protoReq PermissionSubjectPermissionRequest
253
		metadata runtime.ServerMetadata
254
		err      error
255
	)
256
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
257
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
258
	}
259
	if req.Body != nil {
260
		_, _ = io.Copy(io.Discard, req.Body)
261
	}
262
	val, ok := pathParams["tenant_id"]
263
	if !ok {
264
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
265
	}
266
	protoReq.TenantId, err = runtime.String(val)
267
	if err != nil {
268
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
269
	}
270
	msg, err := client.SubjectPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
271
	return msg, metadata, err
272
}
273
274
func local_request_Permission_SubjectPermission_0(ctx context.Context, marshaler runtime.Marshaler, server PermissionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
275
	var (
276
		protoReq PermissionSubjectPermissionRequest
277
		metadata runtime.ServerMetadata
278
		err      error
279
	)
280
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
281
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
282
	}
283
	val, ok := pathParams["tenant_id"]
284
	if !ok {
285
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
286
	}
287
	protoReq.TenantId, err = runtime.String(val)
288
	if err != nil {
289
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
290
	}
291
	msg, err := server.SubjectPermission(ctx, &protoReq)
292
	return msg, metadata, err
293
}
294
295
func request_Watch_Watch_0(ctx context.Context, marshaler runtime.Marshaler, client WatchClient, req *http.Request, pathParams map[string]string) (Watch_WatchClient, runtime.ServerMetadata, error) {
296
	var (
297
		protoReq WatchRequest
298
		metadata runtime.ServerMetadata
299
		err      error
300
	)
301
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
302
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
303
	}
304
	if req.Body != nil {
305
		_, _ = io.Copy(io.Discard, req.Body)
306
	}
307
	val, ok := pathParams["tenant_id"]
308
	if !ok {
309
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
310
	}
311
	protoReq.TenantId, err = runtime.String(val)
312
	if err != nil {
313
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
314
	}
315
	stream, err := client.Watch(ctx, &protoReq)
316
	if err != nil {
317
		return nil, metadata, err
318
	}
319
	header, err := stream.Header()
320
	if err != nil {
321
		return nil, metadata, err
322
	}
323
	metadata.HeaderMD = header
324
	return stream, metadata, nil
325
}
326
327
func request_Schema_Write_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
328
	var (
329
		protoReq SchemaWriteRequest
330
		metadata runtime.ServerMetadata
331
		err      error
332
	)
333
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
334
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
335
	}
336
	if req.Body != nil {
337
		_, _ = io.Copy(io.Discard, req.Body)
338
	}
339
	val, ok := pathParams["tenant_id"]
340
	if !ok {
341
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
342
	}
343
	protoReq.TenantId, err = runtime.String(val)
344
	if err != nil {
345
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
346
	}
347
	msg, err := client.Write(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
348
	return msg, metadata, err
349
}
350
351
func local_request_Schema_Write_0(ctx context.Context, marshaler runtime.Marshaler, server SchemaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
352
	var (
353
		protoReq SchemaWriteRequest
354
		metadata runtime.ServerMetadata
355
		err      error
356
	)
357
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
358
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
359
	}
360
	val, ok := pathParams["tenant_id"]
361
	if !ok {
362
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
363
	}
364
	protoReq.TenantId, err = runtime.String(val)
365
	if err != nil {
366
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
367
	}
368
	msg, err := server.Write(ctx, &protoReq)
369
	return msg, metadata, err
370
}
371
372
func request_Schema_PartialWrite_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
373
	var (
374
		protoReq SchemaPartialWriteRequest
375
		metadata runtime.ServerMetadata
376
		err      error
377
	)
378
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
379
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
380
	}
381
	if req.Body != nil {
382
		_, _ = io.Copy(io.Discard, req.Body)
383
	}
384
	val, ok := pathParams["tenant_id"]
385
	if !ok {
386
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
387
	}
388
	protoReq.TenantId, err = runtime.String(val)
389
	if err != nil {
390
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
391
	}
392
	msg, err := client.PartialWrite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
393
	return msg, metadata, err
394
}
395
396
func local_request_Schema_PartialWrite_0(ctx context.Context, marshaler runtime.Marshaler, server SchemaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
397
	var (
398
		protoReq SchemaPartialWriteRequest
399
		metadata runtime.ServerMetadata
400
		err      error
401
	)
402
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
403
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
404
	}
405
	val, ok := pathParams["tenant_id"]
406
	if !ok {
407
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
408
	}
409
	protoReq.TenantId, err = runtime.String(val)
410
	if err != nil {
411
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
412
	}
413
	msg, err := server.PartialWrite(ctx, &protoReq)
414
	return msg, metadata, err
415
}
416
417
func request_Schema_Read_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
418
	var (
419
		protoReq SchemaReadRequest
420
		metadata runtime.ServerMetadata
421
		err      error
422
	)
423
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
424
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
425
	}
426
	if req.Body != nil {
427
		_, _ = io.Copy(io.Discard, req.Body)
428
	}
429
	val, ok := pathParams["tenant_id"]
430
	if !ok {
431
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
432
	}
433
	protoReq.TenantId, err = runtime.String(val)
434
	if err != nil {
435
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
436
	}
437
	msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
438
	return msg, metadata, err
439
}
440
441
func local_request_Schema_Read_0(ctx context.Context, marshaler runtime.Marshaler, server SchemaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
442
	var (
443
		protoReq SchemaReadRequest
444
		metadata runtime.ServerMetadata
445
		err      error
446
	)
447
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
448
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
449
	}
450
	val, ok := pathParams["tenant_id"]
451
	if !ok {
452
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
453
	}
454
	protoReq.TenantId, err = runtime.String(val)
455
	if err != nil {
456
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
457
	}
458
	msg, err := server.Read(ctx, &protoReq)
459
	return msg, metadata, err
460
}
461
462
func request_Schema_List_0(ctx context.Context, marshaler runtime.Marshaler, client SchemaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
463
	var (
464
		protoReq SchemaListRequest
465
		metadata runtime.ServerMetadata
466
		err      error
467
	)
468
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
469
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
470
	}
471
	if req.Body != nil {
472
		_, _ = io.Copy(io.Discard, req.Body)
473
	}
474
	val, ok := pathParams["tenant_id"]
475
	if !ok {
476
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
477
	}
478
	protoReq.TenantId, err = runtime.String(val)
479
	if err != nil {
480
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
481
	}
482
	msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
483
	return msg, metadata, err
484
}
485
486
func local_request_Schema_List_0(ctx context.Context, marshaler runtime.Marshaler, server SchemaServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
487
	var (
488
		protoReq SchemaListRequest
489
		metadata runtime.ServerMetadata
490
		err      error
491
	)
492
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
493
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
494
	}
495
	val, ok := pathParams["tenant_id"]
496
	if !ok {
497
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
498
	}
499
	protoReq.TenantId, err = runtime.String(val)
500
	if err != nil {
501
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
502
	}
503
	msg, err := server.List(ctx, &protoReq)
504
	return msg, metadata, err
505
}
506
507
func request_Data_Write_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
508
	var (
509
		protoReq DataWriteRequest
510
		metadata runtime.ServerMetadata
511
		err      error
512
	)
513
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
514
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
515
	}
516
	if req.Body != nil {
517
		_, _ = io.Copy(io.Discard, req.Body)
518
	}
519
	val, ok := pathParams["tenant_id"]
520
	if !ok {
521
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
522
	}
523
	protoReq.TenantId, err = runtime.String(val)
524
	if err != nil {
525
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
526
	}
527
	msg, err := client.Write(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
528
	return msg, metadata, err
529
}
530
531
func local_request_Data_Write_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
532
	var (
533
		protoReq DataWriteRequest
534
		metadata runtime.ServerMetadata
535
		err      error
536
	)
537
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
538
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
539
	}
540
	val, ok := pathParams["tenant_id"]
541
	if !ok {
542
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
543
	}
544
	protoReq.TenantId, err = runtime.String(val)
545
	if err != nil {
546
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
547
	}
548
	msg, err := server.Write(ctx, &protoReq)
549
	return msg, metadata, err
550
}
551
552
func request_Data_WriteRelationships_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
553
	var (
554
		protoReq RelationshipWriteRequest
555
		metadata runtime.ServerMetadata
556
		err      error
557
	)
558
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
559
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
560
	}
561
	if req.Body != nil {
562
		_, _ = io.Copy(io.Discard, req.Body)
563
	}
564
	val, ok := pathParams["tenant_id"]
565
	if !ok {
566
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
567
	}
568
	protoReq.TenantId, err = runtime.String(val)
569
	if err != nil {
570
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
571
	}
572
	msg, err := client.WriteRelationships(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
573
	return msg, metadata, err
574
}
575
576
func local_request_Data_WriteRelationships_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
577
	var (
578
		protoReq RelationshipWriteRequest
579
		metadata runtime.ServerMetadata
580
		err      error
581
	)
582
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
583
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
584
	}
585
	val, ok := pathParams["tenant_id"]
586
	if !ok {
587
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
588
	}
589
	protoReq.TenantId, err = runtime.String(val)
590
	if err != nil {
591
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
592
	}
593
	msg, err := server.WriteRelationships(ctx, &protoReq)
594
	return msg, metadata, err
595
}
596
597
func request_Data_ReadRelationships_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
598
	var (
599
		protoReq RelationshipReadRequest
600
		metadata runtime.ServerMetadata
601
		err      error
602
	)
603
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
604
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
605
	}
606
	if req.Body != nil {
607
		_, _ = io.Copy(io.Discard, req.Body)
608
	}
609
	val, ok := pathParams["tenant_id"]
610
	if !ok {
611
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
612
	}
613
	protoReq.TenantId, err = runtime.String(val)
614
	if err != nil {
615
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
616
	}
617
	msg, err := client.ReadRelationships(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
618
	return msg, metadata, err
619
}
620
621
func local_request_Data_ReadRelationships_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
622
	var (
623
		protoReq RelationshipReadRequest
624
		metadata runtime.ServerMetadata
625
		err      error
626
	)
627
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
628
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
629
	}
630
	val, ok := pathParams["tenant_id"]
631
	if !ok {
632
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
633
	}
634
	protoReq.TenantId, err = runtime.String(val)
635
	if err != nil {
636
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
637
	}
638
	msg, err := server.ReadRelationships(ctx, &protoReq)
639
	return msg, metadata, err
640
}
641
642
func request_Data_ReadAttributes_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
643
	var (
644
		protoReq AttributeReadRequest
645
		metadata runtime.ServerMetadata
646
		err      error
647
	)
648
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
649
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
650
	}
651
	if req.Body != nil {
652
		_, _ = io.Copy(io.Discard, req.Body)
653
	}
654
	val, ok := pathParams["tenant_id"]
655
	if !ok {
656
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
657
	}
658
	protoReq.TenantId, err = runtime.String(val)
659
	if err != nil {
660
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
661
	}
662
	msg, err := client.ReadAttributes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
663
	return msg, metadata, err
664
}
665
666
func local_request_Data_ReadAttributes_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
667
	var (
668
		protoReq AttributeReadRequest
669
		metadata runtime.ServerMetadata
670
		err      error
671
	)
672
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
673
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
674
	}
675
	val, ok := pathParams["tenant_id"]
676
	if !ok {
677
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
678
	}
679
	protoReq.TenantId, err = runtime.String(val)
680
	if err != nil {
681
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
682
	}
683
	msg, err := server.ReadAttributes(ctx, &protoReq)
684
	return msg, metadata, err
685
}
686
687
func request_Data_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
688
	var (
689
		protoReq DataDeleteRequest
690
		metadata runtime.ServerMetadata
691
		err      error
692
	)
693
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
694
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
695
	}
696
	if req.Body != nil {
697
		_, _ = io.Copy(io.Discard, req.Body)
698
	}
699
	val, ok := pathParams["tenant_id"]
700
	if !ok {
701
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
702
	}
703
	protoReq.TenantId, err = runtime.String(val)
704
	if err != nil {
705
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
706
	}
707
	msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
708
	return msg, metadata, err
709
}
710
711
func local_request_Data_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
712
	var (
713
		protoReq DataDeleteRequest
714
		metadata runtime.ServerMetadata
715
		err      error
716
	)
717
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
718
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
719
	}
720
	val, ok := pathParams["tenant_id"]
721
	if !ok {
722
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
723
	}
724
	protoReq.TenantId, err = runtime.String(val)
725
	if err != nil {
726
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
727
	}
728
	msg, err := server.Delete(ctx, &protoReq)
729
	return msg, metadata, err
730
}
731
732
func request_Data_DeleteRelationships_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
733
	var (
734
		protoReq RelationshipDeleteRequest
735
		metadata runtime.ServerMetadata
736
		err      error
737
	)
738
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
739
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
740
	}
741
	if req.Body != nil {
742
		_, _ = io.Copy(io.Discard, req.Body)
743
	}
744
	val, ok := pathParams["tenant_id"]
745
	if !ok {
746
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
747
	}
748
	protoReq.TenantId, err = runtime.String(val)
749
	if err != nil {
750
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
751
	}
752
	msg, err := client.DeleteRelationships(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
753
	return msg, metadata, err
754
}
755
756
func local_request_Data_DeleteRelationships_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
757
	var (
758
		protoReq RelationshipDeleteRequest
759
		metadata runtime.ServerMetadata
760
		err      error
761
	)
762
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
763
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
764
	}
765
	val, ok := pathParams["tenant_id"]
766
	if !ok {
767
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
768
	}
769
	protoReq.TenantId, err = runtime.String(val)
770
	if err != nil {
771
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
772
	}
773
	msg, err := server.DeleteRelationships(ctx, &protoReq)
774
	return msg, metadata, err
775
}
776
777
func request_Data_RunBundle_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
778
	var (
779
		protoReq BundleRunRequest
780
		metadata runtime.ServerMetadata
781
		err      error
782
	)
783
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
784
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
785
	}
786
	if req.Body != nil {
787
		_, _ = io.Copy(io.Discard, req.Body)
788
	}
789
	val, ok := pathParams["tenant_id"]
790
	if !ok {
791
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
792
	}
793
	protoReq.TenantId, err = runtime.String(val)
794
	if err != nil {
795
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
796
	}
797
	msg, err := client.RunBundle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
798
	return msg, metadata, err
799
}
800
801
func local_request_Data_RunBundle_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
802
	var (
803
		protoReq BundleRunRequest
804
		metadata runtime.ServerMetadata
805
		err      error
806
	)
807
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
808
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
809
	}
810
	val, ok := pathParams["tenant_id"]
811
	if !ok {
812
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
813
	}
814
	protoReq.TenantId, err = runtime.String(val)
815
	if err != nil {
816
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
817
	}
818
	msg, err := server.RunBundle(ctx, &protoReq)
819
	return msg, metadata, err
820
}
821
822
func request_Bundle_Write_0(ctx context.Context, marshaler runtime.Marshaler, client BundleClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
823
	var (
824
		protoReq BundleWriteRequest
825
		metadata runtime.ServerMetadata
826
		err      error
827
	)
828
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
829
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
830
	}
831
	if req.Body != nil {
832
		_, _ = io.Copy(io.Discard, req.Body)
833
	}
834
	val, ok := pathParams["tenant_id"]
835
	if !ok {
836
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
837
	}
838
	protoReq.TenantId, err = runtime.String(val)
839
	if err != nil {
840
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
841
	}
842
	msg, err := client.Write(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
843
	return msg, metadata, err
844
}
845
846
func local_request_Bundle_Write_0(ctx context.Context, marshaler runtime.Marshaler, server BundleServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
847
	var (
848
		protoReq BundleWriteRequest
849
		metadata runtime.ServerMetadata
850
		err      error
851
	)
852
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
853
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
854
	}
855
	val, ok := pathParams["tenant_id"]
856
	if !ok {
857
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
858
	}
859
	protoReq.TenantId, err = runtime.String(val)
860
	if err != nil {
861
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
862
	}
863
	msg, err := server.Write(ctx, &protoReq)
864
	return msg, metadata, err
865
}
866
867
func request_Bundle_Read_0(ctx context.Context, marshaler runtime.Marshaler, client BundleClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
868
	var (
869
		protoReq BundleReadRequest
870
		metadata runtime.ServerMetadata
871
		err      error
872
	)
873
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
874
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
875
	}
876
	if req.Body != nil {
877
		_, _ = io.Copy(io.Discard, req.Body)
878
	}
879
	val, ok := pathParams["tenant_id"]
880
	if !ok {
881
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
882
	}
883
	protoReq.TenantId, err = runtime.String(val)
884
	if err != nil {
885
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
886
	}
887
	msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
888
	return msg, metadata, err
889
}
890
891
func local_request_Bundle_Read_0(ctx context.Context, marshaler runtime.Marshaler, server BundleServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
892
	var (
893
		protoReq BundleReadRequest
894
		metadata runtime.ServerMetadata
895
		err      error
896
	)
897
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
898
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
899
	}
900
	val, ok := pathParams["tenant_id"]
901
	if !ok {
902
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
903
	}
904
	protoReq.TenantId, err = runtime.String(val)
905
	if err != nil {
906
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
907
	}
908
	msg, err := server.Read(ctx, &protoReq)
909
	return msg, metadata, err
910
}
911
912
func request_Bundle_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client BundleClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
913
	var (
914
		protoReq BundleDeleteRequest
915
		metadata runtime.ServerMetadata
916
		err      error
917
	)
918
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
919
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
920
	}
921
	if req.Body != nil {
922
		_, _ = io.Copy(io.Discard, req.Body)
923
	}
924
	val, ok := pathParams["tenant_id"]
925
	if !ok {
926
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
927
	}
928
	protoReq.TenantId, err = runtime.String(val)
929
	if err != nil {
930
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
931
	}
932
	msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
933
	return msg, metadata, err
934
}
935
936
func local_request_Bundle_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server BundleServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
937
	var (
938
		protoReq BundleDeleteRequest
939
		metadata runtime.ServerMetadata
940
		err      error
941
	)
942
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
943
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
944
	}
945
	val, ok := pathParams["tenant_id"]
946
	if !ok {
947
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tenant_id")
948
	}
949
	protoReq.TenantId, err = runtime.String(val)
950
	if err != nil {
951
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tenant_id", err)
952
	}
953
	msg, err := server.Delete(ctx, &protoReq)
954
	return msg, metadata, err
955
}
956
957
func request_Tenancy_Create_0(ctx context.Context, marshaler runtime.Marshaler, client TenancyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
958
	var (
959
		protoReq TenantCreateRequest
960
		metadata runtime.ServerMetadata
961
	)
962
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
963
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
964
	}
965
	if req.Body != nil {
966
		_, _ = io.Copy(io.Discard, req.Body)
967
	}
968
	msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
969
	return msg, metadata, err
970
}
971
972
func local_request_Tenancy_Create_0(ctx context.Context, marshaler runtime.Marshaler, server TenancyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
973
	var (
974
		protoReq TenantCreateRequest
975
		metadata runtime.ServerMetadata
976
	)
977
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
978
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
979
	}
980
	msg, err := server.Create(ctx, &protoReq)
981
	return msg, metadata, err
982
}
983
984
func request_Tenancy_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client TenancyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
985
	var (
986
		protoReq TenantDeleteRequest
987
		metadata runtime.ServerMetadata
988
		err      error
989
	)
990
	if req.Body != nil {
991
		_, _ = io.Copy(io.Discard, req.Body)
992
	}
993
	val, ok := pathParams["id"]
994
	if !ok {
995
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
996
	}
997
	protoReq.Id, err = runtime.String(val)
998
	if err != nil {
999
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
1000
	}
1001
	msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
1002
	return msg, metadata, err
1003
}
1004
1005
func local_request_Tenancy_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server TenancyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
1006
	var (
1007
		protoReq TenantDeleteRequest
1008
		metadata runtime.ServerMetadata
1009
		err      error
1010
	)
1011
	val, ok := pathParams["id"]
1012
	if !ok {
1013
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
1014
	}
1015
	protoReq.Id, err = runtime.String(val)
1016
	if err != nil {
1017
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
1018
	}
1019
	msg, err := server.Delete(ctx, &protoReq)
1020
	return msg, metadata, err
1021
}
1022
1023
func request_Tenancy_List_0(ctx context.Context, marshaler runtime.Marshaler, client TenancyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
1024
	var (
1025
		protoReq TenantListRequest
1026
		metadata runtime.ServerMetadata
1027
	)
1028
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
1029
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
1030
	}
1031
	if req.Body != nil {
1032
		_, _ = io.Copy(io.Discard, req.Body)
1033
	}
1034
	msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
1035
	return msg, metadata, err
1036
}
1037
1038
func local_request_Tenancy_List_0(ctx context.Context, marshaler runtime.Marshaler, server TenancyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
1039
	var (
1040
		protoReq TenantListRequest
1041
		metadata runtime.ServerMetadata
1042
	)
1043
	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
1044
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
1045
	}
1046
	msg, err := server.List(ctx, &protoReq)
1047
	return msg, metadata, err
1048
}
1049
1050
// RegisterPermissionHandlerServer registers the http handlers for service Permission to "mux".
1051
// UnaryRPC     :call PermissionServer directly.
1052
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
1053
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPermissionHandlerFromEndpoint instead.
1054
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
1055
func RegisterPermissionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PermissionServer) error {
1056
	mux.Handle(http.MethodPost, pattern_Permission_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1057
		ctx, cancel := context.WithCancel(req.Context())
1058
		defer cancel()
1059
		var stream runtime.ServerTransportStream
1060
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1061
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1062
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Permission/Check", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/check"))
1063
		if err != nil {
1064
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1065
			return
1066
		}
1067
		resp, md, err := local_request_Permission_Check_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1068
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1069
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1070
		if err != nil {
1071
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1072
			return
1073
		}
1074
		forward_Permission_Check_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1075
	})
1076
	mux.Handle(http.MethodPost, pattern_Permission_Expand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1077
		ctx, cancel := context.WithCancel(req.Context())
1078
		defer cancel()
1079
		var stream runtime.ServerTransportStream
1080
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1081
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1082
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Permission/Expand", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/expand"))
1083
		if err != nil {
1084
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1085
			return
1086
		}
1087
		resp, md, err := local_request_Permission_Expand_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1088
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1089
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1090
		if err != nil {
1091
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1092
			return
1093
		}
1094
		forward_Permission_Expand_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1095
	})
1096
	mux.Handle(http.MethodPost, pattern_Permission_LookupEntity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1097
		ctx, cancel := context.WithCancel(req.Context())
1098
		defer cancel()
1099
		var stream runtime.ServerTransportStream
1100
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1101
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1102
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Permission/LookupEntity", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/lookup-entity"))
1103
		if err != nil {
1104
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1105
			return
1106
		}
1107
		resp, md, err := local_request_Permission_LookupEntity_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1108
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1109
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1110
		if err != nil {
1111
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1112
			return
1113
		}
1114
		forward_Permission_LookupEntity_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1115
	})
1116
1117
	mux.Handle(http.MethodPost, pattern_Permission_LookupEntityStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1118
		err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
1119
		_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1120
		runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1121
		return
1122
	})
1123
	mux.Handle(http.MethodPost, pattern_Permission_LookupSubject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1124
		ctx, cancel := context.WithCancel(req.Context())
1125
		defer cancel()
1126
		var stream runtime.ServerTransportStream
1127
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1128
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1129
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Permission/LookupSubject", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/lookup-subject"))
1130
		if err != nil {
1131
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1132
			return
1133
		}
1134
		resp, md, err := local_request_Permission_LookupSubject_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1135
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1136
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1137
		if err != nil {
1138
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1139
			return
1140
		}
1141
		forward_Permission_LookupSubject_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1142
	})
1143
	mux.Handle(http.MethodPost, pattern_Permission_SubjectPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1144
		ctx, cancel := context.WithCancel(req.Context())
1145
		defer cancel()
1146
		var stream runtime.ServerTransportStream
1147
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1148
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1149
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Permission/SubjectPermission", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/subject-permission"))
1150
		if err != nil {
1151
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1152
			return
1153
		}
1154
		resp, md, err := local_request_Permission_SubjectPermission_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1155
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1156
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1157
		if err != nil {
1158
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1159
			return
1160
		}
1161
		forward_Permission_SubjectPermission_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1162
	})
1163
1164
	return nil
1165
}
1166
1167
// RegisterWatchHandlerServer registers the http handlers for service Watch to "mux".
1168
// UnaryRPC     :call WatchServer directly.
1169
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
1170
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWatchHandlerFromEndpoint instead.
1171
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
1172
func RegisterWatchHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WatchServer) error {
1173
	mux.Handle(http.MethodPost, pattern_Watch_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1174
		err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
1175
		_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1176
		runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1177
		return
1178
	})
1179
1180
	return nil
1181
}
1182
1183
// RegisterSchemaHandlerServer registers the http handlers for service Schema to "mux".
1184
// UnaryRPC     :call SchemaServer directly.
1185
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
1186
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSchemaHandlerFromEndpoint instead.
1187
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
1188
func RegisterSchemaHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SchemaServer) error {
1189
	mux.Handle(http.MethodPost, pattern_Schema_Write_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1190
		ctx, cancel := context.WithCancel(req.Context())
1191
		defer cancel()
1192
		var stream runtime.ServerTransportStream
1193
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1194
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1195
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Schema/Write", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/write"))
1196
		if err != nil {
1197
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1198
			return
1199
		}
1200
		resp, md, err := local_request_Schema_Write_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1201
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1202
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1203
		if err != nil {
1204
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1205
			return
1206
		}
1207
		forward_Schema_Write_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1208
	})
1209
	mux.Handle(http.MethodPatch, pattern_Schema_PartialWrite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1210
		ctx, cancel := context.WithCancel(req.Context())
1211
		defer cancel()
1212
		var stream runtime.ServerTransportStream
1213
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1214
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1215
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Schema/PartialWrite", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/partial-write"))
1216
		if err != nil {
1217
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1218
			return
1219
		}
1220
		resp, md, err := local_request_Schema_PartialWrite_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1221
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1222
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1223
		if err != nil {
1224
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1225
			return
1226
		}
1227
		forward_Schema_PartialWrite_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1228
	})
1229
	mux.Handle(http.MethodPost, pattern_Schema_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1230
		ctx, cancel := context.WithCancel(req.Context())
1231
		defer cancel()
1232
		var stream runtime.ServerTransportStream
1233
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1234
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1235
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Schema/Read", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/read"))
1236
		if err != nil {
1237
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1238
			return
1239
		}
1240
		resp, md, err := local_request_Schema_Read_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1241
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1242
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1243
		if err != nil {
1244
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1245
			return
1246
		}
1247
		forward_Schema_Read_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1248
	})
1249
	mux.Handle(http.MethodPost, pattern_Schema_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1250
		ctx, cancel := context.WithCancel(req.Context())
1251
		defer cancel()
1252
		var stream runtime.ServerTransportStream
1253
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1254
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1255
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Schema/List", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/list"))
1256
		if err != nil {
1257
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1258
			return
1259
		}
1260
		resp, md, err := local_request_Schema_List_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1261
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1262
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1263
		if err != nil {
1264
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1265
			return
1266
		}
1267
		forward_Schema_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1268
	})
1269
1270
	return nil
1271
}
1272
1273
// RegisterDataHandlerServer registers the http handlers for service Data to "mux".
1274
// UnaryRPC     :call DataServer directly.
1275
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
1276
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataHandlerFromEndpoint instead.
1277
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
1278
func RegisterDataHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServer) error {
1279
	mux.Handle(http.MethodPost, pattern_Data_Write_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1280
		ctx, cancel := context.WithCancel(req.Context())
1281
		defer cancel()
1282
		var stream runtime.ServerTransportStream
1283
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1284
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1285
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/Write", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/write"))
1286
		if err != nil {
1287
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1288
			return
1289
		}
1290
		resp, md, err := local_request_Data_Write_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1291
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1292
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1293
		if err != nil {
1294
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1295
			return
1296
		}
1297
		forward_Data_Write_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1298
	})
1299
	mux.Handle(http.MethodPost, pattern_Data_WriteRelationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1300
		ctx, cancel := context.WithCancel(req.Context())
1301
		defer cancel()
1302
		var stream runtime.ServerTransportStream
1303
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1304
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1305
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/WriteRelationships", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/relationships/write"))
1306
		if err != nil {
1307
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1308
			return
1309
		}
1310
		resp, md, err := local_request_Data_WriteRelationships_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1311
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1312
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1313
		if err != nil {
1314
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1315
			return
1316
		}
1317
		forward_Data_WriteRelationships_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1318
	})
1319
	mux.Handle(http.MethodPost, pattern_Data_ReadRelationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1320
		ctx, cancel := context.WithCancel(req.Context())
1321
		defer cancel()
1322
		var stream runtime.ServerTransportStream
1323
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1324
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1325
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/ReadRelationships", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/relationships/read"))
1326
		if err != nil {
1327
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1328
			return
1329
		}
1330
		resp, md, err := local_request_Data_ReadRelationships_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1331
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1332
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1333
		if err != nil {
1334
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1335
			return
1336
		}
1337
		forward_Data_ReadRelationships_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1338
	})
1339
	mux.Handle(http.MethodPost, pattern_Data_ReadAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1340
		ctx, cancel := context.WithCancel(req.Context())
1341
		defer cancel()
1342
		var stream runtime.ServerTransportStream
1343
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1344
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1345
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/ReadAttributes", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/attributes/read"))
1346
		if err != nil {
1347
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1348
			return
1349
		}
1350
		resp, md, err := local_request_Data_ReadAttributes_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1351
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1352
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1353
		if err != nil {
1354
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1355
			return
1356
		}
1357
		forward_Data_ReadAttributes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1358
	})
1359
	mux.Handle(http.MethodPost, pattern_Data_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1360
		ctx, cancel := context.WithCancel(req.Context())
1361
		defer cancel()
1362
		var stream runtime.ServerTransportStream
1363
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1364
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1365
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/Delete", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/delete"))
1366
		if err != nil {
1367
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1368
			return
1369
		}
1370
		resp, md, err := local_request_Data_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1371
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1372
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1373
		if err != nil {
1374
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1375
			return
1376
		}
1377
		forward_Data_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1378
	})
1379
	mux.Handle(http.MethodPost, pattern_Data_DeleteRelationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1380
		ctx, cancel := context.WithCancel(req.Context())
1381
		defer cancel()
1382
		var stream runtime.ServerTransportStream
1383
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1384
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1385
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/DeleteRelationships", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/relationships/delete"))
1386
		if err != nil {
1387
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1388
			return
1389
		}
1390
		resp, md, err := local_request_Data_DeleteRelationships_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1391
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1392
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1393
		if err != nil {
1394
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1395
			return
1396
		}
1397
		forward_Data_DeleteRelationships_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1398
	})
1399
	mux.Handle(http.MethodPost, pattern_Data_RunBundle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1400
		ctx, cancel := context.WithCancel(req.Context())
1401
		defer cancel()
1402
		var stream runtime.ServerTransportStream
1403
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1404
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1405
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Data/RunBundle", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/run-bundle"))
1406
		if err != nil {
1407
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1408
			return
1409
		}
1410
		resp, md, err := local_request_Data_RunBundle_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1411
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1412
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1413
		if err != nil {
1414
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1415
			return
1416
		}
1417
		forward_Data_RunBundle_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1418
	})
1419
1420
	return nil
1421
}
1422
1423
// RegisterBundleHandlerServer registers the http handlers for service Bundle to "mux".
1424
// UnaryRPC     :call BundleServer directly.
1425
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
1426
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBundleHandlerFromEndpoint instead.
1427
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
1428
func RegisterBundleHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BundleServer) error {
1429
	mux.Handle(http.MethodPost, pattern_Bundle_Write_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1430
		ctx, cancel := context.WithCancel(req.Context())
1431
		defer cancel()
1432
		var stream runtime.ServerTransportStream
1433
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1434
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1435
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Bundle/Write", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/bundle/write"))
1436
		if err != nil {
1437
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1438
			return
1439
		}
1440
		resp, md, err := local_request_Bundle_Write_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1441
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1442
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1443
		if err != nil {
1444
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1445
			return
1446
		}
1447
		forward_Bundle_Write_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1448
	})
1449
	mux.Handle(http.MethodPost, pattern_Bundle_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1450
		ctx, cancel := context.WithCancel(req.Context())
1451
		defer cancel()
1452
		var stream runtime.ServerTransportStream
1453
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1454
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1455
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Bundle/Read", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/bundle/read"))
1456
		if err != nil {
1457
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1458
			return
1459
		}
1460
		resp, md, err := local_request_Bundle_Read_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1461
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1462
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1463
		if err != nil {
1464
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1465
			return
1466
		}
1467
		forward_Bundle_Read_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1468
	})
1469
	mux.Handle(http.MethodPost, pattern_Bundle_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1470
		ctx, cancel := context.WithCancel(req.Context())
1471
		defer cancel()
1472
		var stream runtime.ServerTransportStream
1473
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1474
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1475
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Bundle/Delete", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/bundle/delete"))
1476
		if err != nil {
1477
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1478
			return
1479
		}
1480
		resp, md, err := local_request_Bundle_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1481
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1482
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1483
		if err != nil {
1484
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1485
			return
1486
		}
1487
		forward_Bundle_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1488
	})
1489
1490
	return nil
1491
}
1492
1493
// RegisterTenancyHandlerServer registers the http handlers for service Tenancy to "mux".
1494
// UnaryRPC     :call TenancyServer directly.
1495
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
1496
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTenancyHandlerFromEndpoint instead.
1497
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
1498
func RegisterTenancyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TenancyServer) error {
1499
	mux.Handle(http.MethodPost, pattern_Tenancy_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1500
		ctx, cancel := context.WithCancel(req.Context())
1501
		defer cancel()
1502
		var stream runtime.ServerTransportStream
1503
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1504
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1505
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Tenancy/Create", runtime.WithHTTPPathPattern("/v1/tenants/create"))
1506
		if err != nil {
1507
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1508
			return
1509
		}
1510
		resp, md, err := local_request_Tenancy_Create_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1511
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1512
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1513
		if err != nil {
1514
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1515
			return
1516
		}
1517
		forward_Tenancy_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1518
	})
1519
	mux.Handle(http.MethodDelete, pattern_Tenancy_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1520
		ctx, cancel := context.WithCancel(req.Context())
1521
		defer cancel()
1522
		var stream runtime.ServerTransportStream
1523
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1524
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1525
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Tenancy/Delete", runtime.WithHTTPPathPattern("/v1/tenants/{id}"))
1526
		if err != nil {
1527
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1528
			return
1529
		}
1530
		resp, md, err := local_request_Tenancy_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1531
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1532
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1533
		if err != nil {
1534
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1535
			return
1536
		}
1537
		forward_Tenancy_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1538
	})
1539
	mux.Handle(http.MethodPost, pattern_Tenancy_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1540
		ctx, cancel := context.WithCancel(req.Context())
1541
		defer cancel()
1542
		var stream runtime.ServerTransportStream
1543
		ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
1544
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1545
		annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/base.v1.Tenancy/List", runtime.WithHTTPPathPattern("/v1/tenants/list"))
1546
		if err != nil {
1547
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1548
			return
1549
		}
1550
		resp, md, err := local_request_Tenancy_List_0(annotatedContext, inboundMarshaler, server, req, pathParams)
1551
		md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
1552
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1553
		if err != nil {
1554
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1555
			return
1556
		}
1557
		forward_Tenancy_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1558
	})
1559
1560
	return nil
1561
}
1562
1563
// RegisterPermissionHandlerFromEndpoint is same as RegisterPermissionHandler but
1564
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
1565
func RegisterPermissionHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
1566
	conn, err := grpc.NewClient(endpoint, opts...)
1567
	if err != nil {
1568
		return err
1569
	}
1570
	defer func() {
1571
		if err != nil {
1572
			if cerr := conn.Close(); cerr != nil {
1573
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1574
			}
1575
			return
1576
		}
1577
		go func() {
1578
			<-ctx.Done()
1579
			if cerr := conn.Close(); cerr != nil {
1580
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1581
			}
1582
		}()
1583
	}()
1584
	return RegisterPermissionHandler(ctx, mux, conn)
1585
}
1586
1587
// RegisterPermissionHandler registers the http handlers for service Permission to "mux".
1588
// The handlers forward requests to the grpc endpoint over "conn".
1589
func RegisterPermissionHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
1590
	return RegisterPermissionHandlerClient(ctx, mux, NewPermissionClient(conn))
1591
}
1592
1593
// RegisterPermissionHandlerClient registers the http handlers for service Permission
1594
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PermissionClient".
1595
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PermissionClient"
1596
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
1597
// "PermissionClient" to call the correct interceptors. This client ignores the HTTP middlewares.
1598
func RegisterPermissionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PermissionClient) error {
1599
	mux.Handle(http.MethodPost, pattern_Permission_Check_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1600
		ctx, cancel := context.WithCancel(req.Context())
1601
		defer cancel()
1602
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1603
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Permission/Check", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/check"))
1604
		if err != nil {
1605
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1606
			return
1607
		}
1608
		resp, md, err := request_Permission_Check_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1609
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1610
		if err != nil {
1611
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1612
			return
1613
		}
1614
		forward_Permission_Check_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1615
	})
1616
	mux.Handle(http.MethodPost, pattern_Permission_Expand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1617
		ctx, cancel := context.WithCancel(req.Context())
1618
		defer cancel()
1619
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1620
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Permission/Expand", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/expand"))
1621
		if err != nil {
1622
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1623
			return
1624
		}
1625
		resp, md, err := request_Permission_Expand_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1626
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1627
		if err != nil {
1628
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1629
			return
1630
		}
1631
		forward_Permission_Expand_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1632
	})
1633
	mux.Handle(http.MethodPost, pattern_Permission_LookupEntity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1634
		ctx, cancel := context.WithCancel(req.Context())
1635
		defer cancel()
1636
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1637
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Permission/LookupEntity", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/lookup-entity"))
1638
		if err != nil {
1639
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1640
			return
1641
		}
1642
		resp, md, err := request_Permission_LookupEntity_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1643
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1644
		if err != nil {
1645
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1646
			return
1647
		}
1648
		forward_Permission_LookupEntity_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1649
	})
1650
	mux.Handle(http.MethodPost, pattern_Permission_LookupEntityStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1651
		ctx, cancel := context.WithCancel(req.Context())
1652
		defer cancel()
1653
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1654
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Permission/LookupEntityStream", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/lookup-entity-stream"))
1655
		if err != nil {
1656
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1657
			return
1658
		}
1659
		resp, md, err := request_Permission_LookupEntityStream_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1660
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1661
		if err != nil {
1662
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1663
			return
1664
		}
1665
		forward_Permission_LookupEntityStream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
1666
	})
1667
	mux.Handle(http.MethodPost, pattern_Permission_LookupSubject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1668
		ctx, cancel := context.WithCancel(req.Context())
1669
		defer cancel()
1670
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1671
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Permission/LookupSubject", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/lookup-subject"))
1672
		if err != nil {
1673
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1674
			return
1675
		}
1676
		resp, md, err := request_Permission_LookupSubject_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1677
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1678
		if err != nil {
1679
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1680
			return
1681
		}
1682
		forward_Permission_LookupSubject_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1683
	})
1684
	mux.Handle(http.MethodPost, pattern_Permission_SubjectPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1685
		ctx, cancel := context.WithCancel(req.Context())
1686
		defer cancel()
1687
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1688
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Permission/SubjectPermission", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/permissions/subject-permission"))
1689
		if err != nil {
1690
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1691
			return
1692
		}
1693
		resp, md, err := request_Permission_SubjectPermission_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1694
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1695
		if err != nil {
1696
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1697
			return
1698
		}
1699
		forward_Permission_SubjectPermission_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1700
	})
1701
	return nil
1702
}
1703
1704
var (
1705
	pattern_Permission_Check_0              = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "permissions", "check"}, ""))
1706
	pattern_Permission_Expand_0             = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "permissions", "expand"}, ""))
1707
	pattern_Permission_LookupEntity_0       = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "permissions", "lookup-entity"}, ""))
1708
	pattern_Permission_LookupEntityStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "permissions", "lookup-entity-stream"}, ""))
1709
	pattern_Permission_LookupSubject_0      = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "permissions", "lookup-subject"}, ""))
1710
	pattern_Permission_SubjectPermission_0  = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "permissions", "subject-permission"}, ""))
1711
)
1712
1713
var (
1714
	forward_Permission_Check_0              = runtime.ForwardResponseMessage
1715
	forward_Permission_Expand_0             = runtime.ForwardResponseMessage
1716
	forward_Permission_LookupEntity_0       = runtime.ForwardResponseMessage
1717
	forward_Permission_LookupEntityStream_0 = runtime.ForwardResponseStream
1718
	forward_Permission_LookupSubject_0      = runtime.ForwardResponseMessage
1719
	forward_Permission_SubjectPermission_0  = runtime.ForwardResponseMessage
1720
)
1721
1722
// RegisterWatchHandlerFromEndpoint is same as RegisterWatchHandler but
1723
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
1724
func RegisterWatchHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
1725
	conn, err := grpc.NewClient(endpoint, opts...)
1726
	if err != nil {
1727
		return err
1728
	}
1729
	defer func() {
1730
		if err != nil {
1731
			if cerr := conn.Close(); cerr != nil {
1732
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1733
			}
1734
			return
1735
		}
1736
		go func() {
1737
			<-ctx.Done()
1738
			if cerr := conn.Close(); cerr != nil {
1739
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1740
			}
1741
		}()
1742
	}()
1743
	return RegisterWatchHandler(ctx, mux, conn)
1744
}
1745
1746
// RegisterWatchHandler registers the http handlers for service Watch to "mux".
1747
// The handlers forward requests to the grpc endpoint over "conn".
1748
func RegisterWatchHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
1749
	return RegisterWatchHandlerClient(ctx, mux, NewWatchClient(conn))
1750
}
1751
1752
// RegisterWatchHandlerClient registers the http handlers for service Watch
1753
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WatchClient".
1754
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WatchClient"
1755
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
1756
// "WatchClient" to call the correct interceptors. This client ignores the HTTP middlewares.
1757
func RegisterWatchHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WatchClient) error {
1758
	mux.Handle(http.MethodPost, pattern_Watch_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1759
		ctx, cancel := context.WithCancel(req.Context())
1760
		defer cancel()
1761
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1762
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Watch/Watch", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/watch"))
1763
		if err != nil {
1764
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1765
			return
1766
		}
1767
		resp, md, err := request_Watch_Watch_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1768
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1769
		if err != nil {
1770
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1771
			return
1772
		}
1773
		forward_Watch_Watch_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
1774
	})
1775
	return nil
1776
}
1777
1778
var (
1779
	pattern_Watch_Watch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"v1", "tenants", "tenant_id", "watch"}, ""))
1780
)
1781
1782
var (
1783
	forward_Watch_Watch_0 = runtime.ForwardResponseStream
1784
)
1785
1786
// RegisterSchemaHandlerFromEndpoint is same as RegisterSchemaHandler but
1787
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
1788
func RegisterSchemaHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
1789
	conn, err := grpc.NewClient(endpoint, opts...)
1790
	if err != nil {
1791
		return err
1792
	}
1793
	defer func() {
1794
		if err != nil {
1795
			if cerr := conn.Close(); cerr != nil {
1796
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1797
			}
1798
			return
1799
		}
1800
		go func() {
1801
			<-ctx.Done()
1802
			if cerr := conn.Close(); cerr != nil {
1803
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1804
			}
1805
		}()
1806
	}()
1807
	return RegisterSchemaHandler(ctx, mux, conn)
1808
}
1809
1810
// RegisterSchemaHandler registers the http handlers for service Schema to "mux".
1811
// The handlers forward requests to the grpc endpoint over "conn".
1812
func RegisterSchemaHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
1813
	return RegisterSchemaHandlerClient(ctx, mux, NewSchemaClient(conn))
1814
}
1815
1816
// RegisterSchemaHandlerClient registers the http handlers for service Schema
1817
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SchemaClient".
1818
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SchemaClient"
1819
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
1820
// "SchemaClient" to call the correct interceptors. This client ignores the HTTP middlewares.
1821
func RegisterSchemaHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SchemaClient) error {
1822
	mux.Handle(http.MethodPost, pattern_Schema_Write_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1823
		ctx, cancel := context.WithCancel(req.Context())
1824
		defer cancel()
1825
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1826
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Schema/Write", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/write"))
1827
		if err != nil {
1828
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1829
			return
1830
		}
1831
		resp, md, err := request_Schema_Write_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1832
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1833
		if err != nil {
1834
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1835
			return
1836
		}
1837
		forward_Schema_Write_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1838
	})
1839
	mux.Handle(http.MethodPatch, pattern_Schema_PartialWrite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1840
		ctx, cancel := context.WithCancel(req.Context())
1841
		defer cancel()
1842
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1843
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Schema/PartialWrite", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/partial-write"))
1844
		if err != nil {
1845
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1846
			return
1847
		}
1848
		resp, md, err := request_Schema_PartialWrite_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1849
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1850
		if err != nil {
1851
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1852
			return
1853
		}
1854
		forward_Schema_PartialWrite_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1855
	})
1856
	mux.Handle(http.MethodPost, pattern_Schema_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1857
		ctx, cancel := context.WithCancel(req.Context())
1858
		defer cancel()
1859
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1860
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Schema/Read", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/read"))
1861
		if err != nil {
1862
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1863
			return
1864
		}
1865
		resp, md, err := request_Schema_Read_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1866
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1867
		if err != nil {
1868
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1869
			return
1870
		}
1871
		forward_Schema_Read_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1872
	})
1873
	mux.Handle(http.MethodPost, pattern_Schema_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1874
		ctx, cancel := context.WithCancel(req.Context())
1875
		defer cancel()
1876
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1877
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Schema/List", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/schemas/list"))
1878
		if err != nil {
1879
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1880
			return
1881
		}
1882
		resp, md, err := request_Schema_List_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1883
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1884
		if err != nil {
1885
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1886
			return
1887
		}
1888
		forward_Schema_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1889
	})
1890
	return nil
1891
}
1892
1893
var (
1894
	pattern_Schema_Write_0        = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "schemas", "write"}, ""))
1895
	pattern_Schema_PartialWrite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "schemas", "partial-write"}, ""))
1896
	pattern_Schema_Read_0         = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "schemas", "read"}, ""))
1897
	pattern_Schema_List_0         = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "schemas", "list"}, ""))
1898
)
1899
1900
var (
1901
	forward_Schema_Write_0        = runtime.ForwardResponseMessage
1902
	forward_Schema_PartialWrite_0 = runtime.ForwardResponseMessage
1903
	forward_Schema_Read_0         = runtime.ForwardResponseMessage
1904
	forward_Schema_List_0         = runtime.ForwardResponseMessage
1905
)
1906
1907
// RegisterDataHandlerFromEndpoint is same as RegisterDataHandler but
1908
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
1909
func RegisterDataHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
1910
	conn, err := grpc.NewClient(endpoint, opts...)
1911
	if err != nil {
1912
		return err
1913
	}
1914
	defer func() {
1915
		if err != nil {
1916
			if cerr := conn.Close(); cerr != nil {
1917
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1918
			}
1919
			return
1920
		}
1921
		go func() {
1922
			<-ctx.Done()
1923
			if cerr := conn.Close(); cerr != nil {
1924
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
1925
			}
1926
		}()
1927
	}()
1928
	return RegisterDataHandler(ctx, mux, conn)
1929
}
1930
1931
// RegisterDataHandler registers the http handlers for service Data to "mux".
1932
// The handlers forward requests to the grpc endpoint over "conn".
1933
func RegisterDataHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
1934
	return RegisterDataHandlerClient(ctx, mux, NewDataClient(conn))
1935
}
1936
1937
// RegisterDataHandlerClient registers the http handlers for service Data
1938
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataClient".
1939
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataClient"
1940
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
1941
// "DataClient" to call the correct interceptors. This client ignores the HTTP middlewares.
1942
func RegisterDataHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataClient) error {
1943
	mux.Handle(http.MethodPost, pattern_Data_Write_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1944
		ctx, cancel := context.WithCancel(req.Context())
1945
		defer cancel()
1946
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1947
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/Write", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/write"))
1948
		if err != nil {
1949
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1950
			return
1951
		}
1952
		resp, md, err := request_Data_Write_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1953
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1954
		if err != nil {
1955
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1956
			return
1957
		}
1958
		forward_Data_Write_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1959
	})
1960
	mux.Handle(http.MethodPost, pattern_Data_WriteRelationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1961
		ctx, cancel := context.WithCancel(req.Context())
1962
		defer cancel()
1963
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1964
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/WriteRelationships", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/relationships/write"))
1965
		if err != nil {
1966
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1967
			return
1968
		}
1969
		resp, md, err := request_Data_WriteRelationships_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1970
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1971
		if err != nil {
1972
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1973
			return
1974
		}
1975
		forward_Data_WriteRelationships_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1976
	})
1977
	mux.Handle(http.MethodPost, pattern_Data_ReadRelationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1978
		ctx, cancel := context.WithCancel(req.Context())
1979
		defer cancel()
1980
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1981
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/ReadRelationships", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/relationships/read"))
1982
		if err != nil {
1983
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
1984
			return
1985
		}
1986
		resp, md, err := request_Data_ReadRelationships_0(annotatedContext, inboundMarshaler, client, req, pathParams)
1987
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
1988
		if err != nil {
1989
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
1990
			return
1991
		}
1992
		forward_Data_ReadRelationships_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
1993
	})
1994
	mux.Handle(http.MethodPost, pattern_Data_ReadAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
1995
		ctx, cancel := context.WithCancel(req.Context())
1996
		defer cancel()
1997
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
1998
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/ReadAttributes", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/attributes/read"))
1999
		if err != nil {
2000
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2001
			return
2002
		}
2003
		resp, md, err := request_Data_ReadAttributes_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2004
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2005
		if err != nil {
2006
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2007
			return
2008
		}
2009
		forward_Data_ReadAttributes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2010
	})
2011
	mux.Handle(http.MethodPost, pattern_Data_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2012
		ctx, cancel := context.WithCancel(req.Context())
2013
		defer cancel()
2014
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2015
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/Delete", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/delete"))
2016
		if err != nil {
2017
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2018
			return
2019
		}
2020
		resp, md, err := request_Data_Delete_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2021
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2022
		if err != nil {
2023
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2024
			return
2025
		}
2026
		forward_Data_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2027
	})
2028
	mux.Handle(http.MethodPost, pattern_Data_DeleteRelationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2029
		ctx, cancel := context.WithCancel(req.Context())
2030
		defer cancel()
2031
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2032
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/DeleteRelationships", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/relationships/delete"))
2033
		if err != nil {
2034
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2035
			return
2036
		}
2037
		resp, md, err := request_Data_DeleteRelationships_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2038
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2039
		if err != nil {
2040
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2041
			return
2042
		}
2043
		forward_Data_DeleteRelationships_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2044
	})
2045
	mux.Handle(http.MethodPost, pattern_Data_RunBundle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2046
		ctx, cancel := context.WithCancel(req.Context())
2047
		defer cancel()
2048
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2049
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Data/RunBundle", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/data/run-bundle"))
2050
		if err != nil {
2051
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2052
			return
2053
		}
2054
		resp, md, err := request_Data_RunBundle_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2055
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2056
		if err != nil {
2057
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2058
			return
2059
		}
2060
		forward_Data_RunBundle_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2061
	})
2062
	return nil
2063
}
2064
2065
var (
2066
	pattern_Data_Write_0               = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "data", "write"}, ""))
2067
	pattern_Data_WriteRelationships_0  = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "relationships", "write"}, ""))
2068
	pattern_Data_ReadRelationships_0   = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4, 2, 5}, []string{"v1", "tenants", "tenant_id", "data", "relationships", "read"}, ""))
2069
	pattern_Data_ReadAttributes_0      = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4, 2, 5}, []string{"v1", "tenants", "tenant_id", "data", "attributes", "read"}, ""))
2070
	pattern_Data_Delete_0              = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "data", "delete"}, ""))
2071
	pattern_Data_DeleteRelationships_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "relationships", "delete"}, ""))
2072
	pattern_Data_RunBundle_0           = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "data", "run-bundle"}, ""))
2073
)
2074
2075
var (
2076
	forward_Data_Write_0               = runtime.ForwardResponseMessage
2077
	forward_Data_WriteRelationships_0  = runtime.ForwardResponseMessage
2078
	forward_Data_ReadRelationships_0   = runtime.ForwardResponseMessage
2079
	forward_Data_ReadAttributes_0      = runtime.ForwardResponseMessage
2080
	forward_Data_Delete_0              = runtime.ForwardResponseMessage
2081
	forward_Data_DeleteRelationships_0 = runtime.ForwardResponseMessage
2082
	forward_Data_RunBundle_0           = runtime.ForwardResponseMessage
2083
)
2084
2085
// RegisterBundleHandlerFromEndpoint is same as RegisterBundleHandler but
2086
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
2087
func RegisterBundleHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
2088
	conn, err := grpc.NewClient(endpoint, opts...)
2089
	if err != nil {
2090
		return err
2091
	}
2092
	defer func() {
2093
		if err != nil {
2094
			if cerr := conn.Close(); cerr != nil {
2095
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
2096
			}
2097
			return
2098
		}
2099
		go func() {
2100
			<-ctx.Done()
2101
			if cerr := conn.Close(); cerr != nil {
2102
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
2103
			}
2104
		}()
2105
	}()
2106
	return RegisterBundleHandler(ctx, mux, conn)
2107
}
2108
2109
// RegisterBundleHandler registers the http handlers for service Bundle to "mux".
2110
// The handlers forward requests to the grpc endpoint over "conn".
2111
func RegisterBundleHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
2112
	return RegisterBundleHandlerClient(ctx, mux, NewBundleClient(conn))
2113
}
2114
2115
// RegisterBundleHandlerClient registers the http handlers for service Bundle
2116
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BundleClient".
2117
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BundleClient"
2118
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
2119
// "BundleClient" to call the correct interceptors. This client ignores the HTTP middlewares.
2120
func RegisterBundleHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BundleClient) error {
2121
	mux.Handle(http.MethodPost, pattern_Bundle_Write_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2122
		ctx, cancel := context.WithCancel(req.Context())
2123
		defer cancel()
2124
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2125
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Bundle/Write", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/bundle/write"))
2126
		if err != nil {
2127
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2128
			return
2129
		}
2130
		resp, md, err := request_Bundle_Write_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2131
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2132
		if err != nil {
2133
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2134
			return
2135
		}
2136
		forward_Bundle_Write_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2137
	})
2138
	mux.Handle(http.MethodPost, pattern_Bundle_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2139
		ctx, cancel := context.WithCancel(req.Context())
2140
		defer cancel()
2141
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2142
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Bundle/Read", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/bundle/read"))
2143
		if err != nil {
2144
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2145
			return
2146
		}
2147
		resp, md, err := request_Bundle_Read_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2148
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2149
		if err != nil {
2150
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2151
			return
2152
		}
2153
		forward_Bundle_Read_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2154
	})
2155
	mux.Handle(http.MethodPost, pattern_Bundle_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2156
		ctx, cancel := context.WithCancel(req.Context())
2157
		defer cancel()
2158
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2159
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Bundle/Delete", runtime.WithHTTPPathPattern("/v1/tenants/{tenant_id}/bundle/delete"))
2160
		if err != nil {
2161
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2162
			return
2163
		}
2164
		resp, md, err := request_Bundle_Delete_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2165
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2166
		if err != nil {
2167
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2168
			return
2169
		}
2170
		forward_Bundle_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2171
	})
2172
	return nil
2173
}
2174
2175
var (
2176
	pattern_Bundle_Write_0  = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "bundle", "write"}, ""))
2177
	pattern_Bundle_Read_0   = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "bundle", "read"}, ""))
2178
	pattern_Bundle_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"v1", "tenants", "tenant_id", "bundle", "delete"}, ""))
2179
)
2180
2181
var (
2182
	forward_Bundle_Write_0  = runtime.ForwardResponseMessage
2183
	forward_Bundle_Read_0   = runtime.ForwardResponseMessage
2184
	forward_Bundle_Delete_0 = runtime.ForwardResponseMessage
2185
)
2186
2187
// RegisterTenancyHandlerFromEndpoint is same as RegisterTenancyHandler but
2188
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
2189
func RegisterTenancyHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
2190
	conn, err := grpc.NewClient(endpoint, opts...)
2191
	if err != nil {
2192
		return err
2193
	}
2194
	defer func() {
2195
		if err != nil {
2196
			if cerr := conn.Close(); cerr != nil {
2197
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
2198
			}
2199
			return
2200
		}
2201
		go func() {
2202
			<-ctx.Done()
2203
			if cerr := conn.Close(); cerr != nil {
2204
				grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
2205
			}
2206
		}()
2207
	}()
2208
	return RegisterTenancyHandler(ctx, mux, conn)
2209
}
2210
2211
// RegisterTenancyHandler registers the http handlers for service Tenancy to "mux".
2212
// The handlers forward requests to the grpc endpoint over "conn".
2213
func RegisterTenancyHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
2214
	return RegisterTenancyHandlerClient(ctx, mux, NewTenancyClient(conn))
2215
}
2216
2217
// RegisterTenancyHandlerClient registers the http handlers for service Tenancy
2218
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TenancyClient".
2219
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TenancyClient"
2220
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
2221
// "TenancyClient" to call the correct interceptors. This client ignores the HTTP middlewares.
2222
func RegisterTenancyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TenancyClient) error {
2223
	mux.Handle(http.MethodPost, pattern_Tenancy_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2224
		ctx, cancel := context.WithCancel(req.Context())
2225
		defer cancel()
2226
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2227
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Tenancy/Create", runtime.WithHTTPPathPattern("/v1/tenants/create"))
2228
		if err != nil {
2229
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2230
			return
2231
		}
2232
		resp, md, err := request_Tenancy_Create_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2233
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2234
		if err != nil {
2235
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2236
			return
2237
		}
2238
		forward_Tenancy_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2239
	})
2240
	mux.Handle(http.MethodDelete, pattern_Tenancy_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2241
		ctx, cancel := context.WithCancel(req.Context())
2242
		defer cancel()
2243
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2244
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Tenancy/Delete", runtime.WithHTTPPathPattern("/v1/tenants/{id}"))
2245
		if err != nil {
2246
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2247
			return
2248
		}
2249
		resp, md, err := request_Tenancy_Delete_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2250
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2251
		if err != nil {
2252
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2253
			return
2254
		}
2255
		forward_Tenancy_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2256
	})
2257
	mux.Handle(http.MethodPost, pattern_Tenancy_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
2258
		ctx, cancel := context.WithCancel(req.Context())
2259
		defer cancel()
2260
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
2261
		annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/base.v1.Tenancy/List", runtime.WithHTTPPathPattern("/v1/tenants/list"))
2262
		if err != nil {
2263
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
2264
			return
2265
		}
2266
		resp, md, err := request_Tenancy_List_0(annotatedContext, inboundMarshaler, client, req, pathParams)
2267
		annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
2268
		if err != nil {
2269
			runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
2270
			return
2271
		}
2272
		forward_Tenancy_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
2273
	})
2274
	return nil
2275
}
2276
2277
var (
2278
	pattern_Tenancy_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "tenants", "create"}, ""))
2279
	pattern_Tenancy_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "tenants", "id"}, ""))
2280
	pattern_Tenancy_List_0   = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "tenants", "list"}, ""))
2281
)
2282
2283
var (
2284
	forward_Tenancy_Create_0 = runtime.ForwardResponseMessage
2285
	forward_Tenancy_Delete_0 = runtime.ForwardResponseMessage
2286
	forward_Tenancy_List_0   = runtime.ForwardResponseMessage
2287
)
2288