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.
1,743 lines (1,512 loc) • 46.2 kB
JavaScript
// source: stats/track_statistics.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.stats.ArtistStatistics', null, global);
goog.exportSymbol('proto.stats.TimeBasedStats', null, global);
goog.exportSymbol('proto.stats.TrackStatistics', null, global);
goog.exportSymbol('proto.stats.TrendingTrack', 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.stats.TrackStatistics = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.stats.TrackStatistics, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.stats.TrackStatistics.displayName = 'proto.stats.TrackStatistics';
}
/**
* 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.stats.ArtistStatistics = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.stats.ArtistStatistics, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.stats.ArtistStatistics.displayName = 'proto.stats.ArtistStatistics';
}
/**
* 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.stats.TimeBasedStats = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.stats.TimeBasedStats, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.stats.TimeBasedStats.displayName = 'proto.stats.TimeBasedStats';
}
/**
* 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.stats.TrendingTrack = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.stats.TrendingTrack, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.stats.TrendingTrack.displayName = 'proto.stats.TrendingTrack';
}
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.stats.TrackStatistics.prototype.toObject = function(opt_includeInstance) {
return proto.stats.TrackStatistics.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.stats.TrackStatistics} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.TrackStatistics.toObject = function(includeInstance, msg) {
var f, obj = {
trackId: jspb.Message.getFieldWithDefault(msg, 1, 0),
totalPlays: jspb.Message.getFieldWithDefault(msg, 2, 0),
uniqueListeners: jspb.Message.getFieldWithDefault(msg, 3, 0),
totalListeningSeconds: jspb.Message.getFieldWithDefault(msg, 4, 0),
averageListeningDuration: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
totalFavorites: jspb.Message.getFieldWithDefault(msg, 6, 0),
totalPlaylistAdds: jspb.Message.getFieldWithDefault(msg, 7, 0),
completionRate: jspb.Message.getFloatingPointFieldWithDefault(msg, 8, 0.0),
skipRate: jspb.Message.getFloatingPointFieldWithDefault(msg, 9, 0.0),
updatedAt: jspb.Message.getFieldWithDefault(msg, 10, 0),
createdAt: jspb.Message.getFieldWithDefault(msg, 11, 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.stats.TrackStatistics}
*/
proto.stats.TrackStatistics.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.stats.TrackStatistics;
return proto.stats.TrackStatistics.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.stats.TrackStatistics} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.stats.TrackStatistics}
*/
proto.stats.TrackStatistics.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.setTrackId(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalPlays(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setUniqueListeners(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalListeningSeconds(value);
break;
case 5:
var value = /** @type {number} */ (reader.readDouble());
msg.setAverageListeningDuration(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalFavorites(value);
break;
case 7:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalPlaylistAdds(value);
break;
case 8:
var value = /** @type {number} */ (reader.readDouble());
msg.setCompletionRate(value);
break;
case 9:
var value = /** @type {number} */ (reader.readDouble());
msg.setSkipRate(value);
break;
case 10:
var value = /** @type {number} */ (reader.readInt64());
msg.setUpdatedAt(value);
break;
case 11:
var value = /** @type {number} */ (reader.readInt64());
msg.setCreatedAt(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.stats.TrackStatistics.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.stats.TrackStatistics.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.stats.TrackStatistics} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.TrackStatistics.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTrackId();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = message.getTotalPlays();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
f = message.getUniqueListeners();
if (f !== 0) {
writer.writeInt64(
3,
f
);
}
f = message.getTotalListeningSeconds();
if (f !== 0) {
writer.writeInt64(
4,
f
);
}
f = message.getAverageListeningDuration();
if (f !== 0.0) {
writer.writeDouble(
5,
f
);
}
f = message.getTotalFavorites();
if (f !== 0) {
writer.writeInt64(
6,
f
);
}
f = message.getTotalPlaylistAdds();
if (f !== 0) {
writer.writeInt64(
7,
f
);
}
f = message.getCompletionRate();
if (f !== 0.0) {
writer.writeDouble(
8,
f
);
}
f = message.getSkipRate();
if (f !== 0.0) {
writer.writeDouble(
9,
f
);
}
f = message.getUpdatedAt();
if (f !== 0) {
writer.writeInt64(
10,
f
);
}
f = message.getCreatedAt();
if (f !== 0) {
writer.writeInt64(
11,
f
);
}
};
/**
* optional int32 track_id = 1;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getTrackId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setTrackId = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional int64 total_plays = 2;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getTotalPlays = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setTotalPlays = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional int64 unique_listeners = 3;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getUniqueListeners = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setUniqueListeners = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional int64 total_listening_seconds = 4;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getTotalListeningSeconds = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setTotalListeningSeconds = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional double average_listening_duration = 5;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getAverageListeningDuration = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setAverageListeningDuration = function(value) {
return jspb.Message.setProto3FloatField(this, 5, value);
};
/**
* optional int64 total_favorites = 6;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getTotalFavorites = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setTotalFavorites = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional int64 total_playlist_adds = 7;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getTotalPlaylistAdds = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setTotalPlaylistAdds = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};
/**
* optional double completion_rate = 8;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getCompletionRate = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 8, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setCompletionRate = function(value) {
return jspb.Message.setProto3FloatField(this, 8, value);
};
/**
* optional double skip_rate = 9;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getSkipRate = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 9, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setSkipRate = function(value) {
return jspb.Message.setProto3FloatField(this, 9, value);
};
/**
* optional int64 updated_at = 10;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getUpdatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setUpdatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 10, value);
};
/**
* optional int64 created_at = 11;
* @return {number}
*/
proto.stats.TrackStatistics.prototype.getCreatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrackStatistics} returns this
*/
proto.stats.TrackStatistics.prototype.setCreatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 11, 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.stats.ArtistStatistics.prototype.toObject = function(opt_includeInstance) {
return proto.stats.ArtistStatistics.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.stats.ArtistStatistics} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.ArtistStatistics.toObject = function(includeInstance, msg) {
var f, obj = {
artistId: jspb.Message.getFieldWithDefault(msg, 1, 0),
totalPlays: jspb.Message.getFieldWithDefault(msg, 2, 0),
uniqueListeners: jspb.Message.getFieldWithDefault(msg, 3, 0),
totalListeningSeconds: jspb.Message.getFieldWithDefault(msg, 4, 0),
followersCount: jspb.Message.getFieldWithDefault(msg, 5, 0),
totalTracks: jspb.Message.getFieldWithDefault(msg, 6, 0),
totalFavorites: jspb.Message.getFieldWithDefault(msg, 7, 0),
totalPlaylistAdds: jspb.Message.getFieldWithDefault(msg, 8, 0),
averageCompletionRate: jspb.Message.getFloatingPointFieldWithDefault(msg, 9, 0.0),
updatedAt: jspb.Message.getFieldWithDefault(msg, 10, 0),
createdAt: jspb.Message.getFieldWithDefault(msg, 11, 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.stats.ArtistStatistics}
*/
proto.stats.ArtistStatistics.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.stats.ArtistStatistics;
return proto.stats.ArtistStatistics.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.stats.ArtistStatistics} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.stats.ArtistStatistics}
*/
proto.stats.ArtistStatistics.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.setArtistId(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalPlays(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setUniqueListeners(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalListeningSeconds(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt64());
msg.setFollowersCount(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt32());
msg.setTotalTracks(value);
break;
case 7:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalFavorites(value);
break;
case 8:
var value = /** @type {number} */ (reader.readInt64());
msg.setTotalPlaylistAdds(value);
break;
case 9:
var value = /** @type {number} */ (reader.readDouble());
msg.setAverageCompletionRate(value);
break;
case 10:
var value = /** @type {number} */ (reader.readInt64());
msg.setUpdatedAt(value);
break;
case 11:
var value = /** @type {number} */ (reader.readInt64());
msg.setCreatedAt(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.stats.ArtistStatistics.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.stats.ArtistStatistics.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.stats.ArtistStatistics} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.ArtistStatistics.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getArtistId();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = message.getTotalPlays();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
f = message.getUniqueListeners();
if (f !== 0) {
writer.writeInt64(
3,
f
);
}
f = message.getTotalListeningSeconds();
if (f !== 0) {
writer.writeInt64(
4,
f
);
}
f = message.getFollowersCount();
if (f !== 0) {
writer.writeInt64(
5,
f
);
}
f = message.getTotalTracks();
if (f !== 0) {
writer.writeInt32(
6,
f
);
}
f = message.getTotalFavorites();
if (f !== 0) {
writer.writeInt64(
7,
f
);
}
f = message.getTotalPlaylistAdds();
if (f !== 0) {
writer.writeInt64(
8,
f
);
}
f = message.getAverageCompletionRate();
if (f !== 0.0) {
writer.writeDouble(
9,
f
);
}
f = message.getUpdatedAt();
if (f !== 0) {
writer.writeInt64(
10,
f
);
}
f = message.getCreatedAt();
if (f !== 0) {
writer.writeInt64(
11,
f
);
}
};
/**
* optional int32 artist_id = 1;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getArtistId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setArtistId = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional int64 total_plays = 2;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getTotalPlays = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setTotalPlays = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional int64 unique_listeners = 3;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getUniqueListeners = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setUniqueListeners = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional int64 total_listening_seconds = 4;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getTotalListeningSeconds = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setTotalListeningSeconds = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional int64 followers_count = 5;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getFollowersCount = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setFollowersCount = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional int32 total_tracks = 6;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getTotalTracks = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setTotalTracks = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional int64 total_favorites = 7;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getTotalFavorites = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setTotalFavorites = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};
/**
* optional int64 total_playlist_adds = 8;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getTotalPlaylistAdds = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setTotalPlaylistAdds = function(value) {
return jspb.Message.setProto3IntField(this, 8, value);
};
/**
* optional double average_completion_rate = 9;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getAverageCompletionRate = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 9, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setAverageCompletionRate = function(value) {
return jspb.Message.setProto3FloatField(this, 9, value);
};
/**
* optional int64 updated_at = 10;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getUpdatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setUpdatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 10, value);
};
/**
* optional int64 created_at = 11;
* @return {number}
*/
proto.stats.ArtistStatistics.prototype.getCreatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
};
/**
* @param {number} value
* @return {!proto.stats.ArtistStatistics} returns this
*/
proto.stats.ArtistStatistics.prototype.setCreatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 11, 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.stats.TimeBasedStats.prototype.toObject = function(opt_includeInstance) {
return proto.stats.TimeBasedStats.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.stats.TimeBasedStats} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.TimeBasedStats.toObject = function(includeInstance, msg) {
var f, obj = {
trackId: jspb.Message.getFieldWithDefault(msg, 1, 0),
date: jspb.Message.getFieldWithDefault(msg, 2, ""),
periodType: jspb.Message.getFieldWithDefault(msg, 3, ""),
plays: jspb.Message.getFieldWithDefault(msg, 4, 0),
uniqueListeners: jspb.Message.getFieldWithDefault(msg, 5, 0),
listeningSeconds: jspb.Message.getFieldWithDefault(msg, 6, 0),
favorites: jspb.Message.getFieldWithDefault(msg, 7, 0),
playlistAdds: jspb.Message.getFieldWithDefault(msg, 8, 0),
trendingScore: jspb.Message.getFloatingPointFieldWithDefault(msg, 9, 0.0),
createdAt: jspb.Message.getFieldWithDefault(msg, 10, 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.stats.TimeBasedStats}
*/
proto.stats.TimeBasedStats.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.stats.TimeBasedStats;
return proto.stats.TimeBasedStats.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.stats.TimeBasedStats} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.stats.TimeBasedStats}
*/
proto.stats.TimeBasedStats.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.setTrackId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setDate(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setPeriodType(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt64());
msg.setPlays(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt64());
msg.setUniqueListeners(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt64());
msg.setListeningSeconds(value);
break;
case 7:
var value = /** @type {number} */ (reader.readInt64());
msg.setFavorites(value);
break;
case 8:
var value = /** @type {number} */ (reader.readInt64());
msg.setPlaylistAdds(value);
break;
case 9:
var value = /** @type {number} */ (reader.readDouble());
msg.setTrendingScore(value);
break;
case 10:
var value = /** @type {number} */ (reader.readInt64());
msg.setCreatedAt(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.stats.TimeBasedStats.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.stats.TimeBasedStats.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.stats.TimeBasedStats} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.TimeBasedStats.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTrackId();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = message.getDate();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getPeriodType();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getPlays();
if (f !== 0) {
writer.writeInt64(
4,
f
);
}
f = message.getUniqueListeners();
if (f !== 0) {
writer.writeInt64(
5,
f
);
}
f = message.getListeningSeconds();
if (f !== 0) {
writer.writeInt64(
6,
f
);
}
f = message.getFavorites();
if (f !== 0) {
writer.writeInt64(
7,
f
);
}
f = message.getPlaylistAdds();
if (f !== 0) {
writer.writeInt64(
8,
f
);
}
f = message.getTrendingScore();
if (f !== 0.0) {
writer.writeDouble(
9,
f
);
}
f = message.getCreatedAt();
if (f !== 0) {
writer.writeInt64(
10,
f
);
}
};
/**
* optional int32 track_id = 1;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getTrackId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setTrackId = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional string date = 2;
* @return {string}
*/
proto.stats.TimeBasedStats.prototype.getDate = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setDate = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string period_type = 3;
* @return {string}
*/
proto.stats.TimeBasedStats.prototype.getPeriodType = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setPeriodType = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional int64 plays = 4;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getPlays = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setPlays = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional int64 unique_listeners = 5;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getUniqueListeners = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setUniqueListeners = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional int64 listening_seconds = 6;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getListeningSeconds = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setListeningSeconds = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional int64 favorites = 7;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getFavorites = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setFavorites = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};
/**
* optional int64 playlist_adds = 8;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getPlaylistAdds = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setPlaylistAdds = function(value) {
return jspb.Message.setProto3IntField(this, 8, value);
};
/**
* optional double trending_score = 9;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getTrendingScore = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 9, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setTrendingScore = function(value) {
return jspb.Message.setProto3FloatField(this, 9, value);
};
/**
* optional int64 created_at = 10;
* @return {number}
*/
proto.stats.TimeBasedStats.prototype.getCreatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TimeBasedStats} returns this
*/
proto.stats.TimeBasedStats.prototype.setCreatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 10, 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.stats.TrendingTrack.prototype.toObject = function(opt_includeInstance) {
return proto.stats.TrendingTrack.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.stats.TrendingTrack} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.TrendingTrack.toObject = function(includeInstance, msg) {
var f, obj = {
trackId: jspb.Message.getFieldWithDefault(msg, 1, 0),
periodType: jspb.Message.getFieldWithDefault(msg, 2, ""),
rank: jspb.Message.getFieldWithDefault(msg, 3, 0),
trendingScore: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
rankChange: jspb.Message.getFieldWithDefault(msg, 5, 0),
playsChangePercent: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0),
periodDate: jspb.Message.getFieldWithDefault(msg, 7, ""),
updatedAt: jspb.Message.getFieldWithDefault(msg, 8, 0),
createdAt: jspb.Message.getFieldWithDefault(msg, 9, 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.stats.TrendingTrack}
*/
proto.stats.TrendingTrack.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.stats.TrendingTrack;
return proto.stats.TrendingTrack.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.stats.TrendingTrack} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.stats.TrendingTrack}
*/
proto.stats.TrendingTrack.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.setTrackId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPeriodType(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt32());
msg.setRank(value);
break;
case 4:
var value = /** @type {number} */ (reader.readDouble());
msg.setTrendingScore(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt32());
msg.setRankChange(value);
break;
case 6:
var value = /** @type {number} */ (reader.readDouble());
msg.setPlaysChangePercent(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setPeriodDate(value);
break;
case 8:
var value = /** @type {number} */ (reader.readInt64());
msg.setUpdatedAt(value);
break;
case 9:
var value = /** @type {number} */ (reader.readInt64());
msg.setCreatedAt(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.stats.TrendingTrack.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.stats.TrendingTrack.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.stats.TrendingTrack} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.stats.TrendingTrack.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTrackId();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = message.getPeriodType();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getRank();
if (f !== 0) {
writer.writeInt32(
3,
f
);
}
f = message.getTrendingScore();
if (f !== 0.0) {
writer.writeDouble(
4,
f
);
}
f = message.getRankChange();
if (f !== 0) {
writer.writeInt32(
5,
f
);
}
f = message.getPlaysChangePercent();
if (f !== 0.0) {
writer.writeDouble(
6,
f
);
}
f = message.getPeriodDate();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
f = message.getUpdatedAt();
if (f !== 0) {
writer.writeInt64(
8,
f
);
}
f = message.getCreatedAt();
if (f !== 0) {
writer.writeInt64(
9,
f
);
}
};
/**
* optional int32 track_id = 1;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getTrackId = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setTrackId = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional string period_type = 2;
* @return {string}
*/
proto.stats.TrendingTrack.prototype.getPeriodType = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setPeriodType = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional int32 rank = 3;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getRank = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setRank = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional double trending_score = 4;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getTrendingScore = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setTrendingScore = function(value) {
return jspb.Message.setProto3FloatField(this, 4, value);
};
/**
* optional int32 rank_change = 5;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getRankChange = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setRankChange = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional double plays_change_percent = 6;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getPlaysChangePercent = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setPlaysChangePercent = function(value) {
return jspb.Message.setProto3FloatField(this, 6, value);
};
/**
* optional string period_date = 7;
* @return {string}
*/
proto.stats.TrendingTrack.prototype.getPeriodDate = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/**
* @param {string} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setPeriodDate = function(value) {
return jspb.Message.setProto3StringField(this, 7, value);
};
/**
* optional int64 updated_at = 8;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getUpdatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setUpdatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 8, value);
};
/**
* optional int64 created_at = 9;
* @return {number}
*/
proto.stats.TrendingTrack.prototype.getCreatedAt = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
};
/**
* @param {number} value
* @return {!proto.stats.TrendingTrack} returns this
*/
proto.stats.TrendingTrack.prototype.setCreatedAt = function(value) {
return jspb.Message.setProto3IntField(this, 9, value);
};
goog.object.extend(exports, proto.stats);