clarifai-web-grpc 1.1.7 → 1.1.8

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