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