1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package ml
22
23 import (
24 context "context"
25 reflect "reflect"
26 sync "sync"
27
28 _ "google.golang.org/genproto/googleapis/api/annotations"
29 httpbody "google.golang.org/genproto/googleapis/api/httpbody"
30 grpc "google.golang.org/grpc"
31 codes "google.golang.org/grpc/codes"
32 status "google.golang.org/grpc/status"
33 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
34 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
35 )
36
37 const (
38
39 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
40
41 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
42 )
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246 type PredictRequest struct {
247 state protoimpl.MessageState
248 sizeCache protoimpl.SizeCache
249 unknownFields protoimpl.UnknownFields
250
251
252
253
254 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
255
256
257 HttpBody *httpbody.HttpBody `protobuf:"bytes,2,opt,name=http_body,json=httpBody,proto3" json:"http_body,omitempty"`
258 }
259
260 func (x *PredictRequest) Reset() {
261 *x = PredictRequest{}
262 if protoimpl.UnsafeEnabled {
263 mi := &file_google_cloud_ml_v1_prediction_service_proto_msgTypes[0]
264 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
265 ms.StoreMessageInfo(mi)
266 }
267 }
268
269 func (x *PredictRequest) String() string {
270 return protoimpl.X.MessageStringOf(x)
271 }
272
273 func (*PredictRequest) ProtoMessage() {}
274
275 func (x *PredictRequest) ProtoReflect() protoreflect.Message {
276 mi := &file_google_cloud_ml_v1_prediction_service_proto_msgTypes[0]
277 if protoimpl.UnsafeEnabled && x != nil {
278 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
279 if ms.LoadMessageInfo() == nil {
280 ms.StoreMessageInfo(mi)
281 }
282 return ms
283 }
284 return mi.MessageOf(x)
285 }
286
287
288 func (*PredictRequest) Descriptor() ([]byte, []int) {
289 return file_google_cloud_ml_v1_prediction_service_proto_rawDescGZIP(), []int{0}
290 }
291
292 func (x *PredictRequest) GetName() string {
293 if x != nil {
294 return x.Name
295 }
296 return ""
297 }
298
299 func (x *PredictRequest) GetHttpBody() *httpbody.HttpBody {
300 if x != nil {
301 return x.HttpBody
302 }
303 return nil
304 }
305
306 var File_google_cloud_ml_v1_prediction_service_proto protoreflect.FileDescriptor
307
308 var file_google_cloud_ml_v1_prediction_service_proto_rawDesc = []byte{
309 0x0a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d,
310 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
311 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67,
312 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x6c, 0x2e, 0x76,
313 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
314 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
315 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x68, 0x74, 0x74, 0x70,
316 0x62, 0x6f, 0x64, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x0e, 0x50, 0x72,
317 0x65, 0x64, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
318 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
319 0x12, 0x31, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20,
320 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69,
321 0x2e, 0x48, 0x74, 0x74, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x08, 0x68, 0x74, 0x74, 0x70, 0x42,
322 0x6f, 0x64, 0x79, 0x32, 0x89, 0x01, 0x0a, 0x17, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72,
323 0x65, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
324 0x6e, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f,
325 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x6c, 0x2e, 0x76, 0x31, 0x2e,
326 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
327 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x74, 0x74, 0x70,
328 0x42, 0x6f, 0x64, 0x79, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x22, 0x1e, 0x2f, 0x76,
329 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
330 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x3a, 0x01, 0x2a, 0x42,
331 0x6c, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
332 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x6c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x16, 0x50,
333 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
334 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
335 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72,
336 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63,
337 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6d, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6c, 0x62, 0x06, 0x70,
338 0x72, 0x6f, 0x74, 0x6f, 0x33,
339 }
340
341 var (
342 file_google_cloud_ml_v1_prediction_service_proto_rawDescOnce sync.Once
343 file_google_cloud_ml_v1_prediction_service_proto_rawDescData = file_google_cloud_ml_v1_prediction_service_proto_rawDesc
344 )
345
346 func file_google_cloud_ml_v1_prediction_service_proto_rawDescGZIP() []byte {
347 file_google_cloud_ml_v1_prediction_service_proto_rawDescOnce.Do(func() {
348 file_google_cloud_ml_v1_prediction_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_ml_v1_prediction_service_proto_rawDescData)
349 })
350 return file_google_cloud_ml_v1_prediction_service_proto_rawDescData
351 }
352
353 var file_google_cloud_ml_v1_prediction_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
354 var file_google_cloud_ml_v1_prediction_service_proto_goTypes = []interface{}{
355 (*PredictRequest)(nil),
356 (*httpbody.HttpBody)(nil),
357 }
358 var file_google_cloud_ml_v1_prediction_service_proto_depIdxs = []int32{
359 1,
360 0,
361 1,
362 2,
363 1,
364 1,
365 1,
366 0,
367 }
368
369 func init() { file_google_cloud_ml_v1_prediction_service_proto_init() }
370 func file_google_cloud_ml_v1_prediction_service_proto_init() {
371 if File_google_cloud_ml_v1_prediction_service_proto != nil {
372 return
373 }
374 if !protoimpl.UnsafeEnabled {
375 file_google_cloud_ml_v1_prediction_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
376 switch v := v.(*PredictRequest); i {
377 case 0:
378 return &v.state
379 case 1:
380 return &v.sizeCache
381 case 2:
382 return &v.unknownFields
383 default:
384 return nil
385 }
386 }
387 }
388 type x struct{}
389 out := protoimpl.TypeBuilder{
390 File: protoimpl.DescBuilder{
391 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
392 RawDescriptor: file_google_cloud_ml_v1_prediction_service_proto_rawDesc,
393 NumEnums: 0,
394 NumMessages: 1,
395 NumExtensions: 0,
396 NumServices: 1,
397 },
398 GoTypes: file_google_cloud_ml_v1_prediction_service_proto_goTypes,
399 DependencyIndexes: file_google_cloud_ml_v1_prediction_service_proto_depIdxs,
400 MessageInfos: file_google_cloud_ml_v1_prediction_service_proto_msgTypes,
401 }.Build()
402 File_google_cloud_ml_v1_prediction_service_proto = out.File
403 file_google_cloud_ml_v1_prediction_service_proto_rawDesc = nil
404 file_google_cloud_ml_v1_prediction_service_proto_goTypes = nil
405 file_google_cloud_ml_v1_prediction_service_proto_depIdxs = nil
406 }
407
408
409 var _ context.Context
410 var _ grpc.ClientConnInterface
411
412
413
414 const _ = grpc.SupportPackageIsVersion6
415
416
417
418
419 type OnlinePredictionServiceClient interface {
420
421
422
423 Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
424 }
425
426 type onlinePredictionServiceClient struct {
427 cc grpc.ClientConnInterface
428 }
429
430 func NewOnlinePredictionServiceClient(cc grpc.ClientConnInterface) OnlinePredictionServiceClient {
431 return &onlinePredictionServiceClient{cc}
432 }
433
434 func (c *onlinePredictionServiceClient) Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
435 out := new(httpbody.HttpBody)
436 err := c.cc.Invoke(ctx, "/google.cloud.ml.v1.OnlinePredictionService/Predict", in, out, opts...)
437 if err != nil {
438 return nil, err
439 }
440 return out, nil
441 }
442
443
444 type OnlinePredictionServiceServer interface {
445
446
447
448 Predict(context.Context, *PredictRequest) (*httpbody.HttpBody, error)
449 }
450
451
452 type UnimplementedOnlinePredictionServiceServer struct {
453 }
454
455 func (*UnimplementedOnlinePredictionServiceServer) Predict(context.Context, *PredictRequest) (*httpbody.HttpBody, error) {
456 return nil, status.Errorf(codes.Unimplemented, "method Predict not implemented")
457 }
458
459 func RegisterOnlinePredictionServiceServer(s *grpc.Server, srv OnlinePredictionServiceServer) {
460 s.RegisterService(&_OnlinePredictionService_serviceDesc, srv)
461 }
462
463 func _OnlinePredictionService_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
464 in := new(PredictRequest)
465 if err := dec(in); err != nil {
466 return nil, err
467 }
468 if interceptor == nil {
469 return srv.(OnlinePredictionServiceServer).Predict(ctx, in)
470 }
471 info := &grpc.UnaryServerInfo{
472 Server: srv,
473 FullMethod: "/google.cloud.ml.v1.OnlinePredictionService/Predict",
474 }
475 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
476 return srv.(OnlinePredictionServiceServer).Predict(ctx, req.(*PredictRequest))
477 }
478 return interceptor(ctx, in, info, handler)
479 }
480
481 var _OnlinePredictionService_serviceDesc = grpc.ServiceDesc{
482 ServiceName: "google.cloud.ml.v1.OnlinePredictionService",
483 HandlerType: (*OnlinePredictionServiceServer)(nil),
484 Methods: []grpc.MethodDesc{
485 {
486 MethodName: "Predict",
487 Handler: _OnlinePredictionService_Predict_Handler,
488 },
489 },
490 Streams: []grpc.StreamDesc{},
491 Metadata: "google/cloud/ml/v1/prediction_service.proto",
492 }
493
View as plain text