clarifai-web-grpc 1.0.2 → 1.1.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 (72) hide show
  1. package/.eslintrc.yml +12 -0
  2. package/.github/workflows/ci.yml +4 -2
  3. package/CHANGELOG.md +7 -2
  4. package/dist/{google → cjs/google}/api/annotations_pb.d.ts +0 -0
  5. package/dist/{google → cjs/google}/api/annotations_pb.js +0 -0
  6. package/dist/{google → cjs/google}/api/http_pb.d.ts +0 -0
  7. package/dist/{google → cjs/google}/api/http_pb.js +0 -0
  8. package/dist/{index.d.ts → cjs/index.d.ts} +0 -1
  9. package/dist/cjs/index.js +11 -0
  10. package/dist/{proto → cjs/proto}/clarifai/api/resources_pb.d.ts +0 -0
  11. package/dist/{proto → cjs/proto}/clarifai/api/resources_pb.js +0 -0
  12. package/dist/{proto → cjs/proto}/clarifai/api/serviceServiceClientPb.d.ts +0 -0
  13. package/dist/cjs/proto/clarifai/api/serviceServiceClientPb.js +908 -0
  14. package/dist/{proto → cjs/proto}/clarifai/api/service_pb.d.ts +0 -0
  15. package/dist/{proto → cjs/proto}/clarifai/api/service_pb.js +0 -0
  16. package/dist/{proto → cjs/proto}/clarifai/api/status/status_code_pb.d.ts +0 -0
  17. package/dist/{proto → cjs/proto}/clarifai/api/status/status_code_pb.js +0 -0
  18. package/dist/{proto → cjs/proto}/clarifai/api/status/status_pb.d.ts +0 -0
  19. package/dist/{proto → cjs/proto}/clarifai/api/status/status_pb.js +0 -0
  20. package/dist/{proto → cjs/proto}/clarifai/api/utils/extensions_pb.d.ts +0 -0
  21. package/dist/{proto → cjs/proto}/clarifai/api/utils/extensions_pb.js +0 -0
  22. package/dist/{proto → cjs/proto}/clarifai/api/utils/test_proto_pb.d.ts +0 -0
  23. package/dist/{proto → cjs/proto}/clarifai/api/utils/test_proto_pb.js +0 -0
  24. package/dist/{proto → cjs/proto}/clarifai/auth/scope/scope_pb.d.ts +0 -0
  25. package/dist/{proto → cjs/proto}/clarifai/auth/scope/scope_pb.js +0 -0
  26. package/dist/{proto → cjs/proto}/clarifai/auth/types/types_pb.d.ts +0 -0
  27. package/dist/{proto → cjs/proto}/clarifai/auth/types/types_pb.js +0 -0
  28. package/dist/{proto → cjs/proto}/clarifai/auth/util/extension_pb.d.ts +0 -0
  29. package/dist/{proto → cjs/proto}/clarifai/auth/util/extension_pb.js +0 -0
  30. package/dist/cjs/resources.d.ts +12 -0
  31. package/dist/cjs/resources.js +47 -0
  32. package/dist/{service.d.ts → cjs/service.d.ts} +0 -0
  33. package/dist/cjs/service.js +13 -0
  34. package/dist/esm/google/api/annotations_pb.d.ts +1 -0
  35. package/dist/esm/google/api/annotations_pb.js +32 -0
  36. package/dist/esm/google/api/http_pb.d.ts +1 -0
  37. package/dist/esm/google/api/http_pb.js +813 -0
  38. package/dist/esm/index.d.ts +5 -0
  39. package/dist/{index.js → esm/index.js} +1 -2
  40. package/dist/esm/proto/clarifai/api/resources_pb.d.ts +1 -0
  41. package/dist/esm/proto/clarifai/api/resources_pb.js +32957 -0
  42. package/dist/esm/proto/clarifai/api/serviceServiceClientPb.d.ts +275 -0
  43. package/dist/{proto → esm/proto}/clarifai/api/serviceServiceClientPb.js +0 -0
  44. package/dist/esm/proto/clarifai/api/service_pb.d.ts +1 -0
  45. package/dist/esm/proto/clarifai/api/service_pb.js +38791 -0
  46. package/dist/esm/proto/clarifai/api/status/status_code_pb.d.ts +1 -0
  47. package/dist/esm/proto/clarifai/api/status/status_code_pb.js +312 -0
  48. package/dist/esm/proto/clarifai/api/status/status_pb.d.ts +1 -0
  49. package/dist/esm/proto/clarifai/api/status/status_pb.js +473 -0
  50. package/dist/esm/proto/clarifai/api/utils/extensions_pb.d.ts +1 -0
  51. package/dist/esm/proto/clarifai/api/utils/extensions_pb.js +52 -0
  52. package/dist/esm/proto/clarifai/api/utils/test_proto_pb.d.ts +1 -0
  53. package/dist/esm/proto/clarifai/api/utils/test_proto_pb.js +521 -0
  54. package/dist/esm/proto/clarifai/auth/scope/scope_pb.d.ts +1 -0
  55. package/dist/esm/proto/clarifai/auth/scope/scope_pb.js +294 -0
  56. package/dist/esm/proto/clarifai/auth/types/types_pb.d.ts +1 -0
  57. package/dist/esm/proto/clarifai/auth/types/types_pb.js +26 -0
  58. package/dist/esm/proto/clarifai/auth/util/extension_pb.d.ts +1 -0
  59. package/dist/esm/proto/clarifai/auth/util/extension_pb.js +80 -0
  60. package/dist/esm/resources.d.ts +12 -0
  61. package/dist/esm/resources.js +11 -0
  62. package/dist/{service.js → esm/service.d.ts} +0 -0
  63. package/dist/esm/service.js +1 -0
  64. package/index.ts +1 -3
  65. package/package.json +16 -4
  66. package/resources.ts +14 -0
  67. package/tests/basic.test.ts +32 -5
  68. package/tests/helpers.test.ts +47 -0
  69. package/tsconfig.cjs.json +7 -0
  70. package/tsconfig.json +1 -1
  71. package/dist/resources.d.ts +0 -1
  72. package/dist/resources.js +0 -1
@@ -0,0 +1,521 @@
1
+ "use strict";
2
+ // source: proto/clarifai/api/utils/test_proto.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
+ var jspb = require('google-protobuf');
12
+ var goog = jspb;
13
+ var global = Function('return this')();
14
+ var proto_clarifai_api_utils_extensions_pb = require('../../../../proto/clarifai/api/utils/extensions_pb.js');
15
+ goog.object.extend(proto, proto_clarifai_api_utils_extensions_pb);
16
+ goog.exportSymbol('proto.clarifai.api.utils.TestProto', null, global);
17
+ goog.exportSymbol('proto.clarifai.api.utils.TestProto.OneOfFieldCase', null, global);
18
+ goog.exportSymbol('proto.clarifai.api.utils.TestProto2', null, global);
19
+ /**
20
+ * Generated by JsPbCodeGenerator.
21
+ * @param {Array=} opt_data Optional initial data array, typically from a
22
+ * server response, or constructed directly in Javascript. The array is used
23
+ * in place and becomes part of the constructed object. It is not cloned.
24
+ * If no data is provided, the constructed object will be empty, but still
25
+ * valid.
26
+ * @extends {jspb.Message}
27
+ * @constructor
28
+ */
29
+ proto.clarifai.api.utils.TestProto = function (opt_data) {
30
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.clarifai.api.utils.TestProto.oneofGroups_);
31
+ };
32
+ goog.inherits(proto.clarifai.api.utils.TestProto, jspb.Message);
33
+ if (goog.DEBUG && !COMPILED) {
34
+ /**
35
+ * @public
36
+ * @override
37
+ */
38
+ proto.clarifai.api.utils.TestProto.displayName = 'proto.clarifai.api.utils.TestProto';
39
+ }
40
+ /**
41
+ * Generated by JsPbCodeGenerator.
42
+ * @param {Array=} opt_data Optional initial data array, typically from a
43
+ * server response, or constructed directly in Javascript. The array is used
44
+ * in place and becomes part of the constructed object. It is not cloned.
45
+ * If no data is provided, the constructed object will be empty, but still
46
+ * valid.
47
+ * @extends {jspb.Message}
48
+ * @constructor
49
+ */
50
+ proto.clarifai.api.utils.TestProto2 = function (opt_data) {
51
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
52
+ };
53
+ goog.inherits(proto.clarifai.api.utils.TestProto2, jspb.Message);
54
+ if (goog.DEBUG && !COMPILED) {
55
+ /**
56
+ * @public
57
+ * @override
58
+ */
59
+ proto.clarifai.api.utils.TestProto2.displayName = 'proto.clarifai.api.utils.TestProto2';
60
+ }
61
+ /**
62
+ * Oneof group definitions for this message. Each group defines the field
63
+ * numbers belonging to that group. When of these fields' value is set, all
64
+ * other fields in the group are cleared. During deserialization, if multiple
65
+ * fields are encountered for a group, only the last value seen will be kept.
66
+ * @private {!Array<!Array<number>>}
67
+ * @const
68
+ */
69
+ proto.clarifai.api.utils.TestProto.oneofGroups_ = [[5, 6, 7]];
70
+ /**
71
+ * @enum {number}
72
+ */
73
+ proto.clarifai.api.utils.TestProto.OneOfFieldCase = {
74
+ ONE_OF_FIELD_NOT_SET: 0,
75
+ STRING_ONEOF: 5,
76
+ BOOL_ONEOF: 6,
77
+ MESSAGE_ONEOF: 7
78
+ };
79
+ /**
80
+ * @return {proto.clarifai.api.utils.TestProto.OneOfFieldCase}
81
+ */
82
+ proto.clarifai.api.utils.TestProto.prototype.getOneOfFieldCase = function () {
83
+ return /** @type {proto.clarifai.api.utils.TestProto.OneOfFieldCase} */ (jspb.Message.computeOneofCase(this, proto.clarifai.api.utils.TestProto.oneofGroups_[0]));
84
+ };
85
+ if (jspb.Message.GENERATE_TO_OBJECT) {
86
+ /**
87
+ * Creates an object representation of this proto.
88
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
89
+ * Optional fields that are not set will be set to undefined.
90
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
91
+ * For the list of reserved names please see:
92
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
93
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
94
+ * JSPB instance for transitional soy proto support:
95
+ * http://goto/soy-param-migration
96
+ * @return {!Object}
97
+ */
98
+ proto.clarifai.api.utils.TestProto.prototype.toObject = function (opt_includeInstance) {
99
+ return proto.clarifai.api.utils.TestProto.toObject(opt_includeInstance, this);
100
+ };
101
+ /**
102
+ * Static version of the {@see toObject} method.
103
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
104
+ * the JSPB instance for transitional soy proto support:
105
+ * http://goto/soy-param-migration
106
+ * @param {!proto.clarifai.api.utils.TestProto} msg The msg instance to transform.
107
+ * @return {!Object}
108
+ * @suppress {unusedLocalVariables} f is only used for nested messages
109
+ */
110
+ proto.clarifai.api.utils.TestProto.toObject = function (includeInstance, msg) {
111
+ var f, obj = {
112
+ id: jspb.Message.getFieldWithDefault(msg, 1, ""),
113
+ message: jspb.Message.getFieldWithDefault(msg, 2, ""),
114
+ value: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.0),
115
+ imageBytes: msg.getImageBytes_asB64(),
116
+ stringOneof: jspb.Message.getFieldWithDefault(msg, 5, ""),
117
+ boolOneof: jspb.Message.getBooleanFieldWithDefault(msg, 6, false),
118
+ messageOneof: (f = msg.getMessageOneof()) && proto.clarifai.api.utils.TestProto2.toObject(includeInstance, f)
119
+ };
120
+ if (includeInstance) {
121
+ obj.$jspbMessageInstance = msg;
122
+ }
123
+ return obj;
124
+ };
125
+ }
126
+ /**
127
+ * Deserializes binary data (in protobuf wire format).
128
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
129
+ * @return {!proto.clarifai.api.utils.TestProto}
130
+ */
131
+ proto.clarifai.api.utils.TestProto.deserializeBinary = function (bytes) {
132
+ var reader = new jspb.BinaryReader(bytes);
133
+ var msg = new proto.clarifai.api.utils.TestProto;
134
+ return proto.clarifai.api.utils.TestProto.deserializeBinaryFromReader(msg, reader);
135
+ };
136
+ /**
137
+ * Deserializes binary data (in protobuf wire format) from the
138
+ * given reader into the given message object.
139
+ * @param {!proto.clarifai.api.utils.TestProto} msg The message object to deserialize into.
140
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
141
+ * @return {!proto.clarifai.api.utils.TestProto}
142
+ */
143
+ proto.clarifai.api.utils.TestProto.deserializeBinaryFromReader = function (msg, reader) {
144
+ while (reader.nextField()) {
145
+ if (reader.isEndGroup()) {
146
+ break;
147
+ }
148
+ var field = reader.getFieldNumber();
149
+ switch (field) {
150
+ case 1:
151
+ var value = /** @type {string} */ (reader.readString());
152
+ msg.setId(value);
153
+ break;
154
+ case 2:
155
+ var value = /** @type {string} */ (reader.readString());
156
+ msg.setMessage(value);
157
+ break;
158
+ case 3:
159
+ var value = /** @type {number} */ (reader.readDouble());
160
+ msg.setValue(value);
161
+ break;
162
+ case 4:
163
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
164
+ msg.setImageBytes(value);
165
+ break;
166
+ case 5:
167
+ var value = /** @type {string} */ (reader.readString());
168
+ msg.setStringOneof(value);
169
+ break;
170
+ case 6:
171
+ var value = /** @type {boolean} */ (reader.readBool());
172
+ msg.setBoolOneof(value);
173
+ break;
174
+ case 7:
175
+ var value = new proto.clarifai.api.utils.TestProto2;
176
+ reader.readMessage(value, proto.clarifai.api.utils.TestProto2.deserializeBinaryFromReader);
177
+ msg.setMessageOneof(value);
178
+ break;
179
+ default:
180
+ reader.skipField();
181
+ break;
182
+ }
183
+ }
184
+ return msg;
185
+ };
186
+ /**
187
+ * Serializes the message to binary data (in protobuf wire format).
188
+ * @return {!Uint8Array}
189
+ */
190
+ proto.clarifai.api.utils.TestProto.prototype.serializeBinary = function () {
191
+ var writer = new jspb.BinaryWriter();
192
+ proto.clarifai.api.utils.TestProto.serializeBinaryToWriter(this, writer);
193
+ return writer.getResultBuffer();
194
+ };
195
+ /**
196
+ * Serializes the given message to binary data (in protobuf wire
197
+ * format), writing to the given BinaryWriter.
198
+ * @param {!proto.clarifai.api.utils.TestProto} message
199
+ * @param {!jspb.BinaryWriter} writer
200
+ * @suppress {unusedLocalVariables} f is only used for nested messages
201
+ */
202
+ proto.clarifai.api.utils.TestProto.serializeBinaryToWriter = function (message, writer) {
203
+ var f = undefined;
204
+ f = message.getId();
205
+ if (f.length > 0) {
206
+ writer.writeString(1, f);
207
+ }
208
+ f = message.getMessage();
209
+ if (f.length > 0) {
210
+ writer.writeString(2, f);
211
+ }
212
+ f = message.getValue();
213
+ if (f !== 0.0) {
214
+ writer.writeDouble(3, f);
215
+ }
216
+ f = message.getImageBytes_asU8();
217
+ if (f.length > 0) {
218
+ writer.writeBytes(4, f);
219
+ }
220
+ f = /** @type {string} */ (jspb.Message.getField(message, 5));
221
+ if (f != null) {
222
+ writer.writeString(5, f);
223
+ }
224
+ f = /** @type {boolean} */ (jspb.Message.getField(message, 6));
225
+ if (f != null) {
226
+ writer.writeBool(6, f);
227
+ }
228
+ f = message.getMessageOneof();
229
+ if (f != null) {
230
+ writer.writeMessage(7, f, proto.clarifai.api.utils.TestProto2.serializeBinaryToWriter);
231
+ }
232
+ };
233
+ /**
234
+ * optional string id = 1;
235
+ * @return {string}
236
+ */
237
+ proto.clarifai.api.utils.TestProto.prototype.getId = function () {
238
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
239
+ };
240
+ /**
241
+ * @param {string} value
242
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
243
+ */
244
+ proto.clarifai.api.utils.TestProto.prototype.setId = function (value) {
245
+ return jspb.Message.setProto3StringField(this, 1, value);
246
+ };
247
+ /**
248
+ * optional string message = 2;
249
+ * @return {string}
250
+ */
251
+ proto.clarifai.api.utils.TestProto.prototype.getMessage = function () {
252
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
253
+ };
254
+ /**
255
+ * @param {string} value
256
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
257
+ */
258
+ proto.clarifai.api.utils.TestProto.prototype.setMessage = function (value) {
259
+ return jspb.Message.setProto3StringField(this, 2, value);
260
+ };
261
+ /**
262
+ * optional double value = 3;
263
+ * @return {number}
264
+ */
265
+ proto.clarifai.api.utils.TestProto.prototype.getValue = function () {
266
+ return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
267
+ };
268
+ /**
269
+ * @param {number} value
270
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
271
+ */
272
+ proto.clarifai.api.utils.TestProto.prototype.setValue = function (value) {
273
+ return jspb.Message.setProto3FloatField(this, 3, value);
274
+ };
275
+ /**
276
+ * optional bytes image_bytes = 4;
277
+ * @return {string}
278
+ */
279
+ proto.clarifai.api.utils.TestProto.prototype.getImageBytes = function () {
280
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
281
+ };
282
+ /**
283
+ * optional bytes image_bytes = 4;
284
+ * This is a type-conversion wrapper around `getImageBytes()`
285
+ * @return {string}
286
+ */
287
+ proto.clarifai.api.utils.TestProto.prototype.getImageBytes_asB64 = function () {
288
+ return /** @type {string} */ (jspb.Message.bytesAsB64(this.getImageBytes()));
289
+ };
290
+ /**
291
+ * optional bytes image_bytes = 4;
292
+ * Note that Uint8Array is not supported on all browsers.
293
+ * @see http://caniuse.com/Uint8Array
294
+ * This is a type-conversion wrapper around `getImageBytes()`
295
+ * @return {!Uint8Array}
296
+ */
297
+ proto.clarifai.api.utils.TestProto.prototype.getImageBytes_asU8 = function () {
298
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getImageBytes()));
299
+ };
300
+ /**
301
+ * @param {!(string|Uint8Array)} value
302
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
303
+ */
304
+ proto.clarifai.api.utils.TestProto.prototype.setImageBytes = function (value) {
305
+ return jspb.Message.setProto3BytesField(this, 4, value);
306
+ };
307
+ /**
308
+ * optional string string_oneof = 5;
309
+ * @return {string}
310
+ */
311
+ proto.clarifai.api.utils.TestProto.prototype.getStringOneof = function () {
312
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
313
+ };
314
+ /**
315
+ * @param {string} value
316
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
317
+ */
318
+ proto.clarifai.api.utils.TestProto.prototype.setStringOneof = function (value) {
319
+ return jspb.Message.setOneofField(this, 5, proto.clarifai.api.utils.TestProto.oneofGroups_[0], value);
320
+ };
321
+ /**
322
+ * Clears the field making it undefined.
323
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
324
+ */
325
+ proto.clarifai.api.utils.TestProto.prototype.clearStringOneof = function () {
326
+ return jspb.Message.setOneofField(this, 5, proto.clarifai.api.utils.TestProto.oneofGroups_[0], undefined);
327
+ };
328
+ /**
329
+ * Returns whether this field is set.
330
+ * @return {boolean}
331
+ */
332
+ proto.clarifai.api.utils.TestProto.prototype.hasStringOneof = function () {
333
+ return jspb.Message.getField(this, 5) != null;
334
+ };
335
+ /**
336
+ * optional bool bool_oneof = 6;
337
+ * @return {boolean}
338
+ */
339
+ proto.clarifai.api.utils.TestProto.prototype.getBoolOneof = function () {
340
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false));
341
+ };
342
+ /**
343
+ * @param {boolean} value
344
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
345
+ */
346
+ proto.clarifai.api.utils.TestProto.prototype.setBoolOneof = function (value) {
347
+ return jspb.Message.setOneofField(this, 6, proto.clarifai.api.utils.TestProto.oneofGroups_[0], value);
348
+ };
349
+ /**
350
+ * Clears the field making it undefined.
351
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
352
+ */
353
+ proto.clarifai.api.utils.TestProto.prototype.clearBoolOneof = function () {
354
+ return jspb.Message.setOneofField(this, 6, proto.clarifai.api.utils.TestProto.oneofGroups_[0], undefined);
355
+ };
356
+ /**
357
+ * Returns whether this field is set.
358
+ * @return {boolean}
359
+ */
360
+ proto.clarifai.api.utils.TestProto.prototype.hasBoolOneof = function () {
361
+ return jspb.Message.getField(this, 6) != null;
362
+ };
363
+ /**
364
+ * optional TestProto2 message_oneof = 7;
365
+ * @return {?proto.clarifai.api.utils.TestProto2}
366
+ */
367
+ proto.clarifai.api.utils.TestProto.prototype.getMessageOneof = function () {
368
+ return /** @type{?proto.clarifai.api.utils.TestProto2} */ (jspb.Message.getWrapperField(this, proto.clarifai.api.utils.TestProto2, 7));
369
+ };
370
+ /**
371
+ * @param {?proto.clarifai.api.utils.TestProto2|undefined} value
372
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
373
+ */
374
+ proto.clarifai.api.utils.TestProto.prototype.setMessageOneof = function (value) {
375
+ return jspb.Message.setOneofWrapperField(this, 7, proto.clarifai.api.utils.TestProto.oneofGroups_[0], value);
376
+ };
377
+ /**
378
+ * Clears the message field making it undefined.
379
+ * @return {!proto.clarifai.api.utils.TestProto} returns this
380
+ */
381
+ proto.clarifai.api.utils.TestProto.prototype.clearMessageOneof = function () {
382
+ return this.setMessageOneof(undefined);
383
+ };
384
+ /**
385
+ * Returns whether this field is set.
386
+ * @return {boolean}
387
+ */
388
+ proto.clarifai.api.utils.TestProto.prototype.hasMessageOneof = function () {
389
+ return jspb.Message.getField(this, 7) != null;
390
+ };
391
+ if (jspb.Message.GENERATE_TO_OBJECT) {
392
+ /**
393
+ * Creates an object representation of this proto.
394
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
395
+ * Optional fields that are not set will be set to undefined.
396
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
397
+ * For the list of reserved names please see:
398
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
399
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
400
+ * JSPB instance for transitional soy proto support:
401
+ * http://goto/soy-param-migration
402
+ * @return {!Object}
403
+ */
404
+ proto.clarifai.api.utils.TestProto2.prototype.toObject = function (opt_includeInstance) {
405
+ return proto.clarifai.api.utils.TestProto2.toObject(opt_includeInstance, this);
406
+ };
407
+ /**
408
+ * Static version of the {@see toObject} method.
409
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
410
+ * the JSPB instance for transitional soy proto support:
411
+ * http://goto/soy-param-migration
412
+ * @param {!proto.clarifai.api.utils.TestProto2} msg The msg instance to transform.
413
+ * @return {!Object}
414
+ * @suppress {unusedLocalVariables} f is only used for nested messages
415
+ */
416
+ proto.clarifai.api.utils.TestProto2.toObject = function (includeInstance, msg) {
417
+ var f, obj = {
418
+ id: jspb.Message.getFieldWithDefault(msg, 1, ""),
419
+ flip: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
420
+ };
421
+ if (includeInstance) {
422
+ obj.$jspbMessageInstance = msg;
423
+ }
424
+ return obj;
425
+ };
426
+ }
427
+ /**
428
+ * Deserializes binary data (in protobuf wire format).
429
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
430
+ * @return {!proto.clarifai.api.utils.TestProto2}
431
+ */
432
+ proto.clarifai.api.utils.TestProto2.deserializeBinary = function (bytes) {
433
+ var reader = new jspb.BinaryReader(bytes);
434
+ var msg = new proto.clarifai.api.utils.TestProto2;
435
+ return proto.clarifai.api.utils.TestProto2.deserializeBinaryFromReader(msg, reader);
436
+ };
437
+ /**
438
+ * Deserializes binary data (in protobuf wire format) from the
439
+ * given reader into the given message object.
440
+ * @param {!proto.clarifai.api.utils.TestProto2} msg The message object to deserialize into.
441
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
442
+ * @return {!proto.clarifai.api.utils.TestProto2}
443
+ */
444
+ proto.clarifai.api.utils.TestProto2.deserializeBinaryFromReader = function (msg, reader) {
445
+ while (reader.nextField()) {
446
+ if (reader.isEndGroup()) {
447
+ break;
448
+ }
449
+ var field = reader.getFieldNumber();
450
+ switch (field) {
451
+ case 1:
452
+ var value = /** @type {string} */ (reader.readString());
453
+ msg.setId(value);
454
+ break;
455
+ case 2:
456
+ var value = /** @type {boolean} */ (reader.readBool());
457
+ msg.setFlip(value);
458
+ break;
459
+ default:
460
+ reader.skipField();
461
+ break;
462
+ }
463
+ }
464
+ return msg;
465
+ };
466
+ /**
467
+ * Serializes the message to binary data (in protobuf wire format).
468
+ * @return {!Uint8Array}
469
+ */
470
+ proto.clarifai.api.utils.TestProto2.prototype.serializeBinary = function () {
471
+ var writer = new jspb.BinaryWriter();
472
+ proto.clarifai.api.utils.TestProto2.serializeBinaryToWriter(this, writer);
473
+ return writer.getResultBuffer();
474
+ };
475
+ /**
476
+ * Serializes the given message to binary data (in protobuf wire
477
+ * format), writing to the given BinaryWriter.
478
+ * @param {!proto.clarifai.api.utils.TestProto2} message
479
+ * @param {!jspb.BinaryWriter} writer
480
+ * @suppress {unusedLocalVariables} f is only used for nested messages
481
+ */
482
+ proto.clarifai.api.utils.TestProto2.serializeBinaryToWriter = function (message, writer) {
483
+ var f = undefined;
484
+ f = message.getId();
485
+ if (f.length > 0) {
486
+ writer.writeString(1, f);
487
+ }
488
+ f = message.getFlip();
489
+ if (f) {
490
+ writer.writeBool(2, f);
491
+ }
492
+ };
493
+ /**
494
+ * optional string id = 1;
495
+ * @return {string}
496
+ */
497
+ proto.clarifai.api.utils.TestProto2.prototype.getId = function () {
498
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
499
+ };
500
+ /**
501
+ * @param {string} value
502
+ * @return {!proto.clarifai.api.utils.TestProto2} returns this
503
+ */
504
+ proto.clarifai.api.utils.TestProto2.prototype.setId = function (value) {
505
+ return jspb.Message.setProto3StringField(this, 1, value);
506
+ };
507
+ /**
508
+ * optional bool flip = 2;
509
+ * @return {boolean}
510
+ */
511
+ proto.clarifai.api.utils.TestProto2.prototype.getFlip = function () {
512
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
513
+ };
514
+ /**
515
+ * @param {boolean} value
516
+ * @return {!proto.clarifai.api.utils.TestProto2} returns this
517
+ */
518
+ proto.clarifai.api.utils.TestProto2.prototype.setFlip = function (value) {
519
+ return jspb.Message.setProto3BooleanField(this, 2, value);
520
+ };
521
+ goog.object.extend(exports, proto.clarifai.api.utils);
@@ -0,0 +1 @@
1
+ export {};