node-cs2
Version:
Modern CS2/CS:GO Game Coordinator integration with latest GameTracking-CS2 protobuf definitions. Includes support for highlight_reel, wrapped_sticker, variations, Promise-based API, crate opening, sticker/patch/keychain operations, and all modern CS2 fiel
1,024 lines (947 loc) • 734 kB
JavaScript
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
(function(global, factory) { /* global define, require, module */
/* AMD */ if (typeof define === 'function' && define.amd)
define(["protobufjs/minimal"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("protobufjs/minimal"));
})(this, function($protobuf) {
"use strict";
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.CPublishedFile_Subscribe_Request = (function() {
/**
* Properties of a CPublishedFile_Subscribe_Request.
* @exports ICPublishedFile_Subscribe_Request
* @interface ICPublishedFile_Subscribe_Request
* @property {number|Long|null} [publishedfileid] CPublishedFile_Subscribe_Request publishedfileid
* @property {number|null} [list_type] CPublishedFile_Subscribe_Request list_type
* @property {number|null} [appid] CPublishedFile_Subscribe_Request appid
* @property {boolean|null} [notify_client] CPublishedFile_Subscribe_Request notify_client
*/
/**
* Constructs a new CPublishedFile_Subscribe_Request.
* @exports CPublishedFile_Subscribe_Request
* @classdesc Represents a CPublishedFile_Subscribe_Request.
* @implements ICPublishedFile_Subscribe_Request
* @constructor
* @param {ICPublishedFile_Subscribe_Request=} [properties] Properties to set
*/
function CPublishedFile_Subscribe_Request(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CPublishedFile_Subscribe_Request publishedfileid.
* @member {number|Long} publishedfileid
* @memberof CPublishedFile_Subscribe_Request
* @instance
*/
CPublishedFile_Subscribe_Request.prototype.publishedfileid = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* CPublishedFile_Subscribe_Request list_type.
* @member {number} list_type
* @memberof CPublishedFile_Subscribe_Request
* @instance
*/
CPublishedFile_Subscribe_Request.prototype.list_type = 0;
/**
* CPublishedFile_Subscribe_Request appid.
* @member {number} appid
* @memberof CPublishedFile_Subscribe_Request
* @instance
*/
CPublishedFile_Subscribe_Request.prototype.appid = 0;
/**
* CPublishedFile_Subscribe_Request notify_client.
* @member {boolean} notify_client
* @memberof CPublishedFile_Subscribe_Request
* @instance
*/
CPublishedFile_Subscribe_Request.prototype.notify_client = false;
/**
* Creates a new CPublishedFile_Subscribe_Request instance using the specified properties.
* @function create
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {ICPublishedFile_Subscribe_Request=} [properties] Properties to set
* @returns {CPublishedFile_Subscribe_Request} CPublishedFile_Subscribe_Request instance
*/
CPublishedFile_Subscribe_Request.create = function create(properties) {
return new CPublishedFile_Subscribe_Request(properties);
};
/**
* Encodes the specified CPublishedFile_Subscribe_Request message. Does not implicitly {@link CPublishedFile_Subscribe_Request.verify|verify} messages.
* @function encode
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {ICPublishedFile_Subscribe_Request} message CPublishedFile_Subscribe_Request message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Subscribe_Request.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.publishedfileid != null && Object.hasOwnProperty.call(message, "publishedfileid"))
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.publishedfileid);
if (message.list_type != null && Object.hasOwnProperty.call(message, "list_type"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.list_type);
if (message.appid != null && Object.hasOwnProperty.call(message, "appid"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.appid);
if (message.notify_client != null && Object.hasOwnProperty.call(message, "notify_client"))
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.notify_client);
return writer;
};
/**
* Encodes the specified CPublishedFile_Subscribe_Request message, length delimited. Does not implicitly {@link CPublishedFile_Subscribe_Request.verify|verify} messages.
* @function encodeDelimited
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {ICPublishedFile_Subscribe_Request} message CPublishedFile_Subscribe_Request message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Subscribe_Request.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPublishedFile_Subscribe_Request message from the specified reader or buffer.
* @function decode
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPublishedFile_Subscribe_Request} CPublishedFile_Subscribe_Request
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Subscribe_Request.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CPublishedFile_Subscribe_Request();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.publishedfileid = reader.uint64();
break;
}
case 2: {
message.list_type = reader.uint32();
break;
}
case 3: {
message.appid = reader.int32();
break;
}
case 4: {
message.notify_client = reader.bool();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPublishedFile_Subscribe_Request message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPublishedFile_Subscribe_Request} CPublishedFile_Subscribe_Request
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Subscribe_Request.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPublishedFile_Subscribe_Request message.
* @function verify
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPublishedFile_Subscribe_Request.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.publishedfileid != null && message.hasOwnProperty("publishedfileid"))
if (!$util.isInteger(message.publishedfileid) && !(message.publishedfileid && $util.isInteger(message.publishedfileid.low) && $util.isInteger(message.publishedfileid.high)))
return "publishedfileid: integer|Long expected";
if (message.list_type != null && message.hasOwnProperty("list_type"))
if (!$util.isInteger(message.list_type))
return "list_type: integer expected";
if (message.appid != null && message.hasOwnProperty("appid"))
if (!$util.isInteger(message.appid))
return "appid: integer expected";
if (message.notify_client != null && message.hasOwnProperty("notify_client"))
if (typeof message.notify_client !== "boolean")
return "notify_client: boolean expected";
return null;
};
/**
* Creates a CPublishedFile_Subscribe_Request message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPublishedFile_Subscribe_Request} CPublishedFile_Subscribe_Request
*/
CPublishedFile_Subscribe_Request.fromObject = function fromObject(object) {
if (object instanceof $root.CPublishedFile_Subscribe_Request)
return object;
var message = new $root.CPublishedFile_Subscribe_Request();
if (object.publishedfileid != null)
if ($util.Long)
(message.publishedfileid = $util.Long.fromValue(object.publishedfileid)).unsigned = true;
else if (typeof object.publishedfileid === "string")
message.publishedfileid = parseInt(object.publishedfileid, 10);
else if (typeof object.publishedfileid === "number")
message.publishedfileid = object.publishedfileid;
else if (typeof object.publishedfileid === "object")
message.publishedfileid = new $util.LongBits(object.publishedfileid.low >>> 0, object.publishedfileid.high >>> 0).toNumber(true);
if (object.list_type != null)
message.list_type = object.list_type >>> 0;
if (object.appid != null)
message.appid = object.appid | 0;
if (object.notify_client != null)
message.notify_client = Boolean(object.notify_client);
return message;
};
/**
* Creates a plain object from a CPublishedFile_Subscribe_Request message. Also converts values to other types if specified.
* @function toObject
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {CPublishedFile_Subscribe_Request} message CPublishedFile_Subscribe_Request
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPublishedFile_Subscribe_Request.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.publishedfileid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.publishedfileid = options.longs === String ? "0" : 0;
object.list_type = 0;
object.appid = 0;
object.notify_client = false;
}
if (message.publishedfileid != null && message.hasOwnProperty("publishedfileid"))
if (typeof message.publishedfileid === "number")
object.publishedfileid = options.longs === String ? String(message.publishedfileid) : message.publishedfileid;
else
object.publishedfileid = options.longs === String ? $util.Long.prototype.toString.call(message.publishedfileid) : options.longs === Number ? new $util.LongBits(message.publishedfileid.low >>> 0, message.publishedfileid.high >>> 0).toNumber(true) : message.publishedfileid;
if (message.list_type != null && message.hasOwnProperty("list_type"))
object.list_type = message.list_type;
if (message.appid != null && message.hasOwnProperty("appid"))
object.appid = message.appid;
if (message.notify_client != null && message.hasOwnProperty("notify_client"))
object.notify_client = message.notify_client;
return object;
};
/**
* Converts this CPublishedFile_Subscribe_Request to JSON.
* @function toJSON
* @memberof CPublishedFile_Subscribe_Request
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPublishedFile_Subscribe_Request.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPublishedFile_Subscribe_Request
* @function getTypeUrl
* @memberof CPublishedFile_Subscribe_Request
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPublishedFile_Subscribe_Request.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPublishedFile_Subscribe_Request";
};
return CPublishedFile_Subscribe_Request;
})();
$root.CPublishedFile_Subscribe_Response = (function() {
/**
* Properties of a CPublishedFile_Subscribe_Response.
* @exports ICPublishedFile_Subscribe_Response
* @interface ICPublishedFile_Subscribe_Response
*/
/**
* Constructs a new CPublishedFile_Subscribe_Response.
* @exports CPublishedFile_Subscribe_Response
* @classdesc Represents a CPublishedFile_Subscribe_Response.
* @implements ICPublishedFile_Subscribe_Response
* @constructor
* @param {ICPublishedFile_Subscribe_Response=} [properties] Properties to set
*/
function CPublishedFile_Subscribe_Response(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Creates a new CPublishedFile_Subscribe_Response instance using the specified properties.
* @function create
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {ICPublishedFile_Subscribe_Response=} [properties] Properties to set
* @returns {CPublishedFile_Subscribe_Response} CPublishedFile_Subscribe_Response instance
*/
CPublishedFile_Subscribe_Response.create = function create(properties) {
return new CPublishedFile_Subscribe_Response(properties);
};
/**
* Encodes the specified CPublishedFile_Subscribe_Response message. Does not implicitly {@link CPublishedFile_Subscribe_Response.verify|verify} messages.
* @function encode
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {ICPublishedFile_Subscribe_Response} message CPublishedFile_Subscribe_Response message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Subscribe_Response.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified CPublishedFile_Subscribe_Response message, length delimited. Does not implicitly {@link CPublishedFile_Subscribe_Response.verify|verify} messages.
* @function encodeDelimited
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {ICPublishedFile_Subscribe_Response} message CPublishedFile_Subscribe_Response message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Subscribe_Response.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPublishedFile_Subscribe_Response message from the specified reader or buffer.
* @function decode
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPublishedFile_Subscribe_Response} CPublishedFile_Subscribe_Response
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Subscribe_Response.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CPublishedFile_Subscribe_Response();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPublishedFile_Subscribe_Response message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPublishedFile_Subscribe_Response} CPublishedFile_Subscribe_Response
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Subscribe_Response.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPublishedFile_Subscribe_Response message.
* @function verify
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPublishedFile_Subscribe_Response.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a CPublishedFile_Subscribe_Response message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPublishedFile_Subscribe_Response} CPublishedFile_Subscribe_Response
*/
CPublishedFile_Subscribe_Response.fromObject = function fromObject(object) {
if (object instanceof $root.CPublishedFile_Subscribe_Response)
return object;
return new $root.CPublishedFile_Subscribe_Response();
};
/**
* Creates a plain object from a CPublishedFile_Subscribe_Response message. Also converts values to other types if specified.
* @function toObject
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {CPublishedFile_Subscribe_Response} message CPublishedFile_Subscribe_Response
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPublishedFile_Subscribe_Response.toObject = function toObject() {
return {};
};
/**
* Converts this CPublishedFile_Subscribe_Response to JSON.
* @function toJSON
* @memberof CPublishedFile_Subscribe_Response
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPublishedFile_Subscribe_Response.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPublishedFile_Subscribe_Response
* @function getTypeUrl
* @memberof CPublishedFile_Subscribe_Response
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPublishedFile_Subscribe_Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPublishedFile_Subscribe_Response";
};
return CPublishedFile_Subscribe_Response;
})();
$root.CPublishedFile_Unsubscribe_Request = (function() {
/**
* Properties of a CPublishedFile_Unsubscribe_Request.
* @exports ICPublishedFile_Unsubscribe_Request
* @interface ICPublishedFile_Unsubscribe_Request
* @property {number|Long|null} [publishedfileid] CPublishedFile_Unsubscribe_Request publishedfileid
* @property {number|null} [list_type] CPublishedFile_Unsubscribe_Request list_type
* @property {number|null} [appid] CPublishedFile_Unsubscribe_Request appid
* @property {boolean|null} [notify_client] CPublishedFile_Unsubscribe_Request notify_client
*/
/**
* Constructs a new CPublishedFile_Unsubscribe_Request.
* @exports CPublishedFile_Unsubscribe_Request
* @classdesc Represents a CPublishedFile_Unsubscribe_Request.
* @implements ICPublishedFile_Unsubscribe_Request
* @constructor
* @param {ICPublishedFile_Unsubscribe_Request=} [properties] Properties to set
*/
function CPublishedFile_Unsubscribe_Request(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CPublishedFile_Unsubscribe_Request publishedfileid.
* @member {number|Long} publishedfileid
* @memberof CPublishedFile_Unsubscribe_Request
* @instance
*/
CPublishedFile_Unsubscribe_Request.prototype.publishedfileid = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
/**
* CPublishedFile_Unsubscribe_Request list_type.
* @member {number} list_type
* @memberof CPublishedFile_Unsubscribe_Request
* @instance
*/
CPublishedFile_Unsubscribe_Request.prototype.list_type = 0;
/**
* CPublishedFile_Unsubscribe_Request appid.
* @member {number} appid
* @memberof CPublishedFile_Unsubscribe_Request
* @instance
*/
CPublishedFile_Unsubscribe_Request.prototype.appid = 0;
/**
* CPublishedFile_Unsubscribe_Request notify_client.
* @member {boolean} notify_client
* @memberof CPublishedFile_Unsubscribe_Request
* @instance
*/
CPublishedFile_Unsubscribe_Request.prototype.notify_client = false;
/**
* Creates a new CPublishedFile_Unsubscribe_Request instance using the specified properties.
* @function create
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {ICPublishedFile_Unsubscribe_Request=} [properties] Properties to set
* @returns {CPublishedFile_Unsubscribe_Request} CPublishedFile_Unsubscribe_Request instance
*/
CPublishedFile_Unsubscribe_Request.create = function create(properties) {
return new CPublishedFile_Unsubscribe_Request(properties);
};
/**
* Encodes the specified CPublishedFile_Unsubscribe_Request message. Does not implicitly {@link CPublishedFile_Unsubscribe_Request.verify|verify} messages.
* @function encode
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {ICPublishedFile_Unsubscribe_Request} message CPublishedFile_Unsubscribe_Request message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Unsubscribe_Request.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.publishedfileid != null && Object.hasOwnProperty.call(message, "publishedfileid"))
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.publishedfileid);
if (message.list_type != null && Object.hasOwnProperty.call(message, "list_type"))
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.list_type);
if (message.appid != null && Object.hasOwnProperty.call(message, "appid"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.appid);
if (message.notify_client != null && Object.hasOwnProperty.call(message, "notify_client"))
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.notify_client);
return writer;
};
/**
* Encodes the specified CPublishedFile_Unsubscribe_Request message, length delimited. Does not implicitly {@link CPublishedFile_Unsubscribe_Request.verify|verify} messages.
* @function encodeDelimited
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {ICPublishedFile_Unsubscribe_Request} message CPublishedFile_Unsubscribe_Request message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Unsubscribe_Request.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPublishedFile_Unsubscribe_Request message from the specified reader or buffer.
* @function decode
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPublishedFile_Unsubscribe_Request} CPublishedFile_Unsubscribe_Request
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Unsubscribe_Request.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CPublishedFile_Unsubscribe_Request();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.publishedfileid = reader.uint64();
break;
}
case 2: {
message.list_type = reader.uint32();
break;
}
case 3: {
message.appid = reader.int32();
break;
}
case 4: {
message.notify_client = reader.bool();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPublishedFile_Unsubscribe_Request message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPublishedFile_Unsubscribe_Request} CPublishedFile_Unsubscribe_Request
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Unsubscribe_Request.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPublishedFile_Unsubscribe_Request message.
* @function verify
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPublishedFile_Unsubscribe_Request.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.publishedfileid != null && message.hasOwnProperty("publishedfileid"))
if (!$util.isInteger(message.publishedfileid) && !(message.publishedfileid && $util.isInteger(message.publishedfileid.low) && $util.isInteger(message.publishedfileid.high)))
return "publishedfileid: integer|Long expected";
if (message.list_type != null && message.hasOwnProperty("list_type"))
if (!$util.isInteger(message.list_type))
return "list_type: integer expected";
if (message.appid != null && message.hasOwnProperty("appid"))
if (!$util.isInteger(message.appid))
return "appid: integer expected";
if (message.notify_client != null && message.hasOwnProperty("notify_client"))
if (typeof message.notify_client !== "boolean")
return "notify_client: boolean expected";
return null;
};
/**
* Creates a CPublishedFile_Unsubscribe_Request message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPublishedFile_Unsubscribe_Request} CPublishedFile_Unsubscribe_Request
*/
CPublishedFile_Unsubscribe_Request.fromObject = function fromObject(object) {
if (object instanceof $root.CPublishedFile_Unsubscribe_Request)
return object;
var message = new $root.CPublishedFile_Unsubscribe_Request();
if (object.publishedfileid != null)
if ($util.Long)
(message.publishedfileid = $util.Long.fromValue(object.publishedfileid)).unsigned = true;
else if (typeof object.publishedfileid === "string")
message.publishedfileid = parseInt(object.publishedfileid, 10);
else if (typeof object.publishedfileid === "number")
message.publishedfileid = object.publishedfileid;
else if (typeof object.publishedfileid === "object")
message.publishedfileid = new $util.LongBits(object.publishedfileid.low >>> 0, object.publishedfileid.high >>> 0).toNumber(true);
if (object.list_type != null)
message.list_type = object.list_type >>> 0;
if (object.appid != null)
message.appid = object.appid | 0;
if (object.notify_client != null)
message.notify_client = Boolean(object.notify_client);
return message;
};
/**
* Creates a plain object from a CPublishedFile_Unsubscribe_Request message. Also converts values to other types if specified.
* @function toObject
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {CPublishedFile_Unsubscribe_Request} message CPublishedFile_Unsubscribe_Request
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPublishedFile_Unsubscribe_Request.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.publishedfileid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.publishedfileid = options.longs === String ? "0" : 0;
object.list_type = 0;
object.appid = 0;
object.notify_client = false;
}
if (message.publishedfileid != null && message.hasOwnProperty("publishedfileid"))
if (typeof message.publishedfileid === "number")
object.publishedfileid = options.longs === String ? String(message.publishedfileid) : message.publishedfileid;
else
object.publishedfileid = options.longs === String ? $util.Long.prototype.toString.call(message.publishedfileid) : options.longs === Number ? new $util.LongBits(message.publishedfileid.low >>> 0, message.publishedfileid.high >>> 0).toNumber(true) : message.publishedfileid;
if (message.list_type != null && message.hasOwnProperty("list_type"))
object.list_type = message.list_type;
if (message.appid != null && message.hasOwnProperty("appid"))
object.appid = message.appid;
if (message.notify_client != null && message.hasOwnProperty("notify_client"))
object.notify_client = message.notify_client;
return object;
};
/**
* Converts this CPublishedFile_Unsubscribe_Request to JSON.
* @function toJSON
* @memberof CPublishedFile_Unsubscribe_Request
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPublishedFile_Unsubscribe_Request.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPublishedFile_Unsubscribe_Request
* @function getTypeUrl
* @memberof CPublishedFile_Unsubscribe_Request
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPublishedFile_Unsubscribe_Request.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPublishedFile_Unsubscribe_Request";
};
return CPublishedFile_Unsubscribe_Request;
})();
$root.CPublishedFile_Unsubscribe_Response = (function() {
/**
* Properties of a CPublishedFile_Unsubscribe_Response.
* @exports ICPublishedFile_Unsubscribe_Response
* @interface ICPublishedFile_Unsubscribe_Response
*/
/**
* Constructs a new CPublishedFile_Unsubscribe_Response.
* @exports CPublishedFile_Unsubscribe_Response
* @classdesc Represents a CPublishedFile_Unsubscribe_Response.
* @implements ICPublishedFile_Unsubscribe_Response
* @constructor
* @param {ICPublishedFile_Unsubscribe_Response=} [properties] Properties to set
*/
function CPublishedFile_Unsubscribe_Response(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Creates a new CPublishedFile_Unsubscribe_Response instance using the specified properties.
* @function create
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {ICPublishedFile_Unsubscribe_Response=} [properties] Properties to set
* @returns {CPublishedFile_Unsubscribe_Response} CPublishedFile_Unsubscribe_Response instance
*/
CPublishedFile_Unsubscribe_Response.create = function create(properties) {
return new CPublishedFile_Unsubscribe_Response(properties);
};
/**
* Encodes the specified CPublishedFile_Unsubscribe_Response message. Does not implicitly {@link CPublishedFile_Unsubscribe_Response.verify|verify} messages.
* @function encode
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {ICPublishedFile_Unsubscribe_Response} message CPublishedFile_Unsubscribe_Response message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Unsubscribe_Response.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
/**
* Encodes the specified CPublishedFile_Unsubscribe_Response message, length delimited. Does not implicitly {@link CPublishedFile_Unsubscribe_Response.verify|verify} messages.
* @function encodeDelimited
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {ICPublishedFile_Unsubscribe_Response} message CPublishedFile_Unsubscribe_Response message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CPublishedFile_Unsubscribe_Response.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CPublishedFile_Unsubscribe_Response message from the specified reader or buffer.
* @function decode
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {CPublishedFile_Unsubscribe_Response} CPublishedFile_Unsubscribe_Response
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Unsubscribe_Response.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.CPublishedFile_Unsubscribe_Response();
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CPublishedFile_Unsubscribe_Response message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {CPublishedFile_Unsubscribe_Response} CPublishedFile_Unsubscribe_Response
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CPublishedFile_Unsubscribe_Response.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CPublishedFile_Unsubscribe_Response message.
* @function verify
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CPublishedFile_Unsubscribe_Response.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
/**
* Creates a CPublishedFile_Unsubscribe_Response message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {Object.<string,*>} object Plain object
* @returns {CPublishedFile_Unsubscribe_Response} CPublishedFile_Unsubscribe_Response
*/
CPublishedFile_Unsubscribe_Response.fromObject = function fromObject(object) {
if (object instanceof $root.CPublishedFile_Unsubscribe_Response)
return object;
return new $root.CPublishedFile_Unsubscribe_Response();
};
/**
* Creates a plain object from a CPublishedFile_Unsubscribe_Response message. Also converts values to other types if specified.
* @function toObject
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {CPublishedFile_Unsubscribe_Response} message CPublishedFile_Unsubscribe_Response
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CPublishedFile_Unsubscribe_Response.toObject = function toObject() {
return {};
};
/**
* Converts this CPublishedFile_Unsubscribe_Response to JSON.
* @function toJSON
* @memberof CPublishedFile_Unsubscribe_Response
* @instance
* @returns {Object.<string,*>} JSON object
*/
CPublishedFile_Unsubscribe_Response.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CPublishedFile_Unsubscribe_Response
* @function getTypeUrl
* @memberof CPublishedFile_Unsubscribe_Response
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CPublishedFile_Unsubscribe_Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/CPublishedFile_Unsubscribe_Response";
};
return CPublishedFile_Unsubscribe_Response;
})();
$root.CPublishedFile_Publish_Request = (function() {
/**
* Properties of a CPublishedFile_Publish_Request.
* @exports ICPublishedFile_Publish_Request
* @interface ICPublishedFile_Publish_Request
* @property {number|null} [appid] CPublishedFile_Publish_Request appid
* @property {number|null} [consumer_appid] CPublishedFile_Publish_Request consumer_appid
* @property {string|null} [cloudfilename] CPublishedFile_Publish_Request cloudfilename
* @property {string|null} [preview_cloudfilename] CPublishedFile_Publish_Request preview_cloudfilename
* @property {string|null} [title] CPublishedFile_Publish_Request title
* @property {string|null} [file_description] CPublishedFile_Publish_Request file_description
* @property {number|null} [file_type] CPublishedFile_Publish_Request file_type
* @property {string|null} [consumer_shortcut_name] CPublishedFile_Publish_Request consumer_shortcut_name
* @property {string|null} [youtube_username] CPublishedFile_Publish_Request youtube_username
* @property {string|null} [youtube_videoid] CPublishedFile_Publish_Request youtube_videoid
* @property {number|null} [visibility] CPublishedFile_Publish_Request visibility
* @property {string|null} [redirect_uri] CPublishedFile_Publish_Request redirect_uri
* @property {Array.<string>|null} [tags] CPublishedFile_Publish_Request tags
* @property {string|null} [collection_type] CPublishedFile_Publish_Request collection_type
* @property {string|null} [game_type] CPublishedFile_Publish_Request game_type
* @property {string|null} [url] CPublishedFile_Publish_Request url
*/
/**
* Constructs a new CPublishedFile_Publish_Request.
* @exports CPublishedFile_Publish_Request
* @classdesc Represents a CPublishedFile_Publish_Request.
* @implements ICPublishedFile_Publish_Request
* @constructor
* @param {ICPublishedFile_Publish_Request=} [properties] Properties to set
*/
function CPublishedFile_Publish_Request(properties) {
this.tags = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CPublishedFile_Publish_Request appid.
* @member {number} appid
* @memberof CPublishedFile_Publish_Request
* @instance
*/
CPublishedFile_Publish_Request.prototype.appid = 0;
/**
* CPublishedFile_Publish_Request consumer_appid.
* @member {number} consumer_appid
* @memberof CPublishedFile_Publish_Request
* @instance
*/
CPublishedFile_Publish_Request.prototype.consumer_appid = 0;
/**
* CPublishedFile_Publish_Request cloudfilename.
* @member {string} cloudfilename
* @memberof CPublishedFile_Publish_Request
* @instance
*/
CPublishedFile_Publish_Request.prototype.cloudfilename = "";
/**
* CPublishedFile_Publish_Request preview_cloudfilename.
* @member {string} preview_cloudfilename
* @memberof CPublishedFile_Publish_Request
* @instance
*/
CPublishedFile_Publish_Request.prototype.preview_cloudfilename = "";
/**
* CPublishedFile_Pub