UNPKG

echofi-client

Version:

A comprehensive TypeScript/JavaScript client library for EchoFi services with automatic gRPC-Web code generation, unified service access, and real-time WebSocket communication.

539 lines (468 loc) 14.8 kB
// source: activity/referral.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @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! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = (function() { if (this) { return this; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } if (typeof self !== 'undefined') { return self; } return Function('return this')(); }.call(null)); goog.exportSymbol('proto.activity.Referral', null, global); goog.exportSymbol('proto.activity.UserReferrals', 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.activity.Referral = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.activity.Referral, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.activity.Referral.displayName = 'proto.activity.Referral'; } /** * 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.activity.UserReferrals = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.activity.UserReferrals, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.activity.UserReferrals.displayName = 'proto.activity.UserReferrals'; } 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.activity.Referral.prototype.toObject = function(opt_includeInstance) { return proto.activity.Referral.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.activity.Referral} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.activity.Referral.toObject = function(includeInstance, msg) { var f, obj = { referralId: jspb.Message.getFieldWithDefault(msg, 1, 0), referrerId: jspb.Message.getFieldWithDefault(msg, 2, ""), refereeId: jspb.Message.getFieldWithDefault(msg, 3, ""), createdAt: jspb.Message.getFieldWithDefault(msg, 4, 0), updatedAt: jspb.Message.getFieldWithDefault(msg, 5, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.activity.Referral} */ proto.activity.Referral.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.activity.Referral; return proto.activity.Referral.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.activity.Referral} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.activity.Referral} */ proto.activity.Referral.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readInt32()); msg.setReferralId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setReferrerId(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setRefereeId(value); break; case 4: var value = /** @type {number} */ (reader.readInt64()); msg.setCreatedAt(value); break; case 5: var value = /** @type {number} */ (reader.readInt64()); msg.setUpdatedAt(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.activity.Referral.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.activity.Referral.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.activity.Referral} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.activity.Referral.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getReferralId(); if (f !== 0) { writer.writeInt32( 1, f ); } f = message.getReferrerId(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getRefereeId(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getCreatedAt(); if (f !== 0) { writer.writeInt64( 4, f ); } f = message.getUpdatedAt(); if (f !== 0) { writer.writeInt64( 5, f ); } }; /** * optional int32 referral_id = 1; * @return {number} */ proto.activity.Referral.prototype.getReferralId = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.activity.Referral} returns this */ proto.activity.Referral.prototype.setReferralId = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional string referrer_id = 2; * @return {string} */ proto.activity.Referral.prototype.getReferrerId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.activity.Referral} returns this */ proto.activity.Referral.prototype.setReferrerId = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string referee_id = 3; * @return {string} */ proto.activity.Referral.prototype.getRefereeId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.activity.Referral} returns this */ proto.activity.Referral.prototype.setRefereeId = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional int64 created_at = 4; * @return {number} */ proto.activity.Referral.prototype.getCreatedAt = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.activity.Referral} returns this */ proto.activity.Referral.prototype.setCreatedAt = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional int64 updated_at = 5; * @return {number} */ proto.activity.Referral.prototype.getUpdatedAt = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.activity.Referral} returns this */ proto.activity.Referral.prototype.setUpdatedAt = function(value) { return jspb.Message.setProto3IntField(this, 5, 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.activity.UserReferrals.prototype.toObject = function(opt_includeInstance) { return proto.activity.UserReferrals.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.activity.UserReferrals} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.activity.UserReferrals.toObject = function(includeInstance, msg) { var f, obj = { userId: jspb.Message.getFieldWithDefault(msg, 1, ""), totalReferred: jspb.Message.getFieldWithDefault(msg, 2, 0), createdAt: jspb.Message.getFieldWithDefault(msg, 3, 0), updatedAt: jspb.Message.getFieldWithDefault(msg, 4, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.activity.UserReferrals} */ proto.activity.UserReferrals.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.activity.UserReferrals; return proto.activity.UserReferrals.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.activity.UserReferrals} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.activity.UserReferrals} */ proto.activity.UserReferrals.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.setUserId(value); break; case 2: var value = /** @type {number} */ (reader.readInt32()); msg.setTotalReferred(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setCreatedAt(value); break; case 4: var value = /** @type {number} */ (reader.readInt64()); msg.setUpdatedAt(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.activity.UserReferrals.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.activity.UserReferrals.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.activity.UserReferrals} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.activity.UserReferrals.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUserId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getTotalReferred(); if (f !== 0) { writer.writeInt32( 2, f ); } f = message.getCreatedAt(); if (f !== 0) { writer.writeInt64( 3, f ); } f = message.getUpdatedAt(); if (f !== 0) { writer.writeInt64( 4, f ); } }; /** * optional string user_id = 1; * @return {string} */ proto.activity.UserReferrals.prototype.getUserId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.activity.UserReferrals} returns this */ proto.activity.UserReferrals.prototype.setUserId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional int32 total_referred = 2; * @return {number} */ proto.activity.UserReferrals.prototype.getTotalReferred = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.activity.UserReferrals} returns this */ proto.activity.UserReferrals.prototype.setTotalReferred = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional int64 created_at = 3; * @return {number} */ proto.activity.UserReferrals.prototype.getCreatedAt = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.activity.UserReferrals} returns this */ proto.activity.UserReferrals.prototype.setCreatedAt = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional int64 updated_at = 4; * @return {number} */ proto.activity.UserReferrals.prototype.getUpdatedAt = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.activity.UserReferrals} returns this */ proto.activity.UserReferrals.prototype.setUpdatedAt = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; goog.object.extend(exports, proto.activity);