UNPKG

@toitware/api

Version:
1,606 lines (1,434 loc) 155 kB
// source: toit/model/job.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_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); goog.object.extend(proto, google_protobuf_duration_pb); var toit_model_pubsub_topic_pb = require('../../toit/model/pubsub/topic_pb.js'); goog.object.extend(proto, toit_model_pubsub_topic_pb); goog.exportSymbol('proto.toit.model.ButtonTrigger', null, global); goog.exportSymbol('proto.toit.model.CompilationInfo', null, global); goog.exportSymbol('proto.toit.model.CronSchedule', null, global); goog.exportSymbol('proto.toit.model.CronSpec', null, global); goog.exportSymbol('proto.toit.model.CronTrigger', null, global); goog.exportSymbol('proto.toit.model.GPSFeature', null, global); goog.exportSymbol('proto.toit.model.IntervalTrigger', null, global); goog.exportSymbol('proto.toit.model.JobChangeType', null, global); goog.exportSymbol('proto.toit.model.JobConfig', null, global); goog.exportSymbol('proto.toit.model.JobFeatures', null, global); goog.exportSymbol('proto.toit.model.JobFile', null, global); goog.exportSymbol('proto.toit.model.JobFileType', null, global); goog.exportSymbol('proto.toit.model.JobGoalState', null, global); goog.exportSymbol('proto.toit.model.JobInfo', null, global); goog.exportSymbol('proto.toit.model.JobPubSub', null, global); goog.exportSymbol('proto.toit.model.JobPubSub.Subscription', null, global); goog.exportSymbol('proto.toit.model.JobResources', null, global); goog.exportSymbol('proto.toit.model.JobState', null, global); goog.exportSymbol('proto.toit.model.JobStatus', null, global); goog.exportSymbol('proto.toit.model.JobTriggers', null, global); goog.exportSymbol('proto.toit.model.MemoryResource', null, global); goog.exportSymbol('proto.toit.model.MovementTrigger', null, global); goog.exportSymbol('proto.toit.model.NetworkTrigger', null, global); goog.exportSymbol('proto.toit.model.OnBootTrigger', null, global); goog.exportSymbol('proto.toit.model.OnInstallTrigger', null, global); goog.exportSymbol('proto.toit.model.PubSubTrigger', 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.toit.model.JobConfig = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.JobConfig.repeatedFields_, null); }; goog.inherits(proto.toit.model.JobConfig, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobConfig.displayName = 'proto.toit.model.JobConfig'; } /** * 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.toit.model.CompilationInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.CompilationInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.CompilationInfo.displayName = 'proto.toit.model.CompilationInfo'; } /** * 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.toit.model.JobResources = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobResources, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobResources.displayName = 'proto.toit.model.JobResources'; } /** * 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.toit.model.JobFeatures = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobFeatures, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobFeatures.displayName = 'proto.toit.model.JobFeatures'; } /** * 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.toit.model.JobFile = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobFile, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobFile.displayName = 'proto.toit.model.JobFile'; } /** * 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.toit.model.GPSFeature = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.GPSFeature, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.GPSFeature.displayName = 'proto.toit.model.GPSFeature'; } /** * 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.toit.model.MemoryResource = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.MemoryResource, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.MemoryResource.displayName = 'proto.toit.model.MemoryResource'; } /** * 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.toit.model.JobTriggers = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobTriggers, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobTriggers.displayName = 'proto.toit.model.JobTriggers'; } /** * 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.toit.model.OnInstallTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.OnInstallTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.OnInstallTrigger.displayName = 'proto.toit.model.OnInstallTrigger'; } /** * 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.toit.model.OnBootTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.OnBootTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.OnBootTrigger.displayName = 'proto.toit.model.OnBootTrigger'; } /** * 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.toit.model.IntervalTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.IntervalTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.IntervalTrigger.displayName = 'proto.toit.model.IntervalTrigger'; } /** * 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.toit.model.CronTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.CronTrigger.repeatedFields_, null); }; goog.inherits(proto.toit.model.CronTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.CronTrigger.displayName = 'proto.toit.model.CronTrigger'; } /** * 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.toit.model.MovementTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.MovementTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.MovementTrigger.displayName = 'proto.toit.model.MovementTrigger'; } /** * 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.toit.model.ButtonTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.ButtonTrigger.repeatedFields_, null); }; goog.inherits(proto.toit.model.ButtonTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.ButtonTrigger.displayName = 'proto.toit.model.ButtonTrigger'; } /** * 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.toit.model.NetworkTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.NetworkTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.NetworkTrigger.displayName = 'proto.toit.model.NetworkTrigger'; } /** * 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.toit.model.PubSubTrigger = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.PubSubTrigger.repeatedFields_, null); }; goog.inherits(proto.toit.model.PubSubTrigger, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.PubSubTrigger.displayName = 'proto.toit.model.PubSubTrigger'; } /** * 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.toit.model.CronSpec = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.CronSpec.repeatedFields_, null); }; goog.inherits(proto.toit.model.CronSpec, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.CronSpec.displayName = 'proto.toit.model.CronSpec'; } /** * 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.toit.model.CronSchedule = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.CronSchedule, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.CronSchedule.displayName = 'proto.toit.model.CronSchedule'; } /** * 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.toit.model.JobPubSub = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.JobPubSub.repeatedFields_, null); }; goog.inherits(proto.toit.model.JobPubSub, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobPubSub.displayName = 'proto.toit.model.JobPubSub'; } /** * 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.toit.model.JobPubSub.Subscription = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobPubSub.Subscription, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobPubSub.Subscription.displayName = 'proto.toit.model.JobPubSub.Subscription'; } /** * 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.toit.model.JobStatus = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobStatus, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobStatus.displayName = 'proto.toit.model.JobStatus'; } /** * 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.toit.model.JobInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.model.JobInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.model.JobInfo.displayName = 'proto.toit.model.JobInfo'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.toit.model.JobConfig.repeatedFields_ = [12]; 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.toit.model.JobConfig.prototype.toObject = function(opt_includeInstance) { return proto.toit.model.JobConfig.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.toit.model.JobConfig} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.model.JobConfig.toObject = function(includeInstance, msg) { var f, obj = { jobId: msg.getJobId_asB64(), name: jspb.Message.getFieldWithDefault(msg, 1, ""), compilationId: msg.getCompilationId_asB64(), goalState: jspb.Message.getFieldWithDefault(msg, 3, 0), resources: (f = msg.getResources()) && proto.toit.model.JobResources.toObject(includeInstance, f), triggers: (f = msg.getTriggers()) && proto.toit.model.JobTriggers.toObject(includeInstance, f), created: (f = msg.getCreated()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), updated: (f = msg.getUpdated()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), compilationInfo: (f = msg.getCompilationInfo()) && proto.toit.model.CompilationInfo.toObject(includeInstance, f), pubsub: (f = msg.getPubsub()) && proto.toit.model.JobPubSub.toObject(includeInstance, f), filesList: jspb.Message.toObjectList(msg.getFilesList(), proto.toit.model.JobFile.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.model.JobConfig} */ proto.toit.model.JobConfig.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.model.JobConfig; return proto.toit.model.JobConfig.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.model.JobConfig} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.model.JobConfig} */ proto.toit.model.JobConfig.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 8: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setJobId(value); break; case 1: var value = /** @type {string} */ (reader.readString()); msg.setName(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCompilationId(value); break; case 3: var value = /** @type {!proto.toit.model.JobGoalState} */ (reader.readEnum()); msg.setGoalState(value); break; case 4: var value = new proto.toit.model.JobResources; reader.readMessage(value,proto.toit.model.JobResources.deserializeBinaryFromReader); msg.setResources(value); break; case 5: var value = new proto.toit.model.JobTriggers; reader.readMessage(value,proto.toit.model.JobTriggers.deserializeBinaryFromReader); msg.setTriggers(value); break; case 6: var value = new google_protobuf_timestamp_pb.Timestamp; reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setCreated(value); break; case 7: var value = new google_protobuf_timestamp_pb.Timestamp; reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setUpdated(value); break; case 10: var value = new proto.toit.model.CompilationInfo; reader.readMessage(value,proto.toit.model.CompilationInfo.deserializeBinaryFromReader); msg.setCompilationInfo(value); break; case 11: var value = new proto.toit.model.JobPubSub; reader.readMessage(value,proto.toit.model.JobPubSub.deserializeBinaryFromReader); msg.setPubsub(value); break; case 12: var value = new proto.toit.model.JobFile; reader.readMessage(value,proto.toit.model.JobFile.deserializeBinaryFromReader); msg.addFiles(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.model.JobConfig.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.model.JobConfig.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.model.JobConfig} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.model.JobConfig.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getJobId_asU8(); if (f.length > 0) { writer.writeBytes( 8, f ); } f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getCompilationId_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getGoalState(); if (f !== 0.0) { writer.writeEnum( 3, f ); } f = message.getResources(); if (f != null) { writer.writeMessage( 4, f, proto.toit.model.JobResources.serializeBinaryToWriter ); } f = message.getTriggers(); if (f != null) { writer.writeMessage( 5, f, proto.toit.model.JobTriggers.serializeBinaryToWriter ); } f = message.getCreated(); if (f != null) { writer.writeMessage( 6, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } f = message.getUpdated(); if (f != null) { writer.writeMessage( 7, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } f = message.getCompilationInfo(); if (f != null) { writer.writeMessage( 10, f, proto.toit.model.CompilationInfo.serializeBinaryToWriter ); } f = message.getPubsub(); if (f != null) { writer.writeMessage( 11, f, proto.toit.model.JobPubSub.serializeBinaryToWriter ); } f = message.getFilesList(); if (f.length > 0) { writer.writeRepeatedMessage( 12, f, proto.toit.model.JobFile.serializeBinaryToWriter ); } }; /** * optional bytes job_id = 8; * @return {!(string|Uint8Array)} */ proto.toit.model.JobConfig.prototype.getJobId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "")); }; /** * optional bytes job_id = 8; * This is a type-conversion wrapper around `getJobId()` * @return {string} */ proto.toit.model.JobConfig.prototype.getJobId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getJobId())); }; /** * optional bytes job_id = 8; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getJobId()` * @return {!Uint8Array} */ proto.toit.model.JobConfig.prototype.getJobId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getJobId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setJobId = function(value) { return jspb.Message.setProto3BytesField(this, 8, value); }; /** * optional string name = 1; * @return {string} */ proto.toit.model.JobConfig.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bytes compilation_id = 2; * @return {!(string|Uint8Array)} */ proto.toit.model.JobConfig.prototype.getCompilationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes compilation_id = 2; * This is a type-conversion wrapper around `getCompilationId()` * @return {string} */ proto.toit.model.JobConfig.prototype.getCompilationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCompilationId())); }; /** * optional bytes compilation_id = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCompilationId()` * @return {!Uint8Array} */ proto.toit.model.JobConfig.prototype.getCompilationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCompilationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setCompilationId = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional JobGoalState goal_state = 3; * @return {!proto.toit.model.JobGoalState} */ proto.toit.model.JobConfig.prototype.getGoalState = function() { return /** @type {!proto.toit.model.JobGoalState} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {!proto.toit.model.JobGoalState} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setGoalState = function(value) { return jspb.Message.setProto3EnumField(this, 3, value); }; /** * optional JobResources resources = 4; * @return {?proto.toit.model.JobResources} */ proto.toit.model.JobConfig.prototype.getResources = function() { return /** @type{?proto.toit.model.JobResources} */ ( jspb.Message.getWrapperField(this, proto.toit.model.JobResources, 4)); }; /** * @param {?proto.toit.model.JobResources|undefined} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setResources = function(value) { return jspb.Message.setWrapperField(this, 4, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearResources = function() { return this.setResources(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobConfig.prototype.hasResources = function() { return jspb.Message.getField(this, 4) != null; }; /** * optional JobTriggers triggers = 5; * @return {?proto.toit.model.JobTriggers} */ proto.toit.model.JobConfig.prototype.getTriggers = function() { return /** @type{?proto.toit.model.JobTriggers} */ ( jspb.Message.getWrapperField(this, proto.toit.model.JobTriggers, 5)); }; /** * @param {?proto.toit.model.JobTriggers|undefined} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setTriggers = function(value) { return jspb.Message.setWrapperField(this, 5, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearTriggers = function() { return this.setTriggers(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobConfig.prototype.hasTriggers = function() { return jspb.Message.getField(this, 5) != null; }; /** * optional google.protobuf.Timestamp created = 6; * @return {?proto.google.protobuf.Timestamp} */ proto.toit.model.JobConfig.prototype.getCreated = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 6)); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setCreated = function(value) { return jspb.Message.setWrapperField(this, 6, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearCreated = function() { return this.setCreated(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobConfig.prototype.hasCreated = function() { return jspb.Message.getField(this, 6) != null; }; /** * optional google.protobuf.Timestamp updated = 7; * @return {?proto.google.protobuf.Timestamp} */ proto.toit.model.JobConfig.prototype.getUpdated = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 7)); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setUpdated = function(value) { return jspb.Message.setWrapperField(this, 7, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearUpdated = function() { return this.setUpdated(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobConfig.prototype.hasUpdated = function() { return jspb.Message.getField(this, 7) != null; }; /** * optional CompilationInfo compilation_info = 10; * @return {?proto.toit.model.CompilationInfo} */ proto.toit.model.JobConfig.prototype.getCompilationInfo = function() { return /** @type{?proto.toit.model.CompilationInfo} */ ( jspb.Message.getWrapperField(this, proto.toit.model.CompilationInfo, 10)); }; /** * @param {?proto.toit.model.CompilationInfo|undefined} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setCompilationInfo = function(value) { return jspb.Message.setWrapperField(this, 10, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearCompilationInfo = function() { return this.setCompilationInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobConfig.prototype.hasCompilationInfo = function() { return jspb.Message.getField(this, 10) != null; }; /** * optional JobPubSub pubsub = 11; * @return {?proto.toit.model.JobPubSub} */ proto.toit.model.JobConfig.prototype.getPubsub = function() { return /** @type{?proto.toit.model.JobPubSub} */ ( jspb.Message.getWrapperField(this, proto.toit.model.JobPubSub, 11)); }; /** * @param {?proto.toit.model.JobPubSub|undefined} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setPubsub = function(value) { return jspb.Message.setWrapperField(this, 11, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearPubsub = function() { return this.setPubsub(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobConfig.prototype.hasPubsub = function() { return jspb.Message.getField(this, 11) != null; }; /** * repeated JobFile files = 12; * @return {!Array<!proto.toit.model.JobFile>} */ proto.toit.model.JobConfig.prototype.getFilesList = function() { return /** @type{!Array<!proto.toit.model.JobFile>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.toit.model.JobFile, 12)); }; /** * @param {!Array<!proto.toit.model.JobFile>} value * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.setFilesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 12, value); }; /** * @param {!proto.toit.model.JobFile=} opt_value * @param {number=} opt_index * @return {!proto.toit.model.JobFile} */ proto.toit.model.JobConfig.prototype.addFiles = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.toit.model.JobFile, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.toit.model.JobConfig} returns this */ proto.toit.model.JobConfig.prototype.clearFilesList = function() { return this.setFilesList([]); }; 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.toit.model.CompilationInfo.prototype.toObject = function(opt_includeInstance) { return proto.toit.model.CompilationInfo.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.toit.model.CompilationInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.model.CompilationInfo.toObject = function(includeInstance, msg) { var f, obj = { programId: msg.getProgramId_asB64(), sdk: jspb.Message.getFieldWithDefault(msg, 2, ""), creatorId: msg.getCreatorId_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.model.CompilationInfo} */ proto.toit.model.CompilationInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.model.CompilationInfo; return proto.toit.model.CompilationInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.model.CompilationInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.model.CompilationInfo} */ proto.toit.model.CompilationInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setProgramId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setSdk(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCreatorId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.model.CompilationInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.model.CompilationInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.model.CompilationInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.model.CompilationInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getProgramId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getSdk(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getCreatorId_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } }; /** * optional bytes program_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.model.CompilationInfo.prototype.getProgramId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes program_id = 1; * This is a type-conversion wrapper around `getProgramId()` * @return {string} */ proto.toit.model.CompilationInfo.prototype.getProgramId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getProgramId())); }; /** * optional bytes program_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getProgramId()` * @return {!Uint8Array} */ proto.toit.model.CompilationInfo.prototype.getProgramId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getProgramId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.model.CompilationInfo} returns this */ proto.toit.model.CompilationInfo.prototype.setProgramId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional string sdk = 2; * @return {string} */ proto.toit.model.CompilationInfo.prototype.getSdk = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.toit.model.CompilationInfo} returns this */ proto.toit.model.CompilationInfo.prototype.setSdk = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional bytes creator_id = 3; * @return {!(string|Uint8Array)} */ proto.toit.model.CompilationInfo.prototype.getCreatorId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes creator_id = 3; * This is a type-conversion wrapper around `getCreatorId()` * @return {string} */ proto.toit.model.CompilationInfo.prototype.getCreatorId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCreatorId())); }; /** * optional bytes creator_id = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCreatorId()` * @return {!Uint8Array} */ proto.toit.model.CompilationInfo.prototype.getCreatorId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCreatorId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.model.CompilationInfo} returns this */ proto.toit.model.CompilationInfo.prototype.setCreatorId = function(value) { return jspb.Message.setProto3BytesField(this, 3, 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.toit.model.JobResources.prototype.toObject = function(opt_includeInstance) { return proto.toit.model.JobResources.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.toit.model.JobResources} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.model.JobResources.toObject = function(includeInstance, msg) { var f, obj = { memory: (f = msg.getMemory()) && proto.toit.model.MemoryResource.toObject(includeInstance, f), features: (f = msg.getFeatures()) && proto.toit.model.JobFeatures.toObject(includeInstance, 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.toit.model.JobResources} */ proto.toit.model.JobResources.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.model.JobResources; return proto.toit.model.JobResources.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.model.JobResources} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.model.JobResources} */ proto.toit.model.JobResources.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.toit.model.MemoryResource; reader.readMessage(value,proto.toit.model.MemoryResource.deserializeBinaryFromReader); msg.setMemory(value); break; case 2: var value = new proto.toit.model.JobFeatures; reader.readMessage(value,proto.toit.model.JobFeatures.deserializeBinaryFromReader); msg.setFeatures(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.model.JobResources.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.model.JobResources.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.model.JobResources} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.model.JobResources.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getMemory(); if (f != null) { writer.writeMessage( 1, f, proto.toit.model.MemoryResource.serializeBinaryToWriter ); } f = message.getFeatures(); if (f != null) { writer.writeMessage( 2, f, proto.toit.model.JobFeatures.serializeBinaryToWriter ); } }; /** * optional MemoryResource memory = 1; * @return {?proto.toit.model.MemoryResource} */ proto.toit.model.JobResources.prototype.getMemory = function() { return /** @type{?proto.toit.model.MemoryResource} */ ( jspb.Message.getWrapperField(this, proto.toit.model.MemoryResource, 1)); }; /** * @param {?proto.toit.model.MemoryResource|undefined} value * @return {!proto.toit.model.JobResources} returns this */ proto.toit.model.JobResources.prototype.setMemory = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobResources} returns this */ proto.toit.model.JobResources.prototype.clearMemory = function() { return this.setMemory(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobResources.prototype.hasMemory = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional JobFeatures features = 2; * @return {?proto.toit.model.JobFeatures} */ proto.toit.model.JobResources.prototype.getFeatures = function() { return /** @type{?proto.toit.model.JobFeatures} */ ( jspb.Message.getWrapperField(this, proto.toit.model.JobFeatures, 2)); }; /** * @param {?proto.toit.model.JobFeatures|undefined} value * @return {!proto.toit.model.JobResources} returns this */ proto.toit.model.JobResources.prototype.setFeatures = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.model.JobResources} returns this */ proto.toit.model.JobResources.prototype.clearFeatures = function() { return this.setFeatures(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.model.JobResources.prototype.hasFeatures = function() { return jspb.Message.getField(this, 2) != null; }; 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.toit.model.JobFeatures.prototype.toObject = function(opt_includeInstance) { return proto.toit.model.JobFeatures.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {b