clarifai-web-grpc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.github/workflows/ci.yml +41 -0
  2. package/.husky/commit-msg +4 -0
  3. package/.husky/pre-commit +4 -0
  4. package/.mocharc.yml +5 -0
  5. package/CHANGELOG.md +6 -0
  6. package/LICENCE +13 -0
  7. package/README.md +43 -0
  8. package/VERSION +1 -0
  9. package/dist/google/api/annotations_pb.d.ts +1 -0
  10. package/dist/google/api/annotations_pb.js +32 -0
  11. package/dist/google/api/http_pb.d.ts +1 -0
  12. package/dist/google/api/http_pb.js +813 -0
  13. package/dist/index.d.ts +5 -0
  14. package/dist/index.js +7 -0
  15. package/dist/proto/clarifai/api/resources_pb.d.ts +1 -0
  16. package/dist/proto/clarifai/api/resources_pb.js +32957 -0
  17. package/dist/proto/clarifai/api/serviceServiceClientPb.d.ts +275 -0
  18. package/dist/proto/clarifai/api/serviceServiceClientPb.js +904 -0
  19. package/dist/proto/clarifai/api/service_pb.d.ts +1 -0
  20. package/dist/proto/clarifai/api/service_pb.js +38791 -0
  21. package/dist/proto/clarifai/api/status/status_code_pb.d.ts +1 -0
  22. package/dist/proto/clarifai/api/status/status_code_pb.js +312 -0
  23. package/dist/proto/clarifai/api/status/status_pb.d.ts +1 -0
  24. package/dist/proto/clarifai/api/status/status_pb.js +473 -0
  25. package/dist/proto/clarifai/api/utils/extensions_pb.d.ts +1 -0
  26. package/dist/proto/clarifai/api/utils/extensions_pb.js +52 -0
  27. package/dist/proto/clarifai/api/utils/test_proto_pb.d.ts +1 -0
  28. package/dist/proto/clarifai/api/utils/test_proto_pb.js +521 -0
  29. package/dist/proto/clarifai/auth/scope/scope_pb.d.ts +1 -0
  30. package/dist/proto/clarifai/auth/scope/scope_pb.js +294 -0
  31. package/dist/proto/clarifai/auth/types/types_pb.d.ts +1 -0
  32. package/dist/proto/clarifai/auth/types/types_pb.js +26 -0
  33. package/dist/proto/clarifai/auth/util/extension_pb.d.ts +1 -0
  34. package/dist/proto/clarifai/auth/util/extension_pb.js +80 -0
  35. package/dist/resources.d.ts +1 -0
  36. package/dist/resources.js +1 -0
  37. package/dist/service.d.ts +1 -0
  38. package/dist/service.js +1 -0
  39. package/google/api/annotations_grpc_pb.js +1 -0
  40. package/google/api/annotations_pb.js +47 -0
  41. package/google/api/http_grpc_pb.js +1 -0
  42. package/google/api/http_pb.js +1005 -0
  43. package/index.ts +9 -0
  44. package/package.json +52 -0
  45. package/proto/clarifai/api/resources_pb.d.ts +5052 -0
  46. package/proto/clarifai/api/resources_pb.js +41204 -0
  47. package/proto/clarifai/api/serviceServiceClientPb.ts +3002 -0
  48. package/proto/clarifai/api/service_pb.d.ts +5582 -0
  49. package/proto/clarifai/api/service_pb.js +47897 -0
  50. package/proto/clarifai/api/status/status_code_pb.d.ts +296 -0
  51. package/proto/clarifai/api/status/status_code_pb.js +314 -0
  52. package/proto/clarifai/api/status/status_pb.d.ts +73 -0
  53. package/proto/clarifai/api/status/status_pb.js +580 -0
  54. package/proto/clarifai/api/utils/extensions_pb.d.ts +4 -0
  55. package/proto/clarifai/api/utils/extensions_pb.js +95 -0
  56. package/proto/clarifai/api/utils/test_proto_pb.d.ts +81 -0
  57. package/proto/clarifai/api/utils/test_proto_pb.js +640 -0
  58. package/proto/clarifai/auth/scope/scope_pb.d.ts +92 -0
  59. package/proto/clarifai/auth/scope/scope_pb.js +363 -0
  60. package/proto/clarifai/auth/types/types_pb.d.ts +10 -0
  61. package/proto/clarifai/auth/types/types_pb.js +28 -0
  62. package/proto/clarifai/auth/util/extension_pb.d.ts +6 -0
  63. package/proto/clarifai/auth/util/extension_pb.js +151 -0
  64. package/resources.ts +1 -0
  65. package/service.desc +10 -0
  66. package/service.ts +1 -0
  67. package/tests/basic.test.ts +14 -0
  68. package/tsconfig.json +25 -0
@@ -0,0 +1,1005 @@
1
+ // source: google/api/http.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
6
+ * field starts with 'MSG_' and isn't a translatable message.
7
+ * @public
8
+ */
9
+ // GENERATED CODE -- DO NOT EDIT!
10
+ /* eslint-disable */
11
+ // @ts-nocheck
12
+
13
+ var jspb = require('google-protobuf');
14
+ var goog = jspb;
15
+ var global = Function('return this')();
16
+
17
+ goog.exportSymbol('proto.google.api.CustomHttpPattern', null, global);
18
+ goog.exportSymbol('proto.google.api.Http', null, global);
19
+ goog.exportSymbol('proto.google.api.HttpRule', null, global);
20
+ goog.exportSymbol('proto.google.api.HttpRule.PatternCase', null, global);
21
+ /**
22
+ * Generated by JsPbCodeGenerator.
23
+ * @param {Array=} opt_data Optional initial data array, typically from a
24
+ * server response, or constructed directly in Javascript. The array is used
25
+ * in place and becomes part of the constructed object. It is not cloned.
26
+ * If no data is provided, the constructed object will be empty, but still
27
+ * valid.
28
+ * @extends {jspb.Message}
29
+ * @constructor
30
+ */
31
+ proto.google.api.Http = function(opt_data) {
32
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.Http.repeatedFields_, null);
33
+ };
34
+ goog.inherits(proto.google.api.Http, jspb.Message);
35
+ if (goog.DEBUG && !COMPILED) {
36
+ /**
37
+ * @public
38
+ * @override
39
+ */
40
+ proto.google.api.Http.displayName = 'proto.google.api.Http';
41
+ }
42
+ /**
43
+ * Generated by JsPbCodeGenerator.
44
+ * @param {Array=} opt_data Optional initial data array, typically from a
45
+ * server response, or constructed directly in Javascript. The array is used
46
+ * in place and becomes part of the constructed object. It is not cloned.
47
+ * If no data is provided, the constructed object will be empty, but still
48
+ * valid.
49
+ * @extends {jspb.Message}
50
+ * @constructor
51
+ */
52
+ proto.google.api.HttpRule = function(opt_data) {
53
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.HttpRule.repeatedFields_, proto.google.api.HttpRule.oneofGroups_);
54
+ };
55
+ goog.inherits(proto.google.api.HttpRule, jspb.Message);
56
+ if (goog.DEBUG && !COMPILED) {
57
+ /**
58
+ * @public
59
+ * @override
60
+ */
61
+ proto.google.api.HttpRule.displayName = 'proto.google.api.HttpRule';
62
+ }
63
+ /**
64
+ * Generated by JsPbCodeGenerator.
65
+ * @param {Array=} opt_data Optional initial data array, typically from a
66
+ * server response, or constructed directly in Javascript. The array is used
67
+ * in place and becomes part of the constructed object. It is not cloned.
68
+ * If no data is provided, the constructed object will be empty, but still
69
+ * valid.
70
+ * @extends {jspb.Message}
71
+ * @constructor
72
+ */
73
+ proto.google.api.CustomHttpPattern = function(opt_data) {
74
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
75
+ };
76
+ goog.inherits(proto.google.api.CustomHttpPattern, jspb.Message);
77
+ if (goog.DEBUG && !COMPILED) {
78
+ /**
79
+ * @public
80
+ * @override
81
+ */
82
+ proto.google.api.CustomHttpPattern.displayName = 'proto.google.api.CustomHttpPattern';
83
+ }
84
+
85
+ /**
86
+ * List of repeated fields within this message type.
87
+ * @private {!Array<number>}
88
+ * @const
89
+ */
90
+ proto.google.api.Http.repeatedFields_ = [1];
91
+
92
+
93
+
94
+ if (jspb.Message.GENERATE_TO_OBJECT) {
95
+ /**
96
+ * Creates an object representation of this proto.
97
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
98
+ * Optional fields that are not set will be set to undefined.
99
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
100
+ * For the list of reserved names please see:
101
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
102
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
103
+ * JSPB instance for transitional soy proto support:
104
+ * http://goto/soy-param-migration
105
+ * @return {!Object}
106
+ */
107
+ proto.google.api.Http.prototype.toObject = function(opt_includeInstance) {
108
+ return proto.google.api.Http.toObject(opt_includeInstance, this);
109
+ };
110
+
111
+
112
+ /**
113
+ * Static version of the {@see toObject} method.
114
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
115
+ * the JSPB instance for transitional soy proto support:
116
+ * http://goto/soy-param-migration
117
+ * @param {!proto.google.api.Http} msg The msg instance to transform.
118
+ * @return {!Object}
119
+ * @suppress {unusedLocalVariables} f is only used for nested messages
120
+ */
121
+ proto.google.api.Http.toObject = function(includeInstance, msg) {
122
+ var f, obj = {
123
+ rulesList: jspb.Message.toObjectList(msg.getRulesList(),
124
+ proto.google.api.HttpRule.toObject, includeInstance),
125
+ fullyDecodeReservedExpansion: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
126
+ };
127
+
128
+ if (includeInstance) {
129
+ obj.$jspbMessageInstance = msg;
130
+ }
131
+ return obj;
132
+ };
133
+ }
134
+
135
+
136
+ /**
137
+ * Deserializes binary data (in protobuf wire format).
138
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
139
+ * @return {!proto.google.api.Http}
140
+ */
141
+ proto.google.api.Http.deserializeBinary = function(bytes) {
142
+ var reader = new jspb.BinaryReader(bytes);
143
+ var msg = new proto.google.api.Http;
144
+ return proto.google.api.Http.deserializeBinaryFromReader(msg, reader);
145
+ };
146
+
147
+
148
+ /**
149
+ * Deserializes binary data (in protobuf wire format) from the
150
+ * given reader into the given message object.
151
+ * @param {!proto.google.api.Http} msg The message object to deserialize into.
152
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
153
+ * @return {!proto.google.api.Http}
154
+ */
155
+ proto.google.api.Http.deserializeBinaryFromReader = function(msg, reader) {
156
+ while (reader.nextField()) {
157
+ if (reader.isEndGroup()) {
158
+ break;
159
+ }
160
+ var field = reader.getFieldNumber();
161
+ switch (field) {
162
+ case 1:
163
+ var value = new proto.google.api.HttpRule;
164
+ reader.readMessage(value,proto.google.api.HttpRule.deserializeBinaryFromReader);
165
+ msg.addRules(value);
166
+ break;
167
+ case 2:
168
+ var value = /** @type {boolean} */ (reader.readBool());
169
+ msg.setFullyDecodeReservedExpansion(value);
170
+ break;
171
+ default:
172
+ reader.skipField();
173
+ break;
174
+ }
175
+ }
176
+ return msg;
177
+ };
178
+
179
+
180
+ /**
181
+ * Serializes the message to binary data (in protobuf wire format).
182
+ * @return {!Uint8Array}
183
+ */
184
+ proto.google.api.Http.prototype.serializeBinary = function() {
185
+ var writer = new jspb.BinaryWriter();
186
+ proto.google.api.Http.serializeBinaryToWriter(this, writer);
187
+ return writer.getResultBuffer();
188
+ };
189
+
190
+
191
+ /**
192
+ * Serializes the given message to binary data (in protobuf wire
193
+ * format), writing to the given BinaryWriter.
194
+ * @param {!proto.google.api.Http} message
195
+ * @param {!jspb.BinaryWriter} writer
196
+ * @suppress {unusedLocalVariables} f is only used for nested messages
197
+ */
198
+ proto.google.api.Http.serializeBinaryToWriter = function(message, writer) {
199
+ var f = undefined;
200
+ f = message.getRulesList();
201
+ if (f.length > 0) {
202
+ writer.writeRepeatedMessage(
203
+ 1,
204
+ f,
205
+ proto.google.api.HttpRule.serializeBinaryToWriter
206
+ );
207
+ }
208
+ f = message.getFullyDecodeReservedExpansion();
209
+ if (f) {
210
+ writer.writeBool(
211
+ 2,
212
+ f
213
+ );
214
+ }
215
+ };
216
+
217
+
218
+ /**
219
+ * repeated HttpRule rules = 1;
220
+ * @return {!Array<!proto.google.api.HttpRule>}
221
+ */
222
+ proto.google.api.Http.prototype.getRulesList = function() {
223
+ return /** @type{!Array<!proto.google.api.HttpRule>} */ (
224
+ jspb.Message.getRepeatedWrapperField(this, proto.google.api.HttpRule, 1));
225
+ };
226
+
227
+
228
+ /**
229
+ * @param {!Array<!proto.google.api.HttpRule>} value
230
+ * @return {!proto.google.api.Http} returns this
231
+ */
232
+ proto.google.api.Http.prototype.setRulesList = function(value) {
233
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
234
+ };
235
+
236
+
237
+ /**
238
+ * @param {!proto.google.api.HttpRule=} opt_value
239
+ * @param {number=} opt_index
240
+ * @return {!proto.google.api.HttpRule}
241
+ */
242
+ proto.google.api.Http.prototype.addRules = function(opt_value, opt_index) {
243
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.google.api.HttpRule, opt_index);
244
+ };
245
+
246
+
247
+ /**
248
+ * Clears the list making it empty but non-null.
249
+ * @return {!proto.google.api.Http} returns this
250
+ */
251
+ proto.google.api.Http.prototype.clearRulesList = function() {
252
+ return this.setRulesList([]);
253
+ };
254
+
255
+
256
+ /**
257
+ * optional bool fully_decode_reserved_expansion = 2;
258
+ * @return {boolean}
259
+ */
260
+ proto.google.api.Http.prototype.getFullyDecodeReservedExpansion = function() {
261
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
262
+ };
263
+
264
+
265
+ /**
266
+ * @param {boolean} value
267
+ * @return {!proto.google.api.Http} returns this
268
+ */
269
+ proto.google.api.Http.prototype.setFullyDecodeReservedExpansion = function(value) {
270
+ return jspb.Message.setProto3BooleanField(this, 2, value);
271
+ };
272
+
273
+
274
+
275
+ /**
276
+ * List of repeated fields within this message type.
277
+ * @private {!Array<number>}
278
+ * @const
279
+ */
280
+ proto.google.api.HttpRule.repeatedFields_ = [11];
281
+
282
+ /**
283
+ * Oneof group definitions for this message. Each group defines the field
284
+ * numbers belonging to that group. When of these fields' value is set, all
285
+ * other fields in the group are cleared. During deserialization, if multiple
286
+ * fields are encountered for a group, only the last value seen will be kept.
287
+ * @private {!Array<!Array<number>>}
288
+ * @const
289
+ */
290
+ proto.google.api.HttpRule.oneofGroups_ = [[2,3,4,5,6,8]];
291
+
292
+ /**
293
+ * @enum {number}
294
+ */
295
+ proto.google.api.HttpRule.PatternCase = {
296
+ PATTERN_NOT_SET: 0,
297
+ GET: 2,
298
+ PUT: 3,
299
+ POST: 4,
300
+ DELETE: 5,
301
+ PATCH: 6,
302
+ CUSTOM: 8
303
+ };
304
+
305
+ /**
306
+ * @return {proto.google.api.HttpRule.PatternCase}
307
+ */
308
+ proto.google.api.HttpRule.prototype.getPatternCase = function() {
309
+ return /** @type {proto.google.api.HttpRule.PatternCase} */(jspb.Message.computeOneofCase(this, proto.google.api.HttpRule.oneofGroups_[0]));
310
+ };
311
+
312
+
313
+
314
+ if (jspb.Message.GENERATE_TO_OBJECT) {
315
+ /**
316
+ * Creates an object representation of this proto.
317
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
318
+ * Optional fields that are not set will be set to undefined.
319
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
320
+ * For the list of reserved names please see:
321
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
322
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
323
+ * JSPB instance for transitional soy proto support:
324
+ * http://goto/soy-param-migration
325
+ * @return {!Object}
326
+ */
327
+ proto.google.api.HttpRule.prototype.toObject = function(opt_includeInstance) {
328
+ return proto.google.api.HttpRule.toObject(opt_includeInstance, this);
329
+ };
330
+
331
+
332
+ /**
333
+ * Static version of the {@see toObject} method.
334
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
335
+ * the JSPB instance for transitional soy proto support:
336
+ * http://goto/soy-param-migration
337
+ * @param {!proto.google.api.HttpRule} msg The msg instance to transform.
338
+ * @return {!Object}
339
+ * @suppress {unusedLocalVariables} f is only used for nested messages
340
+ */
341
+ proto.google.api.HttpRule.toObject = function(includeInstance, msg) {
342
+ var f, obj = {
343
+ selector: jspb.Message.getFieldWithDefault(msg, 1, ""),
344
+ get: jspb.Message.getFieldWithDefault(msg, 2, ""),
345
+ put: jspb.Message.getFieldWithDefault(msg, 3, ""),
346
+ post: jspb.Message.getFieldWithDefault(msg, 4, ""),
347
+ pb_delete: jspb.Message.getFieldWithDefault(msg, 5, ""),
348
+ patch: jspb.Message.getFieldWithDefault(msg, 6, ""),
349
+ custom: (f = msg.getCustom()) && proto.google.api.CustomHttpPattern.toObject(includeInstance, f),
350
+ body: jspb.Message.getFieldWithDefault(msg, 7, ""),
351
+ responseBody: jspb.Message.getFieldWithDefault(msg, 12, ""),
352
+ additionalBindingsList: jspb.Message.toObjectList(msg.getAdditionalBindingsList(),
353
+ proto.google.api.HttpRule.toObject, includeInstance)
354
+ };
355
+
356
+ if (includeInstance) {
357
+ obj.$jspbMessageInstance = msg;
358
+ }
359
+ return obj;
360
+ };
361
+ }
362
+
363
+
364
+ /**
365
+ * Deserializes binary data (in protobuf wire format).
366
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
367
+ * @return {!proto.google.api.HttpRule}
368
+ */
369
+ proto.google.api.HttpRule.deserializeBinary = function(bytes) {
370
+ var reader = new jspb.BinaryReader(bytes);
371
+ var msg = new proto.google.api.HttpRule;
372
+ return proto.google.api.HttpRule.deserializeBinaryFromReader(msg, reader);
373
+ };
374
+
375
+
376
+ /**
377
+ * Deserializes binary data (in protobuf wire format) from the
378
+ * given reader into the given message object.
379
+ * @param {!proto.google.api.HttpRule} msg The message object to deserialize into.
380
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
381
+ * @return {!proto.google.api.HttpRule}
382
+ */
383
+ proto.google.api.HttpRule.deserializeBinaryFromReader = function(msg, reader) {
384
+ while (reader.nextField()) {
385
+ if (reader.isEndGroup()) {
386
+ break;
387
+ }
388
+ var field = reader.getFieldNumber();
389
+ switch (field) {
390
+ case 1:
391
+ var value = /** @type {string} */ (reader.readString());
392
+ msg.setSelector(value);
393
+ break;
394
+ case 2:
395
+ var value = /** @type {string} */ (reader.readString());
396
+ msg.setGet(value);
397
+ break;
398
+ case 3:
399
+ var value = /** @type {string} */ (reader.readString());
400
+ msg.setPut(value);
401
+ break;
402
+ case 4:
403
+ var value = /** @type {string} */ (reader.readString());
404
+ msg.setPost(value);
405
+ break;
406
+ case 5:
407
+ var value = /** @type {string} */ (reader.readString());
408
+ msg.setDelete(value);
409
+ break;
410
+ case 6:
411
+ var value = /** @type {string} */ (reader.readString());
412
+ msg.setPatch(value);
413
+ break;
414
+ case 8:
415
+ var value = new proto.google.api.CustomHttpPattern;
416
+ reader.readMessage(value,proto.google.api.CustomHttpPattern.deserializeBinaryFromReader);
417
+ msg.setCustom(value);
418
+ break;
419
+ case 7:
420
+ var value = /** @type {string} */ (reader.readString());
421
+ msg.setBody(value);
422
+ break;
423
+ case 12:
424
+ var value = /** @type {string} */ (reader.readString());
425
+ msg.setResponseBody(value);
426
+ break;
427
+ case 11:
428
+ var value = new proto.google.api.HttpRule;
429
+ reader.readMessage(value,proto.google.api.HttpRule.deserializeBinaryFromReader);
430
+ msg.addAdditionalBindings(value);
431
+ break;
432
+ default:
433
+ reader.skipField();
434
+ break;
435
+ }
436
+ }
437
+ return msg;
438
+ };
439
+
440
+
441
+ /**
442
+ * Serializes the message to binary data (in protobuf wire format).
443
+ * @return {!Uint8Array}
444
+ */
445
+ proto.google.api.HttpRule.prototype.serializeBinary = function() {
446
+ var writer = new jspb.BinaryWriter();
447
+ proto.google.api.HttpRule.serializeBinaryToWriter(this, writer);
448
+ return writer.getResultBuffer();
449
+ };
450
+
451
+
452
+ /**
453
+ * Serializes the given message to binary data (in protobuf wire
454
+ * format), writing to the given BinaryWriter.
455
+ * @param {!proto.google.api.HttpRule} message
456
+ * @param {!jspb.BinaryWriter} writer
457
+ * @suppress {unusedLocalVariables} f is only used for nested messages
458
+ */
459
+ proto.google.api.HttpRule.serializeBinaryToWriter = function(message, writer) {
460
+ var f = undefined;
461
+ f = message.getSelector();
462
+ if (f.length > 0) {
463
+ writer.writeString(
464
+ 1,
465
+ f
466
+ );
467
+ }
468
+ f = /** @type {string} */ (jspb.Message.getField(message, 2));
469
+ if (f != null) {
470
+ writer.writeString(
471
+ 2,
472
+ f
473
+ );
474
+ }
475
+ f = /** @type {string} */ (jspb.Message.getField(message, 3));
476
+ if (f != null) {
477
+ writer.writeString(
478
+ 3,
479
+ f
480
+ );
481
+ }
482
+ f = /** @type {string} */ (jspb.Message.getField(message, 4));
483
+ if (f != null) {
484
+ writer.writeString(
485
+ 4,
486
+ f
487
+ );
488
+ }
489
+ f = /** @type {string} */ (jspb.Message.getField(message, 5));
490
+ if (f != null) {
491
+ writer.writeString(
492
+ 5,
493
+ f
494
+ );
495
+ }
496
+ f = /** @type {string} */ (jspb.Message.getField(message, 6));
497
+ if (f != null) {
498
+ writer.writeString(
499
+ 6,
500
+ f
501
+ );
502
+ }
503
+ f = message.getCustom();
504
+ if (f != null) {
505
+ writer.writeMessage(
506
+ 8,
507
+ f,
508
+ proto.google.api.CustomHttpPattern.serializeBinaryToWriter
509
+ );
510
+ }
511
+ f = message.getBody();
512
+ if (f.length > 0) {
513
+ writer.writeString(
514
+ 7,
515
+ f
516
+ );
517
+ }
518
+ f = message.getResponseBody();
519
+ if (f.length > 0) {
520
+ writer.writeString(
521
+ 12,
522
+ f
523
+ );
524
+ }
525
+ f = message.getAdditionalBindingsList();
526
+ if (f.length > 0) {
527
+ writer.writeRepeatedMessage(
528
+ 11,
529
+ f,
530
+ proto.google.api.HttpRule.serializeBinaryToWriter
531
+ );
532
+ }
533
+ };
534
+
535
+
536
+ /**
537
+ * optional string selector = 1;
538
+ * @return {string}
539
+ */
540
+ proto.google.api.HttpRule.prototype.getSelector = function() {
541
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
542
+ };
543
+
544
+
545
+ /**
546
+ * @param {string} value
547
+ * @return {!proto.google.api.HttpRule} returns this
548
+ */
549
+ proto.google.api.HttpRule.prototype.setSelector = function(value) {
550
+ return jspb.Message.setProto3StringField(this, 1, value);
551
+ };
552
+
553
+
554
+ /**
555
+ * optional string get = 2;
556
+ * @return {string}
557
+ */
558
+ proto.google.api.HttpRule.prototype.getGet = function() {
559
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
560
+ };
561
+
562
+
563
+ /**
564
+ * @param {string} value
565
+ * @return {!proto.google.api.HttpRule} returns this
566
+ */
567
+ proto.google.api.HttpRule.prototype.setGet = function(value) {
568
+ return jspb.Message.setOneofField(this, 2, proto.google.api.HttpRule.oneofGroups_[0], value);
569
+ };
570
+
571
+
572
+ /**
573
+ * Clears the field making it undefined.
574
+ * @return {!proto.google.api.HttpRule} returns this
575
+ */
576
+ proto.google.api.HttpRule.prototype.clearGet = function() {
577
+ return jspb.Message.setOneofField(this, 2, proto.google.api.HttpRule.oneofGroups_[0], undefined);
578
+ };
579
+
580
+
581
+ /**
582
+ * Returns whether this field is set.
583
+ * @return {boolean}
584
+ */
585
+ proto.google.api.HttpRule.prototype.hasGet = function() {
586
+ return jspb.Message.getField(this, 2) != null;
587
+ };
588
+
589
+
590
+ /**
591
+ * optional string put = 3;
592
+ * @return {string}
593
+ */
594
+ proto.google.api.HttpRule.prototype.getPut = function() {
595
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
596
+ };
597
+
598
+
599
+ /**
600
+ * @param {string} value
601
+ * @return {!proto.google.api.HttpRule} returns this
602
+ */
603
+ proto.google.api.HttpRule.prototype.setPut = function(value) {
604
+ return jspb.Message.setOneofField(this, 3, proto.google.api.HttpRule.oneofGroups_[0], value);
605
+ };
606
+
607
+
608
+ /**
609
+ * Clears the field making it undefined.
610
+ * @return {!proto.google.api.HttpRule} returns this
611
+ */
612
+ proto.google.api.HttpRule.prototype.clearPut = function() {
613
+ return jspb.Message.setOneofField(this, 3, proto.google.api.HttpRule.oneofGroups_[0], undefined);
614
+ };
615
+
616
+
617
+ /**
618
+ * Returns whether this field is set.
619
+ * @return {boolean}
620
+ */
621
+ proto.google.api.HttpRule.prototype.hasPut = function() {
622
+ return jspb.Message.getField(this, 3) != null;
623
+ };
624
+
625
+
626
+ /**
627
+ * optional string post = 4;
628
+ * @return {string}
629
+ */
630
+ proto.google.api.HttpRule.prototype.getPost = function() {
631
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
632
+ };
633
+
634
+
635
+ /**
636
+ * @param {string} value
637
+ * @return {!proto.google.api.HttpRule} returns this
638
+ */
639
+ proto.google.api.HttpRule.prototype.setPost = function(value) {
640
+ return jspb.Message.setOneofField(this, 4, proto.google.api.HttpRule.oneofGroups_[0], value);
641
+ };
642
+
643
+
644
+ /**
645
+ * Clears the field making it undefined.
646
+ * @return {!proto.google.api.HttpRule} returns this
647
+ */
648
+ proto.google.api.HttpRule.prototype.clearPost = function() {
649
+ return jspb.Message.setOneofField(this, 4, proto.google.api.HttpRule.oneofGroups_[0], undefined);
650
+ };
651
+
652
+
653
+ /**
654
+ * Returns whether this field is set.
655
+ * @return {boolean}
656
+ */
657
+ proto.google.api.HttpRule.prototype.hasPost = function() {
658
+ return jspb.Message.getField(this, 4) != null;
659
+ };
660
+
661
+
662
+ /**
663
+ * optional string delete = 5;
664
+ * @return {string}
665
+ */
666
+ proto.google.api.HttpRule.prototype.getDelete = function() {
667
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
668
+ };
669
+
670
+
671
+ /**
672
+ * @param {string} value
673
+ * @return {!proto.google.api.HttpRule} returns this
674
+ */
675
+ proto.google.api.HttpRule.prototype.setDelete = function(value) {
676
+ return jspb.Message.setOneofField(this, 5, proto.google.api.HttpRule.oneofGroups_[0], value);
677
+ };
678
+
679
+
680
+ /**
681
+ * Clears the field making it undefined.
682
+ * @return {!proto.google.api.HttpRule} returns this
683
+ */
684
+ proto.google.api.HttpRule.prototype.clearDelete = function() {
685
+ return jspb.Message.setOneofField(this, 5, proto.google.api.HttpRule.oneofGroups_[0], undefined);
686
+ };
687
+
688
+
689
+ /**
690
+ * Returns whether this field is set.
691
+ * @return {boolean}
692
+ */
693
+ proto.google.api.HttpRule.prototype.hasDelete = function() {
694
+ return jspb.Message.getField(this, 5) != null;
695
+ };
696
+
697
+
698
+ /**
699
+ * optional string patch = 6;
700
+ * @return {string}
701
+ */
702
+ proto.google.api.HttpRule.prototype.getPatch = function() {
703
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
704
+ };
705
+
706
+
707
+ /**
708
+ * @param {string} value
709
+ * @return {!proto.google.api.HttpRule} returns this
710
+ */
711
+ proto.google.api.HttpRule.prototype.setPatch = function(value) {
712
+ return jspb.Message.setOneofField(this, 6, proto.google.api.HttpRule.oneofGroups_[0], value);
713
+ };
714
+
715
+
716
+ /**
717
+ * Clears the field making it undefined.
718
+ * @return {!proto.google.api.HttpRule} returns this
719
+ */
720
+ proto.google.api.HttpRule.prototype.clearPatch = function() {
721
+ return jspb.Message.setOneofField(this, 6, proto.google.api.HttpRule.oneofGroups_[0], undefined);
722
+ };
723
+
724
+
725
+ /**
726
+ * Returns whether this field is set.
727
+ * @return {boolean}
728
+ */
729
+ proto.google.api.HttpRule.prototype.hasPatch = function() {
730
+ return jspb.Message.getField(this, 6) != null;
731
+ };
732
+
733
+
734
+ /**
735
+ * optional CustomHttpPattern custom = 8;
736
+ * @return {?proto.google.api.CustomHttpPattern}
737
+ */
738
+ proto.google.api.HttpRule.prototype.getCustom = function() {
739
+ return /** @type{?proto.google.api.CustomHttpPattern} */ (
740
+ jspb.Message.getWrapperField(this, proto.google.api.CustomHttpPattern, 8));
741
+ };
742
+
743
+
744
+ /**
745
+ * @param {?proto.google.api.CustomHttpPattern|undefined} value
746
+ * @return {!proto.google.api.HttpRule} returns this
747
+ */
748
+ proto.google.api.HttpRule.prototype.setCustom = function(value) {
749
+ return jspb.Message.setOneofWrapperField(this, 8, proto.google.api.HttpRule.oneofGroups_[0], value);
750
+ };
751
+
752
+
753
+ /**
754
+ * Clears the message field making it undefined.
755
+ * @return {!proto.google.api.HttpRule} returns this
756
+ */
757
+ proto.google.api.HttpRule.prototype.clearCustom = function() {
758
+ return this.setCustom(undefined);
759
+ };
760
+
761
+
762
+ /**
763
+ * Returns whether this field is set.
764
+ * @return {boolean}
765
+ */
766
+ proto.google.api.HttpRule.prototype.hasCustom = function() {
767
+ return jspb.Message.getField(this, 8) != null;
768
+ };
769
+
770
+
771
+ /**
772
+ * optional string body = 7;
773
+ * @return {string}
774
+ */
775
+ proto.google.api.HttpRule.prototype.getBody = function() {
776
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
777
+ };
778
+
779
+
780
+ /**
781
+ * @param {string} value
782
+ * @return {!proto.google.api.HttpRule} returns this
783
+ */
784
+ proto.google.api.HttpRule.prototype.setBody = function(value) {
785
+ return jspb.Message.setProto3StringField(this, 7, value);
786
+ };
787
+
788
+
789
+ /**
790
+ * optional string response_body = 12;
791
+ * @return {string}
792
+ */
793
+ proto.google.api.HttpRule.prototype.getResponseBody = function() {
794
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, ""));
795
+ };
796
+
797
+
798
+ /**
799
+ * @param {string} value
800
+ * @return {!proto.google.api.HttpRule} returns this
801
+ */
802
+ proto.google.api.HttpRule.prototype.setResponseBody = function(value) {
803
+ return jspb.Message.setProto3StringField(this, 12, value);
804
+ };
805
+
806
+
807
+ /**
808
+ * repeated HttpRule additional_bindings = 11;
809
+ * @return {!Array<!proto.google.api.HttpRule>}
810
+ */
811
+ proto.google.api.HttpRule.prototype.getAdditionalBindingsList = function() {
812
+ return /** @type{!Array<!proto.google.api.HttpRule>} */ (
813
+ jspb.Message.getRepeatedWrapperField(this, proto.google.api.HttpRule, 11));
814
+ };
815
+
816
+
817
+ /**
818
+ * @param {!Array<!proto.google.api.HttpRule>} value
819
+ * @return {!proto.google.api.HttpRule} returns this
820
+ */
821
+ proto.google.api.HttpRule.prototype.setAdditionalBindingsList = function(value) {
822
+ return jspb.Message.setRepeatedWrapperField(this, 11, value);
823
+ };
824
+
825
+
826
+ /**
827
+ * @param {!proto.google.api.HttpRule=} opt_value
828
+ * @param {number=} opt_index
829
+ * @return {!proto.google.api.HttpRule}
830
+ */
831
+ proto.google.api.HttpRule.prototype.addAdditionalBindings = function(opt_value, opt_index) {
832
+ return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.google.api.HttpRule, opt_index);
833
+ };
834
+
835
+
836
+ /**
837
+ * Clears the list making it empty but non-null.
838
+ * @return {!proto.google.api.HttpRule} returns this
839
+ */
840
+ proto.google.api.HttpRule.prototype.clearAdditionalBindingsList = function() {
841
+ return this.setAdditionalBindingsList([]);
842
+ };
843
+
844
+
845
+
846
+
847
+
848
+ if (jspb.Message.GENERATE_TO_OBJECT) {
849
+ /**
850
+ * Creates an object representation of this proto.
851
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
852
+ * Optional fields that are not set will be set to undefined.
853
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
854
+ * For the list of reserved names please see:
855
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
856
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
857
+ * JSPB instance for transitional soy proto support:
858
+ * http://goto/soy-param-migration
859
+ * @return {!Object}
860
+ */
861
+ proto.google.api.CustomHttpPattern.prototype.toObject = function(opt_includeInstance) {
862
+ return proto.google.api.CustomHttpPattern.toObject(opt_includeInstance, this);
863
+ };
864
+
865
+
866
+ /**
867
+ * Static version of the {@see toObject} method.
868
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
869
+ * the JSPB instance for transitional soy proto support:
870
+ * http://goto/soy-param-migration
871
+ * @param {!proto.google.api.CustomHttpPattern} msg The msg instance to transform.
872
+ * @return {!Object}
873
+ * @suppress {unusedLocalVariables} f is only used for nested messages
874
+ */
875
+ proto.google.api.CustomHttpPattern.toObject = function(includeInstance, msg) {
876
+ var f, obj = {
877
+ kind: jspb.Message.getFieldWithDefault(msg, 1, ""),
878
+ path: jspb.Message.getFieldWithDefault(msg, 2, "")
879
+ };
880
+
881
+ if (includeInstance) {
882
+ obj.$jspbMessageInstance = msg;
883
+ }
884
+ return obj;
885
+ };
886
+ }
887
+
888
+
889
+ /**
890
+ * Deserializes binary data (in protobuf wire format).
891
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
892
+ * @return {!proto.google.api.CustomHttpPattern}
893
+ */
894
+ proto.google.api.CustomHttpPattern.deserializeBinary = function(bytes) {
895
+ var reader = new jspb.BinaryReader(bytes);
896
+ var msg = new proto.google.api.CustomHttpPattern;
897
+ return proto.google.api.CustomHttpPattern.deserializeBinaryFromReader(msg, reader);
898
+ };
899
+
900
+
901
+ /**
902
+ * Deserializes binary data (in protobuf wire format) from the
903
+ * given reader into the given message object.
904
+ * @param {!proto.google.api.CustomHttpPattern} msg The message object to deserialize into.
905
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
906
+ * @return {!proto.google.api.CustomHttpPattern}
907
+ */
908
+ proto.google.api.CustomHttpPattern.deserializeBinaryFromReader = function(msg, reader) {
909
+ while (reader.nextField()) {
910
+ if (reader.isEndGroup()) {
911
+ break;
912
+ }
913
+ var field = reader.getFieldNumber();
914
+ switch (field) {
915
+ case 1:
916
+ var value = /** @type {string} */ (reader.readString());
917
+ msg.setKind(value);
918
+ break;
919
+ case 2:
920
+ var value = /** @type {string} */ (reader.readString());
921
+ msg.setPath(value);
922
+ break;
923
+ default:
924
+ reader.skipField();
925
+ break;
926
+ }
927
+ }
928
+ return msg;
929
+ };
930
+
931
+
932
+ /**
933
+ * Serializes the message to binary data (in protobuf wire format).
934
+ * @return {!Uint8Array}
935
+ */
936
+ proto.google.api.CustomHttpPattern.prototype.serializeBinary = function() {
937
+ var writer = new jspb.BinaryWriter();
938
+ proto.google.api.CustomHttpPattern.serializeBinaryToWriter(this, writer);
939
+ return writer.getResultBuffer();
940
+ };
941
+
942
+
943
+ /**
944
+ * Serializes the given message to binary data (in protobuf wire
945
+ * format), writing to the given BinaryWriter.
946
+ * @param {!proto.google.api.CustomHttpPattern} message
947
+ * @param {!jspb.BinaryWriter} writer
948
+ * @suppress {unusedLocalVariables} f is only used for nested messages
949
+ */
950
+ proto.google.api.CustomHttpPattern.serializeBinaryToWriter = function(message, writer) {
951
+ var f = undefined;
952
+ f = message.getKind();
953
+ if (f.length > 0) {
954
+ writer.writeString(
955
+ 1,
956
+ f
957
+ );
958
+ }
959
+ f = message.getPath();
960
+ if (f.length > 0) {
961
+ writer.writeString(
962
+ 2,
963
+ f
964
+ );
965
+ }
966
+ };
967
+
968
+
969
+ /**
970
+ * optional string kind = 1;
971
+ * @return {string}
972
+ */
973
+ proto.google.api.CustomHttpPattern.prototype.getKind = function() {
974
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
975
+ };
976
+
977
+
978
+ /**
979
+ * @param {string} value
980
+ * @return {!proto.google.api.CustomHttpPattern} returns this
981
+ */
982
+ proto.google.api.CustomHttpPattern.prototype.setKind = function(value) {
983
+ return jspb.Message.setProto3StringField(this, 1, value);
984
+ };
985
+
986
+
987
+ /**
988
+ * optional string path = 2;
989
+ * @return {string}
990
+ */
991
+ proto.google.api.CustomHttpPattern.prototype.getPath = function() {
992
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
993
+ };
994
+
995
+
996
+ /**
997
+ * @param {string} value
998
+ * @return {!proto.google.api.CustomHttpPattern} returns this
999
+ */
1000
+ proto.google.api.CustomHttpPattern.prototype.setPath = function(value) {
1001
+ return jspb.Message.setProto3StringField(this, 2, value);
1002
+ };
1003
+
1004
+
1005
+ goog.object.extend(exports, proto.google.api);