UNPKG

@chatie/grpc

Version:
1,575 lines (1,382 loc) 81.7 kB
// source: puppet/contact.proto /** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); goog.object.extend(proto, google_protobuf_wrappers_pb); goog.exportSymbol('proto.wechaty.puppet.ContactAliasRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactAliasResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactAvatarRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactAvatarResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactGender', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactListRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactListResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactPayloadRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactPayloadResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactSelfNameRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactSelfNameResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactSelfQRCodeRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactSelfQRCodeResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactSelfSignatureRequest', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactSelfSignatureResponse', null, global); goog.exportSymbol('proto.wechaty.puppet.ContactType', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactListRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactListRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactListRequest.displayName = 'proto.wechaty.puppet.ContactListRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactListResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.wechaty.puppet.ContactListResponse.repeatedFields_, null); }; goog.inherits(proto.wechaty.puppet.ContactListResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactListResponse.displayName = 'proto.wechaty.puppet.ContactListResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactPayloadRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactPayloadRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactPayloadRequest.displayName = 'proto.wechaty.puppet.ContactPayloadRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactPayloadResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactPayloadResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactPayloadResponse.displayName = 'proto.wechaty.puppet.ContactPayloadResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactSelfQRCodeRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactSelfQRCodeRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactSelfQRCodeRequest.displayName = 'proto.wechaty.puppet.ContactSelfQRCodeRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactSelfQRCodeResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactSelfQRCodeResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactSelfQRCodeResponse.displayName = 'proto.wechaty.puppet.ContactSelfQRCodeResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactSelfNameRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactSelfNameRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactSelfNameRequest.displayName = 'proto.wechaty.puppet.ContactSelfNameRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactSelfNameResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactSelfNameResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactSelfNameResponse.displayName = 'proto.wechaty.puppet.ContactSelfNameResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactSelfSignatureRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactSelfSignatureRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactSelfSignatureRequest.displayName = 'proto.wechaty.puppet.ContactSelfSignatureRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactSelfSignatureResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactSelfSignatureResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactSelfSignatureResponse.displayName = 'proto.wechaty.puppet.ContactSelfSignatureResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactAliasRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactAliasRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactAliasRequest.displayName = 'proto.wechaty.puppet.ContactAliasRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactAliasResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactAliasResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactAliasResponse.displayName = 'proto.wechaty.puppet.ContactAliasResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactAvatarRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactAvatarRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactAvatarRequest.displayName = 'proto.wechaty.puppet.ContactAvatarRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.wechaty.puppet.ContactAvatarResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.wechaty.puppet.ContactAvatarResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.wechaty.puppet.ContactAvatarResponse.displayName = 'proto.wechaty.puppet.ContactAvatarResponse'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactListRequest.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactListRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactListRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactListRequest.toObject = function(includeInstance, msg) { var f, obj = { }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactListRequest} */ proto.wechaty.puppet.ContactListRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactListRequest; return proto.wechaty.puppet.ContactListRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactListRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactListRequest} */ proto.wechaty.puppet.ContactListRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactListRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactListRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactListRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactListRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.wechaty.puppet.ContactListResponse.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactListResponse.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactListResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactListResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactListResponse.toObject = function(includeInstance, msg) { var f, obj = { idsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactListResponse} */ proto.wechaty.puppet.ContactListResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactListResponse; return proto.wechaty.puppet.ContactListResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactListResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactListResponse} */ proto.wechaty.puppet.ContactListResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.addIds(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactListResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactListResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactListResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactListResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIdsList(); if (f.length > 0) { writer.writeRepeatedString( 1, f ); } }; /** * repeated string ids = 1; * @return {!Array<string>} */ proto.wechaty.puppet.ContactListResponse.prototype.getIdsList = function() { return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1)); }; /** * @param {!Array<string>} value * @return {!proto.wechaty.puppet.ContactListResponse} returns this */ proto.wechaty.puppet.ContactListResponse.prototype.setIdsList = function(value) { return jspb.Message.setField(this, 1, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.wechaty.puppet.ContactListResponse} returns this */ proto.wechaty.puppet.ContactListResponse.prototype.addIds = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.wechaty.puppet.ContactListResponse} returns this */ proto.wechaty.puppet.ContactListResponse.prototype.clearIdsList = function() { return this.setIdsList([]); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactPayloadRequest.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactPayloadRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactPayloadRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactPayloadRequest.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactPayloadRequest} */ proto.wechaty.puppet.ContactPayloadRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactPayloadRequest; return proto.wechaty.puppet.ContactPayloadRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactPayloadRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactPayloadRequest} */ proto.wechaty.puppet.ContactPayloadRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactPayloadRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactPayloadRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactPayloadRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactPayloadRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string id = 1; * @return {string} */ proto.wechaty.puppet.ContactPayloadRequest.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadRequest} returns this */ proto.wechaty.puppet.ContactPayloadRequest.prototype.setId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactPayloadResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactPayloadResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactPayloadResponse.toObject = function(includeInstance, msg) { var f, obj = { id: jspb.Message.getFieldWithDefault(msg, 1, ""), gender: jspb.Message.getFieldWithDefault(msg, 2, 0), type: jspb.Message.getFieldWithDefault(msg, 3, 0), name: jspb.Message.getFieldWithDefault(msg, 4, ""), avatar: jspb.Message.getFieldWithDefault(msg, 5, ""), address: jspb.Message.getFieldWithDefault(msg, 6, ""), alias: jspb.Message.getFieldWithDefault(msg, 7, ""), city: jspb.Message.getFieldWithDefault(msg, 8, ""), friend: jspb.Message.getBooleanFieldWithDefault(msg, 9, false), province: jspb.Message.getFieldWithDefault(msg, 10, ""), signature: jspb.Message.getFieldWithDefault(msg, 11, ""), star: jspb.Message.getBooleanFieldWithDefault(msg, 12, false), weixin: jspb.Message.getFieldWithDefault(msg, 13, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactPayloadResponse} */ proto.wechaty.puppet.ContactPayloadResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactPayloadResponse; return proto.wechaty.puppet.ContactPayloadResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactPayloadResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactPayloadResponse} */ proto.wechaty.puppet.ContactPayloadResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setId(value); break; case 2: var value = /** @type {!proto.wechaty.puppet.ContactGender} */ (reader.readEnum()); msg.setGender(value); break; case 3: var value = /** @type {!proto.wechaty.puppet.ContactType} */ (reader.readEnum()); msg.setType(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setName(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setAvatar(value); break; case 6: var value = /** @type {string} */ (reader.readString()); msg.setAddress(value); break; case 7: var value = /** @type {string} */ (reader.readString()); msg.setAlias(value); break; case 8: var value = /** @type {string} */ (reader.readString()); msg.setCity(value); break; case 9: var value = /** @type {boolean} */ (reader.readBool()); msg.setFriend(value); break; case 10: var value = /** @type {string} */ (reader.readString()); msg.setProvince(value); break; case 11: var value = /** @type {string} */ (reader.readString()); msg.setSignature(value); break; case 12: var value = /** @type {boolean} */ (reader.readBool()); msg.setStar(value); break; case 13: var value = /** @type {string} */ (reader.readString()); msg.setWeixin(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactPayloadResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactPayloadResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactPayloadResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getGender(); if (f !== 0.0) { writer.writeEnum( 2, f ); } f = message.getType(); if (f !== 0.0) { writer.writeEnum( 3, f ); } f = message.getName(); if (f.length > 0) { writer.writeString( 4, f ); } f = message.getAvatar(); if (f.length > 0) { writer.writeString( 5, f ); } f = message.getAddress(); if (f.length > 0) { writer.writeString( 6, f ); } f = message.getAlias(); if (f.length > 0) { writer.writeString( 7, f ); } f = message.getCity(); if (f.length > 0) { writer.writeString( 8, f ); } f = message.getFriend(); if (f) { writer.writeBool( 9, f ); } f = message.getProvince(); if (f.length > 0) { writer.writeString( 10, f ); } f = message.getSignature(); if (f.length > 0) { writer.writeString( 11, f ); } f = message.getStar(); if (f) { writer.writeBool( 12, f ); } f = message.getWeixin(); if (f.length > 0) { writer.writeString( 13, f ); } }; /** * optional string id = 1; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional ContactGender gender = 2; * @return {!proto.wechaty.puppet.ContactGender} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getGender = function() { return /** @type {!proto.wechaty.puppet.ContactGender} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {!proto.wechaty.puppet.ContactGender} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setGender = function(value) { return jspb.Message.setProto3EnumField(this, 2, value); }; /** * optional ContactType type = 3; * @return {!proto.wechaty.puppet.ContactType} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getType = function() { return /** @type {!proto.wechaty.puppet.ContactType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {!proto.wechaty.puppet.ContactType} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setType = function(value) { return jspb.Message.setProto3EnumField(this, 3, value); }; /** * optional string name = 4; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; /** * optional string avatar = 5; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getAvatar = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setAvatar = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; /** * optional string address = 6; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getAddress = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setAddress = function(value) { return jspb.Message.setProto3StringField(this, 6, value); }; /** * optional string alias = 7; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getAlias = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setAlias = function(value) { return jspb.Message.setProto3StringField(this, 7, value); }; /** * optional string city = 8; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getCity = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setCity = function(value) { return jspb.Message.setProto3StringField(this, 8, value); }; /** * optional bool friend = 9; * @return {boolean} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getFriend = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); }; /** * @param {boolean} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setFriend = function(value) { return jspb.Message.setProto3BooleanField(this, 9, value); }; /** * optional string province = 10; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getProvince = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setProvince = function(value) { return jspb.Message.setProto3StringField(this, 10, value); }; /** * optional string signature = 11; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getSignature = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setSignature = function(value) { return jspb.Message.setProto3StringField(this, 11, value); }; /** * optional bool star = 12; * @return {boolean} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getStar = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); }; /** * @param {boolean} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setStar = function(value) { return jspb.Message.setProto3BooleanField(this, 12, value); }; /** * optional string weixin = 13; * @return {string} */ proto.wechaty.puppet.ContactPayloadResponse.prototype.getWeixin = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactPayloadResponse} returns this */ proto.wechaty.puppet.ContactPayloadResponse.prototype.setWeixin = function(value) { return jspb.Message.setProto3StringField(this, 13, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactSelfQRCodeRequest.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactSelfQRCodeRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactSelfQRCodeRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactSelfQRCodeRequest.toObject = function(includeInstance, msg) { var f, obj = { }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactSelfQRCodeRequest} */ proto.wechaty.puppet.ContactSelfQRCodeRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactSelfQRCodeRequest; return proto.wechaty.puppet.ContactSelfQRCodeRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactSelfQRCodeRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactSelfQRCodeRequest} */ proto.wechaty.puppet.ContactSelfQRCodeRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactSelfQRCodeRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactSelfQRCodeRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactSelfQRCodeRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactSelfQRCodeRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactSelfQRCodeResponse.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactSelfQRCodeResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactSelfQRCodeResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactSelfQRCodeResponse.toObject = function(includeInstance, msg) { var f, obj = { qrcode: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactSelfQRCodeResponse} */ proto.wechaty.puppet.ContactSelfQRCodeResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactSelfQRCodeResponse; return proto.wechaty.puppet.ContactSelfQRCodeResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactSelfQRCodeResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactSelfQRCodeResponse} */ proto.wechaty.puppet.ContactSelfQRCodeResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setQrcode(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactSelfQRCodeResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactSelfQRCodeResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactSelfQRCodeResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactSelfQRCodeResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getQrcode(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string qrcode = 1; * @return {string} */ proto.wechaty.puppet.ContactSelfQRCodeResponse.prototype.getQrcode = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactSelfQRCodeResponse} returns this */ proto.wechaty.puppet.ContactSelfQRCodeResponse.prototype.setQrcode = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.wechaty.puppet.ContactSelfNameRequest.prototype.toObject = function(opt_includeInstance) { return proto.wechaty.puppet.ContactSelfNameRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.wechaty.puppet.ContactSelfNameRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactSelfNameRequest.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.wechaty.puppet.ContactSelfNameRequest} */ proto.wechaty.puppet.ContactSelfNameRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.wechaty.puppet.ContactSelfNameRequest; return proto.wechaty.puppet.ContactSelfNameRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.wechaty.puppet.ContactSelfNameRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.wechaty.puppet.ContactSelfNameRequest} */ proto.wechaty.puppet.ContactSelfNameRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setName(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.wechaty.puppet.ContactSelfNameRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.wechaty.puppet.ContactSelfNameRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.wechaty.puppet.ContactSelfNameRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.wechaty.puppet.ContactSelfNameRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string name = 1; * @return {string} */ proto.wechaty.puppet.ContactSelfNameRequest.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.wechaty.puppet.ContactSelfNameRequest} returns this */ proto.wechaty.puppet.ContactSelfNameRequest.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: