@toitware/api
Version:
Toitware API library
1,057 lines (908 loc) • 30.5 kB
JavaScript
// source: toit/model/app.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 toit_model_pubsub_topic_pb = require('../../toit/model/pubsub/topic_pb.js');
goog.object.extend(proto, toit_model_pubsub_topic_pb);
var toit_model_job_pb = require('../../toit/model/job_pb.js');
goog.object.extend(proto, toit_model_job_pb);
goog.exportSymbol('proto.toit.model.App', null, global);
goog.exportSymbol('proto.toit.model.JobSpec', null, global);
goog.exportSymbol('proto.toit.model.JobSpec.PubSub', 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.App = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.model.App, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.model.App.displayName = 'proto.toit.model.App';
}
/**
* 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.JobSpec = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.JobSpec.repeatedFields_, null);
};
goog.inherits(proto.toit.model.JobSpec, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.model.JobSpec.displayName = 'proto.toit.model.JobSpec';
}
/**
* 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.JobSpec.PubSub = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.model.JobSpec.PubSub.repeatedFields_, null);
};
goog.inherits(proto.toit.model.JobSpec.PubSub, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.model.JobSpec.PubSub.displayName = 'proto.toit.model.JobSpec.PubSub';
}
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.App.prototype.toObject = function(opt_includeInstance) {
return proto.toit.model.App.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.App} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.model.App.toObject = function(includeInstance, msg) {
var f, obj = {
appId: msg.getAppId_asB64(),
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
namespace: jspb.Message.getFieldWithDefault(msg, 3, ""),
revision: jspb.Message.getFieldWithDefault(msg, 4, 0),
sourceId: msg.getSourceId_asB64(),
jobsMap: (f = msg.getJobsMap()) ? f.toObject(includeInstance, proto.toit.model.JobSpec.toObject) : [],
createdAt: (f = msg.getCreatedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
createdBy: msg.getCreatedBy_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.App}
*/
proto.toit.model.App.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.model.App;
return proto.toit.model.App.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.model.App} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.model.App}
*/
proto.toit.model.App.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.setAppId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setNamespace(value);
break;
case 4:
var value = /** @type {number} */ (reader.readUint64());
msg.setRevision(value);
break;
case 5:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setSourceId(value);
break;
case 6:
var value = msg.getJobsMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.toit.model.JobSpec.deserializeBinaryFromReader, "", new proto.toit.model.JobSpec());
});
break;
case 7:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setCreatedAt(value);
break;
case 8:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setCreatedBy(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.model.App.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.model.App.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.App} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.model.App.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAppId_asU8();
if (f.length > 0) {
writer.writeBytes(
1,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getNamespace();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getRevision();
if (f !== 0) {
writer.writeUint64(
4,
f
);
}
f = message.getSourceId_asU8();
if (f.length > 0) {
writer.writeBytes(
5,
f
);
}
f = message.getJobsMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.toit.model.JobSpec.serializeBinaryToWriter);
}
f = message.getCreatedAt();
if (f != null) {
writer.writeMessage(
7,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getCreatedBy_asU8();
if (f.length > 0) {
writer.writeBytes(
8,
f
);
}
};
/**
* optional bytes app_id = 1;
* @return {!(string|Uint8Array)}
*/
proto.toit.model.App.prototype.getAppId = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* optional bytes app_id = 1;
* This is a type-conversion wrapper around `getAppId()`
* @return {string}
*/
proto.toit.model.App.prototype.getAppId_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getAppId()));
};
/**
* optional bytes app_id = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getAppId()`
* @return {!Uint8Array}
*/
proto.toit.model.App.prototype.getAppId_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getAppId()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.setAppId = function(value) {
return jspb.Message.setProto3BytesField(this, 1, value);
};
/**
* optional string name = 2;
* @return {string}
*/
proto.toit.model.App.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string namespace = 3;
* @return {string}
*/
proto.toit.model.App.prototype.getNamespace = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.setNamespace = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional uint64 revision = 4;
* @return {number}
*/
proto.toit.model.App.prototype.getRevision = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.setRevision = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional bytes source_id = 5;
* @return {!(string|Uint8Array)}
*/
proto.toit.model.App.prototype.getSourceId = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* optional bytes source_id = 5;
* This is a type-conversion wrapper around `getSourceId()`
* @return {string}
*/
proto.toit.model.App.prototype.getSourceId_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getSourceId()));
};
/**
* optional bytes source_id = 5;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getSourceId()`
* @return {!Uint8Array}
*/
proto.toit.model.App.prototype.getSourceId_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getSourceId()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.setSourceId = function(value) {
return jspb.Message.setProto3BytesField(this, 5, value);
};
/**
* map<string, JobSpec> jobs = 6;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,!proto.toit.model.JobSpec>}
*/
proto.toit.model.App.prototype.getJobsMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,!proto.toit.model.JobSpec>} */ (
jspb.Message.getMapField(this, 6, opt_noLazyCreate,
proto.toit.model.JobSpec));
};
/**
* Clears values from the map. The map will be non-null.
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.clearJobsMap = function() {
this.getJobsMap().clear();
return this;};
/**
* optional google.protobuf.Timestamp created_at = 7;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.toit.model.App.prototype.getCreatedAt = 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.App} returns this
*/
proto.toit.model.App.prototype.setCreatedAt = function(value) {
return jspb.Message.setWrapperField(this, 7, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.clearCreatedAt = function() {
return this.setCreatedAt(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.toit.model.App.prototype.hasCreatedAt = function() {
return jspb.Message.getField(this, 7) != null;
};
/**
* optional bytes created_by = 8;
* @return {!(string|Uint8Array)}
*/
proto.toit.model.App.prototype.getCreatedBy = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
};
/**
* optional bytes created_by = 8;
* This is a type-conversion wrapper around `getCreatedBy()`
* @return {string}
*/
proto.toit.model.App.prototype.getCreatedBy_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getCreatedBy()));
};
/**
* optional bytes created_by = 8;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getCreatedBy()`
* @return {!Uint8Array}
*/
proto.toit.model.App.prototype.getCreatedBy_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getCreatedBy()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.toit.model.App} returns this
*/
proto.toit.model.App.prototype.setCreatedBy = function(value) {
return jspb.Message.setProto3BytesField(this, 8, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.toit.model.JobSpec.repeatedFields_ = [6];
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.JobSpec.prototype.toObject = function(opt_includeInstance) {
return proto.toit.model.JobSpec.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.JobSpec} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.model.JobSpec.toObject = function(includeInstance, msg) {
var f, obj = {
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
entrypoint: jspb.Message.getFieldWithDefault(msg, 2, ""),
resources: (f = msg.getResources()) && toit_model_job_pb.JobResources.toObject(includeInstance, f),
triggers: (f = msg.getTriggers()) && toit_model_job_pb.JobTriggers.toObject(includeInstance, f),
pubsub: (f = msg.getPubsub()) && proto.toit.model.JobSpec.PubSub.toObject(includeInstance, f),
filesList: jspb.Message.toObjectList(msg.getFilesList(),
toit_model_job_pb.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.JobSpec}
*/
proto.toit.model.JobSpec.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.model.JobSpec;
return proto.toit.model.JobSpec.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.model.JobSpec} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.model.JobSpec}
*/
proto.toit.model.JobSpec.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setEntrypoint(value);
break;
case 3:
var value = new toit_model_job_pb.JobResources;
reader.readMessage(value,toit_model_job_pb.JobResources.deserializeBinaryFromReader);
msg.setResources(value);
break;
case 4:
var value = new toit_model_job_pb.JobTriggers;
reader.readMessage(value,toit_model_job_pb.JobTriggers.deserializeBinaryFromReader);
msg.setTriggers(value);
break;
case 5:
var value = new proto.toit.model.JobSpec.PubSub;
reader.readMessage(value,proto.toit.model.JobSpec.PubSub.deserializeBinaryFromReader);
msg.setPubsub(value);
break;
case 6:
var value = new toit_model_job_pb.JobFile;
reader.readMessage(value,toit_model_job_pb.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.JobSpec.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.model.JobSpec.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.JobSpec} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.model.JobSpec.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getEntrypoint();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getResources();
if (f != null) {
writer.writeMessage(
3,
f,
toit_model_job_pb.JobResources.serializeBinaryToWriter
);
}
f = message.getTriggers();
if (f != null) {
writer.writeMessage(
4,
f,
toit_model_job_pb.JobTriggers.serializeBinaryToWriter
);
}
f = message.getPubsub();
if (f != null) {
writer.writeMessage(
5,
f,
proto.toit.model.JobSpec.PubSub.serializeBinaryToWriter
);
}
f = message.getFilesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
6,
f,
toit_model_job_pb.JobFile.serializeBinaryToWriter
);
}
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.toit.model.JobSpec.PubSub.repeatedFields_ = [1];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.toit.model.JobSpec.PubSub.prototype.toObject = function(opt_includeInstance) {
return proto.toit.model.JobSpec.PubSub.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.JobSpec.PubSub} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.model.JobSpec.PubSub.toObject = function(includeInstance, msg) {
var f, obj = {
subscriptionsList: jspb.Message.toObjectList(msg.getSubscriptionsList(),
toit_model_pubsub_topic_pb.Topic.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.JobSpec.PubSub}
*/
proto.toit.model.JobSpec.PubSub.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.model.JobSpec.PubSub;
return proto.toit.model.JobSpec.PubSub.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.model.JobSpec.PubSub} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.model.JobSpec.PubSub}
*/
proto.toit.model.JobSpec.PubSub.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new toit_model_pubsub_topic_pb.Topic;
reader.readMessage(value,toit_model_pubsub_topic_pb.Topic.deserializeBinaryFromReader);
msg.addSubscriptions(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.model.JobSpec.PubSub.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.model.JobSpec.PubSub.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.JobSpec.PubSub} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.model.JobSpec.PubSub.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSubscriptionsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
1,
f,
toit_model_pubsub_topic_pb.Topic.serializeBinaryToWriter
);
}
};
/**
* repeated pubsub.Topic subscriptions = 1;
* @return {!Array<!proto.toit.model.pubsub.Topic>}
*/
proto.toit.model.JobSpec.PubSub.prototype.getSubscriptionsList = function() {
return /** @type{!Array<!proto.toit.model.pubsub.Topic>} */ (
jspb.Message.getRepeatedWrapperField(this, toit_model_pubsub_topic_pb.Topic, 1));
};
/**
* @param {!Array<!proto.toit.model.pubsub.Topic>} value
* @return {!proto.toit.model.JobSpec.PubSub} returns this
*/
proto.toit.model.JobSpec.PubSub.prototype.setSubscriptionsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 1, value);
};
/**
* @param {!proto.toit.model.pubsub.Topic=} opt_value
* @param {number=} opt_index
* @return {!proto.toit.model.pubsub.Topic}
*/
proto.toit.model.JobSpec.PubSub.prototype.addSubscriptions = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.toit.model.pubsub.Topic, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.toit.model.JobSpec.PubSub} returns this
*/
proto.toit.model.JobSpec.PubSub.prototype.clearSubscriptionsList = function() {
return this.setSubscriptionsList([]);
};
/**
* optional string name = 1;
* @return {string}
*/
proto.toit.model.JobSpec.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string entrypoint = 2;
* @return {string}
*/
proto.toit.model.JobSpec.prototype.getEntrypoint = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.setEntrypoint = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional JobResources resources = 3;
* @return {?proto.toit.model.JobResources}
*/
proto.toit.model.JobSpec.prototype.getResources = function() {
return /** @type{?proto.toit.model.JobResources} */ (
jspb.Message.getWrapperField(this, toit_model_job_pb.JobResources, 3));
};
/**
* @param {?proto.toit.model.JobResources|undefined} value
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.setResources = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.clearResources = function() {
return this.setResources(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.toit.model.JobSpec.prototype.hasResources = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional JobTriggers triggers = 4;
* @return {?proto.toit.model.JobTriggers}
*/
proto.toit.model.JobSpec.prototype.getTriggers = function() {
return /** @type{?proto.toit.model.JobTriggers} */ (
jspb.Message.getWrapperField(this, toit_model_job_pb.JobTriggers, 4));
};
/**
* @param {?proto.toit.model.JobTriggers|undefined} value
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.setTriggers = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.clearTriggers = function() {
return this.setTriggers(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.toit.model.JobSpec.prototype.hasTriggers = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional PubSub pubsub = 5;
* @return {?proto.toit.model.JobSpec.PubSub}
*/
proto.toit.model.JobSpec.prototype.getPubsub = function() {
return /** @type{?proto.toit.model.JobSpec.PubSub} */ (
jspb.Message.getWrapperField(this, proto.toit.model.JobSpec.PubSub, 5));
};
/**
* @param {?proto.toit.model.JobSpec.PubSub|undefined} value
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.setPubsub = function(value) {
return jspb.Message.setWrapperField(this, 5, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.clearPubsub = function() {
return this.setPubsub(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.toit.model.JobSpec.prototype.hasPubsub = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* repeated JobFile files = 6;
* @return {!Array<!proto.toit.model.JobFile>}
*/
proto.toit.model.JobSpec.prototype.getFilesList = function() {
return /** @type{!Array<!proto.toit.model.JobFile>} */ (
jspb.Message.getRepeatedWrapperField(this, toit_model_job_pb.JobFile, 6));
};
/**
* @param {!Array<!proto.toit.model.JobFile>} value
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.setFilesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 6, value);
};
/**
* @param {!proto.toit.model.JobFile=} opt_value
* @param {number=} opt_index
* @return {!proto.toit.model.JobFile}
*/
proto.toit.model.JobSpec.prototype.addFiles = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.toit.model.JobFile, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.toit.model.JobSpec} returns this
*/
proto.toit.model.JobSpec.prototype.clearFilesList = function() {
return this.setFilesList([]);
};
goog.object.extend(exports, proto.toit.model);