protobuf-platform 1.0.22 → 1.0.23
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.
- package/game/game.proto +12 -1
- package/game/game_grpc_pb.js +1 -1
- package/game/game_pb.js +489 -2
- package/package.json +1 -1
package/game/game.proto
CHANGED
@@ -7,7 +7,7 @@ service Game {
|
|
7
7
|
//Categories
|
8
8
|
rpc createSingleCategory(CategoryRequest) returns (CategoryResponse);
|
9
9
|
rpc readSingleCategory(GetCategoryRequest) returns (CategoryResponse);
|
10
|
-
rpc updateSingleCategory(CategoryRequest) returns (CategoryResponse);
|
10
|
+
rpc updateSingleCategory(stream CategoryRequest) returns (CategoryResponse);
|
11
11
|
rpc deleteSingleCategory(GetCategoryRequest) returns (CategoryStatusResponse);
|
12
12
|
rpc readListCategories(GetListCategoryRequest) returns (CategoryListResponse);
|
13
13
|
}
|
@@ -31,6 +31,10 @@ message CategoryRequest {
|
|
31
31
|
optional string slug = 3;
|
32
32
|
optional string description = 4;
|
33
33
|
optional int32 is_active = 5;
|
34
|
+
oneof request {
|
35
|
+
MetaDataFile metadata = 6;
|
36
|
+
File file = 7;
|
37
|
+
}
|
34
38
|
}
|
35
39
|
message GetCategoryRequest {
|
36
40
|
int32 id = 1;
|
@@ -50,4 +54,11 @@ message CategoryListResponse {
|
|
50
54
|
}
|
51
55
|
message CategoryStatusResponse {
|
52
56
|
string status = 1;
|
57
|
+
}
|
58
|
+
message MetaDataFile {
|
59
|
+
string name = 1;
|
60
|
+
string type = 2;
|
61
|
+
}
|
62
|
+
message File {
|
63
|
+
bytes content = 1;
|
53
64
|
}
|
package/game/game_grpc_pb.js
CHANGED
@@ -130,7 +130,7 @@ createSingleCategory: {
|
|
130
130
|
},
|
131
131
|
updateSingleCategory: {
|
132
132
|
path: '/game.Game/updateSingleCategory',
|
133
|
-
requestStream:
|
133
|
+
requestStream: true,
|
134
134
|
responseStream: false,
|
135
135
|
requestType: game_pb.CategoryRequest,
|
136
136
|
responseType: game_pb.CategoryResponse,
|
package/game/game_pb.js
CHANGED
@@ -24,10 +24,13 @@ var global = (function() {
|
|
24
24
|
goog.exportSymbol('proto.game.CategoryItem', null, global);
|
25
25
|
goog.exportSymbol('proto.game.CategoryListResponse', null, global);
|
26
26
|
goog.exportSymbol('proto.game.CategoryRequest', null, global);
|
27
|
+
goog.exportSymbol('proto.game.CategoryRequest.RequestCase', null, global);
|
27
28
|
goog.exportSymbol('proto.game.CategoryResponse', null, global);
|
28
29
|
goog.exportSymbol('proto.game.CategoryStatusResponse', null, global);
|
30
|
+
goog.exportSymbol('proto.game.File', null, global);
|
29
31
|
goog.exportSymbol('proto.game.GetCategoryRequest', null, global);
|
30
32
|
goog.exportSymbol('proto.game.GetListCategoryRequest', null, global);
|
33
|
+
goog.exportSymbol('proto.game.MetaDataFile', null, global);
|
31
34
|
goog.exportSymbol('proto.game.PingRequest', null, global);
|
32
35
|
goog.exportSymbol('proto.game.PongResponse', null, global);
|
33
36
|
/**
|
@@ -104,7 +107,7 @@ if (goog.DEBUG && !COMPILED) {
|
|
104
107
|
* @constructor
|
105
108
|
*/
|
106
109
|
proto.game.CategoryRequest = function(opt_data) {
|
107
|
-
jspb.Message.initialize(this, opt_data, 0, -1, null,
|
110
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.game.CategoryRequest.oneofGroups_);
|
108
111
|
};
|
109
112
|
goog.inherits(proto.game.CategoryRequest, jspb.Message);
|
110
113
|
if (goog.DEBUG && !COMPILED) {
|
@@ -219,6 +222,48 @@ if (goog.DEBUG && !COMPILED) {
|
|
219
222
|
*/
|
220
223
|
proto.game.CategoryStatusResponse.displayName = 'proto.game.CategoryStatusResponse';
|
221
224
|
}
|
225
|
+
/**
|
226
|
+
* Generated by JsPbCodeGenerator.
|
227
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
228
|
+
* server response, or constructed directly in Javascript. The array is used
|
229
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
230
|
+
* If no data is provided, the constructed object will be empty, but still
|
231
|
+
* valid.
|
232
|
+
* @extends {jspb.Message}
|
233
|
+
* @constructor
|
234
|
+
*/
|
235
|
+
proto.game.MetaDataFile = function(opt_data) {
|
236
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
237
|
+
};
|
238
|
+
goog.inherits(proto.game.MetaDataFile, jspb.Message);
|
239
|
+
if (goog.DEBUG && !COMPILED) {
|
240
|
+
/**
|
241
|
+
* @public
|
242
|
+
* @override
|
243
|
+
*/
|
244
|
+
proto.game.MetaDataFile.displayName = 'proto.game.MetaDataFile';
|
245
|
+
}
|
246
|
+
/**
|
247
|
+
* Generated by JsPbCodeGenerator.
|
248
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
249
|
+
* server response, or constructed directly in Javascript. The array is used
|
250
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
251
|
+
* If no data is provided, the constructed object will be empty, but still
|
252
|
+
* valid.
|
253
|
+
* @extends {jspb.Message}
|
254
|
+
* @constructor
|
255
|
+
*/
|
256
|
+
proto.game.File = function(opt_data) {
|
257
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
258
|
+
};
|
259
|
+
goog.inherits(proto.game.File, jspb.Message);
|
260
|
+
if (goog.DEBUG && !COMPILED) {
|
261
|
+
/**
|
262
|
+
* @public
|
263
|
+
* @override
|
264
|
+
*/
|
265
|
+
proto.game.File.displayName = 'proto.game.File';
|
266
|
+
}
|
222
267
|
|
223
268
|
|
224
269
|
|
@@ -868,6 +913,32 @@ proto.game.CategoryItem.prototype.hasImagePath = function() {
|
|
868
913
|
|
869
914
|
|
870
915
|
|
916
|
+
/**
|
917
|
+
* Oneof group definitions for this message. Each group defines the field
|
918
|
+
* numbers belonging to that group. When of these fields' value is set, all
|
919
|
+
* other fields in the group are cleared. During deserialization, if multiple
|
920
|
+
* fields are encountered for a group, only the last value seen will be kept.
|
921
|
+
* @private {!Array<!Array<number>>}
|
922
|
+
* @const
|
923
|
+
*/
|
924
|
+
proto.game.CategoryRequest.oneofGroups_ = [[6,7]];
|
925
|
+
|
926
|
+
/**
|
927
|
+
* @enum {number}
|
928
|
+
*/
|
929
|
+
proto.game.CategoryRequest.RequestCase = {
|
930
|
+
REQUEST_NOT_SET: 0,
|
931
|
+
METADATA: 6,
|
932
|
+
FILE: 7
|
933
|
+
};
|
934
|
+
|
935
|
+
/**
|
936
|
+
* @return {proto.game.CategoryRequest.RequestCase}
|
937
|
+
*/
|
938
|
+
proto.game.CategoryRequest.prototype.getRequestCase = function() {
|
939
|
+
return /** @type {proto.game.CategoryRequest.RequestCase} */(jspb.Message.computeOneofCase(this, proto.game.CategoryRequest.oneofGroups_[0]));
|
940
|
+
};
|
941
|
+
|
871
942
|
|
872
943
|
|
873
944
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
@@ -903,7 +974,9 @@ proto.game.CategoryRequest.toObject = function(includeInstance, msg) {
|
|
903
974
|
title: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
904
975
|
slug: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
905
976
|
description: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
906
|
-
isActive: jspb.Message.getFieldWithDefault(msg, 5, 0)
|
977
|
+
isActive: jspb.Message.getFieldWithDefault(msg, 5, 0),
|
978
|
+
metadata: (f = msg.getMetadata()) && proto.game.MetaDataFile.toObject(includeInstance, f),
|
979
|
+
file: (f = msg.getFile()) && proto.game.File.toObject(includeInstance, f)
|
907
980
|
};
|
908
981
|
|
909
982
|
if (includeInstance) {
|
@@ -960,6 +1033,16 @@ proto.game.CategoryRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
960
1033
|
var value = /** @type {number} */ (reader.readInt32());
|
961
1034
|
msg.setIsActive(value);
|
962
1035
|
break;
|
1036
|
+
case 6:
|
1037
|
+
var value = new proto.game.MetaDataFile;
|
1038
|
+
reader.readMessage(value,proto.game.MetaDataFile.deserializeBinaryFromReader);
|
1039
|
+
msg.setMetadata(value);
|
1040
|
+
break;
|
1041
|
+
case 7:
|
1042
|
+
var value = new proto.game.File;
|
1043
|
+
reader.readMessage(value,proto.game.File.deserializeBinaryFromReader);
|
1044
|
+
msg.setFile(value);
|
1045
|
+
break;
|
963
1046
|
default:
|
964
1047
|
reader.skipField();
|
965
1048
|
break;
|
@@ -1024,6 +1107,22 @@ proto.game.CategoryRequest.serializeBinaryToWriter = function(message, writer) {
|
|
1024
1107
|
f
|
1025
1108
|
);
|
1026
1109
|
}
|
1110
|
+
f = message.getMetadata();
|
1111
|
+
if (f != null) {
|
1112
|
+
writer.writeMessage(
|
1113
|
+
6,
|
1114
|
+
f,
|
1115
|
+
proto.game.MetaDataFile.serializeBinaryToWriter
|
1116
|
+
);
|
1117
|
+
}
|
1118
|
+
f = message.getFile();
|
1119
|
+
if (f != null) {
|
1120
|
+
writer.writeMessage(
|
1121
|
+
7,
|
1122
|
+
f,
|
1123
|
+
proto.game.File.serializeBinaryToWriter
|
1124
|
+
);
|
1125
|
+
}
|
1027
1126
|
};
|
1028
1127
|
|
1029
1128
|
|
@@ -1207,6 +1306,80 @@ proto.game.CategoryRequest.prototype.hasIsActive = function() {
|
|
1207
1306
|
};
|
1208
1307
|
|
1209
1308
|
|
1309
|
+
/**
|
1310
|
+
* optional MetaDataFile metadata = 6;
|
1311
|
+
* @return {?proto.game.MetaDataFile}
|
1312
|
+
*/
|
1313
|
+
proto.game.CategoryRequest.prototype.getMetadata = function() {
|
1314
|
+
return /** @type{?proto.game.MetaDataFile} */ (
|
1315
|
+
jspb.Message.getWrapperField(this, proto.game.MetaDataFile, 6));
|
1316
|
+
};
|
1317
|
+
|
1318
|
+
|
1319
|
+
/**
|
1320
|
+
* @param {?proto.game.MetaDataFile|undefined} value
|
1321
|
+
* @return {!proto.game.CategoryRequest} returns this
|
1322
|
+
*/
|
1323
|
+
proto.game.CategoryRequest.prototype.setMetadata = function(value) {
|
1324
|
+
return jspb.Message.setOneofWrapperField(this, 6, proto.game.CategoryRequest.oneofGroups_[0], value);
|
1325
|
+
};
|
1326
|
+
|
1327
|
+
|
1328
|
+
/**
|
1329
|
+
* Clears the message field making it undefined.
|
1330
|
+
* @return {!proto.game.CategoryRequest} returns this
|
1331
|
+
*/
|
1332
|
+
proto.game.CategoryRequest.prototype.clearMetadata = function() {
|
1333
|
+
return this.setMetadata(undefined);
|
1334
|
+
};
|
1335
|
+
|
1336
|
+
|
1337
|
+
/**
|
1338
|
+
* Returns whether this field is set.
|
1339
|
+
* @return {boolean}
|
1340
|
+
*/
|
1341
|
+
proto.game.CategoryRequest.prototype.hasMetadata = function() {
|
1342
|
+
return jspb.Message.getField(this, 6) != null;
|
1343
|
+
};
|
1344
|
+
|
1345
|
+
|
1346
|
+
/**
|
1347
|
+
* optional File file = 7;
|
1348
|
+
* @return {?proto.game.File}
|
1349
|
+
*/
|
1350
|
+
proto.game.CategoryRequest.prototype.getFile = function() {
|
1351
|
+
return /** @type{?proto.game.File} */ (
|
1352
|
+
jspb.Message.getWrapperField(this, proto.game.File, 7));
|
1353
|
+
};
|
1354
|
+
|
1355
|
+
|
1356
|
+
/**
|
1357
|
+
* @param {?proto.game.File|undefined} value
|
1358
|
+
* @return {!proto.game.CategoryRequest} returns this
|
1359
|
+
*/
|
1360
|
+
proto.game.CategoryRequest.prototype.setFile = function(value) {
|
1361
|
+
return jspb.Message.setOneofWrapperField(this, 7, proto.game.CategoryRequest.oneofGroups_[0], value);
|
1362
|
+
};
|
1363
|
+
|
1364
|
+
|
1365
|
+
/**
|
1366
|
+
* Clears the message field making it undefined.
|
1367
|
+
* @return {!proto.game.CategoryRequest} returns this
|
1368
|
+
*/
|
1369
|
+
proto.game.CategoryRequest.prototype.clearFile = function() {
|
1370
|
+
return this.setFile(undefined);
|
1371
|
+
};
|
1372
|
+
|
1373
|
+
|
1374
|
+
/**
|
1375
|
+
* Returns whether this field is set.
|
1376
|
+
* @return {boolean}
|
1377
|
+
*/
|
1378
|
+
proto.game.CategoryRequest.prototype.hasFile = function() {
|
1379
|
+
return jspb.Message.getField(this, 7) != null;
|
1380
|
+
};
|
1381
|
+
|
1382
|
+
|
1210
1383
|
|
1211
1384
|
|
1212
1385
|
|
@@ -2034,4 +2207,318 @@ proto.game.CategoryStatusResponse.prototype.setStatus = function(value) {
|
|
2034
2207
|
};
|
2035
2208
|
|
2036
2209
|
|
2210
|
+
|
2211
|
+
|
2212
|
+
|
2213
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
2214
|
+
/**
|
2215
|
+
* Creates an object representation of this proto.
|
2216
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2217
|
+
* Optional fields that are not set will be set to undefined.
|
2218
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
2219
|
+
* For the list of reserved names please see:
|
2220
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
2221
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
2222
|
+
* JSPB instance for transitional soy proto support:
|
2223
|
+
* http://goto/soy-param-migration
|
2224
|
+
* @return {!Object}
|
2225
|
+
*/
|
2226
|
+
proto.game.MetaDataFile.prototype.toObject = function(opt_includeInstance) {
|
2227
|
+
return proto.game.MetaDataFile.toObject(opt_includeInstance, this);
|
2228
|
+
};
|
2229
|
+
|
2230
|
+
|
2231
|
+
/**
|
2232
|
+
* Static version of the {@see toObject} method.
|
2233
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
2234
|
+
* the JSPB instance for transitional soy proto support:
|
2235
|
+
* http://goto/soy-param-migration
|
2236
|
+
* @param {!proto.game.MetaDataFile} msg The msg instance to transform.
|
2237
|
+
* @return {!Object}
|
2238
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2239
|
+
*/
|
2240
|
+
proto.game.MetaDataFile.toObject = function(includeInstance, msg) {
|
2241
|
+
var f, obj = {
|
2242
|
+
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
2243
|
+
type: jspb.Message.getFieldWithDefault(msg, 2, "")
|
2244
|
+
};
|
2245
|
+
|
2246
|
+
if (includeInstance) {
|
2247
|
+
obj.$jspbMessageInstance = msg;
|
2248
|
+
}
|
2249
|
+
return obj;
|
2250
|
+
};
|
2251
|
+
}
|
2252
|
+
|
2253
|
+
|
2254
|
+
/**
|
2255
|
+
* Deserializes binary data (in protobuf wire format).
|
2256
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
2257
|
+
* @return {!proto.game.MetaDataFile}
|
2258
|
+
*/
|
2259
|
+
proto.game.MetaDataFile.deserializeBinary = function(bytes) {
|
2260
|
+
var reader = new jspb.BinaryReader(bytes);
|
2261
|
+
var msg = new proto.game.MetaDataFile;
|
2262
|
+
return proto.game.MetaDataFile.deserializeBinaryFromReader(msg, reader);
|
2263
|
+
};
|
2264
|
+
|
2265
|
+
|
2266
|
+
/**
|
2267
|
+
* Deserializes binary data (in protobuf wire format) from the
|
2268
|
+
* given reader into the given message object.
|
2269
|
+
* @param {!proto.game.MetaDataFile} msg The message object to deserialize into.
|
2270
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
2271
|
+
* @return {!proto.game.MetaDataFile}
|
2272
|
+
*/
|
2273
|
+
proto.game.MetaDataFile.deserializeBinaryFromReader = function(msg, reader) {
|
2274
|
+
while (reader.nextField()) {
|
2275
|
+
if (reader.isEndGroup()) {
|
2276
|
+
break;
|
2277
|
+
}
|
2278
|
+
var field = reader.getFieldNumber();
|
2279
|
+
switch (field) {
|
2280
|
+
case 1:
|
2281
|
+
var value = /** @type {string} */ (reader.readString());
|
2282
|
+
msg.setName(value);
|
2283
|
+
break;
|
2284
|
+
case 2:
|
2285
|
+
var value = /** @type {string} */ (reader.readString());
|
2286
|
+
msg.setType(value);
|
2287
|
+
break;
|
2288
|
+
default:
|
2289
|
+
reader.skipField();
|
2290
|
+
break;
|
2291
|
+
}
|
2292
|
+
}
|
2293
|
+
return msg;
|
2294
|
+
};
|
2295
|
+
|
2296
|
+
|
2297
|
+
/**
|
2298
|
+
* Serializes the message to binary data (in protobuf wire format).
|
2299
|
+
* @return {!Uint8Array}
|
2300
|
+
*/
|
2301
|
+
proto.game.MetaDataFile.prototype.serializeBinary = function() {
|
2302
|
+
var writer = new jspb.BinaryWriter();
|
2303
|
+
proto.game.MetaDataFile.serializeBinaryToWriter(this, writer);
|
2304
|
+
return writer.getResultBuffer();
|
2305
|
+
};
|
2306
|
+
|
2307
|
+
|
2308
|
+
/**
|
2309
|
+
* Serializes the given message to binary data (in protobuf wire
|
2310
|
+
* format), writing to the given BinaryWriter.
|
2311
|
+
* @param {!proto.game.MetaDataFile} message
|
2312
|
+
* @param {!jspb.BinaryWriter} writer
|
2313
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2314
|
+
*/
|
2315
|
+
proto.game.MetaDataFile.serializeBinaryToWriter = function(message, writer) {
|
2316
|
+
var f = undefined;
|
2317
|
+
f = message.getName();
|
2318
|
+
if (f.length > 0) {
|
2319
|
+
writer.writeString(
|
2320
|
+
1,
|
2321
|
+
f
|
2322
|
+
);
|
2323
|
+
}
|
2324
|
+
f = message.getType();
|
2325
|
+
if (f.length > 0) {
|
2326
|
+
writer.writeString(
|
2327
|
+
2,
|
2328
|
+
f
|
2329
|
+
);
|
2330
|
+
}
|
2331
|
+
};
|
2332
|
+
|
2333
|
+
|
2334
|
+
/**
|
2335
|
+
* optional string name = 1;
|
2336
|
+
* @return {string}
|
2337
|
+
*/
|
2338
|
+
proto.game.MetaDataFile.prototype.getName = function() {
|
2339
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
2340
|
+
};
|
2341
|
+
|
2342
|
+
|
2343
|
+
/**
|
2344
|
+
* @param {string} value
|
2345
|
+
* @return {!proto.game.MetaDataFile} returns this
|
2346
|
+
*/
|
2347
|
+
proto.game.MetaDataFile.prototype.setName = function(value) {
|
2348
|
+
return jspb.Message.setProto3StringField(this, 1, value);
|
2349
|
+
};
|
2350
|
+
|
2351
|
+
|
2352
|
+
/**
|
2353
|
+
* optional string type = 2;
|
2354
|
+
* @return {string}
|
2355
|
+
*/
|
2356
|
+
proto.game.MetaDataFile.prototype.getType = function() {
|
2357
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
2358
|
+
};
|
2359
|
+
|
2360
|
+
|
2361
|
+
/**
|
2362
|
+
* @param {string} value
|
2363
|
+
* @return {!proto.game.MetaDataFile} returns this
|
2364
|
+
*/
|
2365
|
+
proto.game.MetaDataFile.prototype.setType = function(value) {
|
2366
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
2367
|
+
};
|
2368
|
+
|
2369
|
+
|
2370
|
+
|
2371
|
+
|
2372
|
+
|
2373
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
2374
|
+
/**
|
2375
|
+
* Creates an object representation of this proto.
|
2376
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
2377
|
+
* Optional fields that are not set will be set to undefined.
|
2378
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
2379
|
+
* For the list of reserved names please see:
|
2380
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
2381
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
2382
|
+
* JSPB instance for transitional soy proto support:
|
2383
|
+
* http://goto/soy-param-migration
|
2384
|
+
* @return {!Object}
|
2385
|
+
*/
|
2386
|
+
proto.game.File.prototype.toObject = function(opt_includeInstance) {
|
2387
|
+
return proto.game.File.toObject(opt_includeInstance, this);
|
2388
|
+
};
|
2389
|
+
|
2390
|
+
|
2391
|
+
/**
|
2392
|
+
* Static version of the {@see toObject} method.
|
2393
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
2394
|
+
* the JSPB instance for transitional soy proto support:
|
2395
|
+
* http://goto/soy-param-migration
|
2396
|
+
* @param {!proto.game.File} msg The msg instance to transform.
|
2397
|
+
* @return {!Object}
|
2398
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2399
|
+
*/
|
2400
|
+
proto.game.File.toObject = function(includeInstance, msg) {
|
2401
|
+
var f, obj = {
|
2402
|
+
content: msg.getContent_asB64()
|
2403
|
+
};
|
2404
|
+
|
2405
|
+
if (includeInstance) {
|
2406
|
+
obj.$jspbMessageInstance = msg;
|
2407
|
+
}
|
2408
|
+
return obj;
|
2409
|
+
};
|
2410
|
+
}
|
2411
|
+
|
2412
|
+
|
2413
|
+
/**
|
2414
|
+
* Deserializes binary data (in protobuf wire format).
|
2415
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
2416
|
+
* @return {!proto.game.File}
|
2417
|
+
*/
|
2418
|
+
proto.game.File.deserializeBinary = function(bytes) {
|
2419
|
+
var reader = new jspb.BinaryReader(bytes);
|
2420
|
+
var msg = new proto.game.File;
|
2421
|
+
return proto.game.File.deserializeBinaryFromReader(msg, reader);
|
2422
|
+
};
|
2423
|
+
|
2424
|
+
|
2425
|
+
/**
|
2426
|
+
* Deserializes binary data (in protobuf wire format) from the
|
2427
|
+
* given reader into the given message object.
|
2428
|
+
* @param {!proto.game.File} msg The message object to deserialize into.
|
2429
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
2430
|
+
* @return {!proto.game.File}
|
2431
|
+
*/
|
2432
|
+
proto.game.File.deserializeBinaryFromReader = function(msg, reader) {
|
2433
|
+
while (reader.nextField()) {
|
2434
|
+
if (reader.isEndGroup()) {
|
2435
|
+
break;
|
2436
|
+
}
|
2437
|
+
var field = reader.getFieldNumber();
|
2438
|
+
switch (field) {
|
2439
|
+
case 1:
|
2440
|
+
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
2441
|
+
msg.setContent(value);
|
2442
|
+
break;
|
2443
|
+
default:
|
2444
|
+
reader.skipField();
|
2445
|
+
break;
|
2446
|
+
}
|
2447
|
+
}
|
2448
|
+
return msg;
|
2449
|
+
};
|
2450
|
+
|
2451
|
+
|
2452
|
+
/**
|
2453
|
+
* Serializes the message to binary data (in protobuf wire format).
|
2454
|
+
* @return {!Uint8Array}
|
2455
|
+
*/
|
2456
|
+
proto.game.File.prototype.serializeBinary = function() {
|
2457
|
+
var writer = new jspb.BinaryWriter();
|
2458
|
+
proto.game.File.serializeBinaryToWriter(this, writer);
|
2459
|
+
return writer.getResultBuffer();
|
2460
|
+
};
|
2461
|
+
|
2462
|
+
|
2463
|
+
/**
|
2464
|
+
* Serializes the given message to binary data (in protobuf wire
|
2465
|
+
* format), writing to the given BinaryWriter.
|
2466
|
+
* @param {!proto.game.File} message
|
2467
|
+
* @param {!jspb.BinaryWriter} writer
|
2468
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
2469
|
+
*/
|
2470
|
+
proto.game.File.serializeBinaryToWriter = function(message, writer) {
|
2471
|
+
var f = undefined;
|
2472
|
+
f = message.getContent_asU8();
|
2473
|
+
if (f.length > 0) {
|
2474
|
+
writer.writeBytes(
|
2475
|
+
1,
|
2476
|
+
f
|
2477
|
+
);
|
2478
|
+
}
|
2479
|
+
};
|
2480
|
+
|
2481
|
+
|
2482
|
+
/**
|
2483
|
+
* optional bytes content = 1;
|
2484
|
+
* @return {!(string|Uint8Array)}
|
2485
|
+
*/
|
2486
|
+
proto.game.File.prototype.getContent = function() {
|
2487
|
+
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
2488
|
+
};
|
2489
|
+
|
2490
|
+
|
2491
|
+
/**
|
2492
|
+
* optional bytes content = 1;
|
2493
|
+
* This is a type-conversion wrapper around `getContent()`
|
2494
|
+
* @return {string}
|
2495
|
+
*/
|
2496
|
+
proto.game.File.prototype.getContent_asB64 = function() {
|
2497
|
+
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
2498
|
+
this.getContent()));
|
2499
|
+
};
|
2500
|
+
|
2501
|
+
|
2502
|
+
/**
|
2503
|
+
* optional bytes content = 1;
|
2504
|
+
* Note that Uint8Array is not supported on all browsers.
|
2505
|
+
* @see http://caniuse.com/Uint8Array
|
2506
|
+
* This is a type-conversion wrapper around `getContent()`
|
2507
|
+
* @return {!Uint8Array}
|
2508
|
+
*/
|
2509
|
+
proto.game.File.prototype.getContent_asU8 = function() {
|
2510
|
+
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
2511
|
+
this.getContent()));
|
2512
|
+
};
|
2513
|
+
|
2514
|
+
|
2515
|
+
/**
|
2516
|
+
* @param {!(string|Uint8Array)} value
|
2517
|
+
* @return {!proto.game.File} returns this
|
2518
|
+
*/
|
2519
|
+
proto.game.File.prototype.setContent = function(value) {
|
2520
|
+
return jspb.Message.setProto3BytesField(this, 1, value);
|
2521
|
+
};
|
2522
|
+
|
2523
|
+
|
2037
2524
|
goog.object.extend(exports, proto.game);
|