UNPKG

@toitware/api

Version:
1,599 lines (1,400 loc) 83.6 kB
// source: toit/api/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 toit_model_app_pb = require('../../toit/model/app_pb.js'); goog.object.extend(proto, toit_model_app_pb); goog.exportSymbol('proto.toit.api.CreateAppRequest', null, global); goog.exportSymbol('proto.toit.api.CreateAppRequest.Files', null, global); goog.exportSymbol('proto.toit.api.CreateAppRequest.SourceCase', null, global); goog.exportSymbol('proto.toit.api.CreateAppResponse', null, global); goog.exportSymbol('proto.toit.api.GetAppFilesRequest', null, global); goog.exportSymbol('proto.toit.api.GetAppFilesResponse', null, global); goog.exportSymbol('proto.toit.api.GetAppFilesResponse.Directory', null, global); goog.exportSymbol('proto.toit.api.GetAppFilesResponse.Entry', null, global); goog.exportSymbol('proto.toit.api.GetAppFilesResponse.ResultCase', null, global); goog.exportSymbol('proto.toit.api.GetAppRequest', null, global); goog.exportSymbol('proto.toit.api.GetAppResponse', null, global); goog.exportSymbol('proto.toit.api.ListAppsFilter', null, global); goog.exportSymbol('proto.toit.api.ListAppsRequest', null, global); goog.exportSymbol('proto.toit.api.ListAppsRequest.OrderBy', null, global); goog.exportSymbol('proto.toit.api.ListAppsResponse', 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.api.CreateAppRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.toit.api.CreateAppRequest.oneofGroups_); }; goog.inherits(proto.toit.api.CreateAppRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateAppRequest.displayName = 'proto.toit.api.CreateAppRequest'; } /** * 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.api.CreateAppRequest.Files = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateAppRequest.Files, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateAppRequest.Files.displayName = 'proto.toit.api.CreateAppRequest.Files'; } /** * 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.api.CreateAppResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateAppResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateAppResponse.displayName = 'proto.toit.api.CreateAppResponse'; } /** * 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.api.GetAppRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.GetAppRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetAppRequest.displayName = 'proto.toit.api.GetAppRequest'; } /** * 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.api.GetAppResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.GetAppResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetAppResponse.displayName = 'proto.toit.api.GetAppResponse'; } /** * 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.api.GetAppFilesRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.GetAppFilesRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetAppFilesRequest.displayName = 'proto.toit.api.GetAppFilesRequest'; } /** * 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.api.GetAppFilesResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.toit.api.GetAppFilesResponse.oneofGroups_); }; goog.inherits(proto.toit.api.GetAppFilesResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetAppFilesResponse.displayName = 'proto.toit.api.GetAppFilesResponse'; } /** * 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.api.GetAppFilesResponse.Entry = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.GetAppFilesResponse.Entry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetAppFilesResponse.Entry.displayName = 'proto.toit.api.GetAppFilesResponse.Entry'; } /** * 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.api.GetAppFilesResponse.Directory = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.GetAppFilesResponse.Directory.repeatedFields_, null); }; goog.inherits(proto.toit.api.GetAppFilesResponse.Directory, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetAppFilesResponse.Directory.displayName = 'proto.toit.api.GetAppFilesResponse.Directory'; } /** * 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.api.ListAppsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ListAppsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ListAppsRequest.displayName = 'proto.toit.api.ListAppsRequest'; } /** * 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.api.ListAppsFilter = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ListAppsFilter, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ListAppsFilter.displayName = 'proto.toit.api.ListAppsFilter'; } /** * 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.api.ListAppsResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ListAppsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ListAppsResponse.displayName = 'proto.toit.api.ListAppsResponse'; } /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all * other fields in the group are cleared. During deserialization, if multiple * fields are encountered for a group, only the last value seen will be kept. * @private {!Array<!Array<number>>} * @const */ proto.toit.api.CreateAppRequest.oneofGroups_ = [[6,7]]; /** * @enum {number} */ proto.toit.api.CreateAppRequest.SourceCase = { SOURCE_NOT_SET: 0, FILES: 6, BUNDLE: 7 }; /** * @return {proto.toit.api.CreateAppRequest.SourceCase} */ proto.toit.api.CreateAppRequest.prototype.getSourceCase = function() { return /** @type {proto.toit.api.CreateAppRequest.SourceCase} */(jspb.Message.computeOneofCase(this, proto.toit.api.CreateAppRequest.oneofGroups_[0])); }; 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.api.CreateAppRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.CreateAppRequest.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.api.CreateAppRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateAppRequest.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, ""), namespace: jspb.Message.getFieldWithDefault(msg, 2, ""), revision: jspb.Message.getFieldWithDefault(msg, 3, 0), jobsMap: (f = msg.getJobsMap()) ? f.toObject(includeInstance, proto.toit.model.JobSpec.toObject) : [], files: (f = msg.getFiles()) && proto.toit.api.CreateAppRequest.Files.toObject(includeInstance, f), bundle: msg.getBundle_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.api.CreateAppRequest} */ proto.toit.api.CreateAppRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateAppRequest; return proto.toit.api.CreateAppRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateAppRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateAppRequest} */ proto.toit.api.CreateAppRequest.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.setNamespace(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setRevision(value); break; case 5: 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 6: var value = new proto.toit.api.CreateAppRequest.Files; reader.readMessage(value,proto.toit.api.CreateAppRequest.Files.deserializeBinaryFromReader); msg.setFiles(value); break; case 7: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setBundle(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.CreateAppRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.CreateAppRequest.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.api.CreateAppRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateAppRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getNamespace(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getRevision(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getJobsMap(true); if (f && f.getLength() > 0) { f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.toit.model.JobSpec.serializeBinaryToWriter); } f = message.getFiles(); if (f != null) { writer.writeMessage( 6, f, proto.toit.api.CreateAppRequest.Files.serializeBinaryToWriter ); } f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); if (f != null) { writer.writeBytes( 7, f ); } }; 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.api.CreateAppRequest.Files.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.CreateAppRequest.Files.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.api.CreateAppRequest.Files} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateAppRequest.Files.toObject = function(includeInstance, msg) { var f, obj = { filesMap: (f = msg.getFilesMap()) ? f.toObject(includeInstance, undefined) : [] }; 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.api.CreateAppRequest.Files} */ proto.toit.api.CreateAppRequest.Files.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateAppRequest.Files; return proto.toit.api.CreateAppRequest.Files.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateAppRequest.Files} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateAppRequest.Files} */ proto.toit.api.CreateAppRequest.Files.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = msg.getFilesMap(); reader.readMessage(value, function(message, reader) { jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBytes, null, "", ""); }); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.CreateAppRequest.Files.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.CreateAppRequest.Files.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.api.CreateAppRequest.Files} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateAppRequest.Files.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getFilesMap(true); if (f && f.getLength() > 0) { f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBytes); } }; /** * map<string, bytes> files = 1; * @param {boolean=} opt_noLazyCreate Do not create the map if * empty, instead returning `undefined` * @return {!jspb.Map<string,!(string|Uint8Array)>} */ proto.toit.api.CreateAppRequest.Files.prototype.getFilesMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map<string,!(string|Uint8Array)>} */ ( jspb.Message.getMapField(this, 1, opt_noLazyCreate, null)); }; /** * Clears values from the map. The map will be non-null. * @return {!proto.toit.api.CreateAppRequest.Files} returns this */ proto.toit.api.CreateAppRequest.Files.prototype.clearFilesMap = function() { this.getFilesMap().clear(); return this;}; /** * optional string name = 1; * @return {string} */ proto.toit.api.CreateAppRequest.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string namespace = 2; * @return {string} */ proto.toit.api.CreateAppRequest.prototype.getNamespace = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.setNamespace = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional uint64 revision = 3; * @return {number} */ proto.toit.api.CreateAppRequest.prototype.getRevision = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.setRevision = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * map<string, toit.model.JobSpec> jobs = 5; * @param {boolean=} opt_noLazyCreate Do not create the map if * empty, instead returning `undefined` * @return {!jspb.Map<string,!proto.toit.model.JobSpec>} */ proto.toit.api.CreateAppRequest.prototype.getJobsMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map<string,!proto.toit.model.JobSpec>} */ ( jspb.Message.getMapField(this, 5, opt_noLazyCreate, proto.toit.model.JobSpec)); }; /** * Clears values from the map. The map will be non-null. * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.clearJobsMap = function() { this.getJobsMap().clear(); return this;}; /** * optional Files files = 6; * @return {?proto.toit.api.CreateAppRequest.Files} */ proto.toit.api.CreateAppRequest.prototype.getFiles = function() { return /** @type{?proto.toit.api.CreateAppRequest.Files} */ ( jspb.Message.getWrapperField(this, proto.toit.api.CreateAppRequest.Files, 6)); }; /** * @param {?proto.toit.api.CreateAppRequest.Files|undefined} value * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.setFiles = function(value) { return jspb.Message.setOneofWrapperField(this, 6, proto.toit.api.CreateAppRequest.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.clearFiles = function() { return this.setFiles(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.CreateAppRequest.prototype.hasFiles = function() { return jspb.Message.getField(this, 6) != null; }; /** * optional bytes bundle = 7; * @return {!(string|Uint8Array)} */ proto.toit.api.CreateAppRequest.prototype.getBundle = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * optional bytes bundle = 7; * This is a type-conversion wrapper around `getBundle()` * @return {string} */ proto.toit.api.CreateAppRequest.prototype.getBundle_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBundle())); }; /** * optional bytes bundle = 7; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getBundle()` * @return {!Uint8Array} */ proto.toit.api.CreateAppRequest.prototype.getBundle_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBundle())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.setBundle = function(value) { return jspb.Message.setOneofField(this, 7, proto.toit.api.CreateAppRequest.oneofGroups_[0], value); }; /** * Clears the field making it undefined. * @return {!proto.toit.api.CreateAppRequest} returns this */ proto.toit.api.CreateAppRequest.prototype.clearBundle = function() { return jspb.Message.setOneofField(this, 7, proto.toit.api.CreateAppRequest.oneofGroups_[0], undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.CreateAppRequest.prototype.hasBundle = function() { return jspb.Message.getField(this, 7) != 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.api.CreateAppResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.CreateAppResponse.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.api.CreateAppResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateAppResponse.toObject = function(includeInstance, msg) { var f, obj = { appId: msg.getAppId_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.api.CreateAppResponse} */ proto.toit.api.CreateAppResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateAppResponse; return proto.toit.api.CreateAppResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateAppResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateAppResponse} */ proto.toit.api.CreateAppResponse.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; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.CreateAppResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.CreateAppResponse.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.api.CreateAppResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateAppResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAppId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } }; /** * optional bytes app_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.CreateAppResponse.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.api.CreateAppResponse.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.api.CreateAppResponse.prototype.getAppId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAppId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.CreateAppResponse} returns this */ proto.toit.api.CreateAppResponse.prototype.setAppId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.GetAppRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.GetAppRequest.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.api.GetAppRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppRequest.toObject = function(includeInstance, msg) { var f, obj = { appId: msg.getAppId_asB64(), revision: jspb.Message.getFieldWithDefault(msg, 2, 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.toit.api.GetAppRequest} */ proto.toit.api.GetAppRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.GetAppRequest; return proto.toit.api.GetAppRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.GetAppRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.GetAppRequest} */ proto.toit.api.GetAppRequest.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 {number} */ (reader.readUint64()); msg.setRevision(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.GetAppRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.GetAppRequest.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.api.GetAppRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAppId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getRevision(); if (f !== 0) { writer.writeUint64( 2, f ); } }; /** * optional bytes app_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.GetAppRequest.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.api.GetAppRequest.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.api.GetAppRequest.prototype.getAppId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAppId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.GetAppRequest} returns this */ proto.toit.api.GetAppRequest.prototype.setAppId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 revision = 2; * @return {number} */ proto.toit.api.GetAppRequest.prototype.getRevision = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.toit.api.GetAppRequest} returns this */ proto.toit.api.GetAppRequest.prototype.setRevision = function(value) { return jspb.Message.setProto3IntField(this, 2, 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.api.GetAppResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.GetAppResponse.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.api.GetAppResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppResponse.toObject = function(includeInstance, msg) { var f, obj = { app: (f = msg.getApp()) && toit_model_app_pb.App.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.api.GetAppResponse} */ proto.toit.api.GetAppResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.GetAppResponse; return proto.toit.api.GetAppResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.GetAppResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.GetAppResponse} */ proto.toit.api.GetAppResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new toit_model_app_pb.App; reader.readMessage(value,toit_model_app_pb.App.deserializeBinaryFromReader); msg.setApp(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.GetAppResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.GetAppResponse.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.api.GetAppResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getApp(); if (f != null) { writer.writeMessage( 1, f, toit_model_app_pb.App.serializeBinaryToWriter ); } }; /** * optional toit.model.App app = 1; * @return {?proto.toit.model.App} */ proto.toit.api.GetAppResponse.prototype.getApp = function() { return /** @type{?proto.toit.model.App} */ ( jspb.Message.getWrapperField(this, toit_model_app_pb.App, 1)); }; /** * @param {?proto.toit.model.App|undefined} value * @return {!proto.toit.api.GetAppResponse} returns this */ proto.toit.api.GetAppResponse.prototype.setApp = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.GetAppResponse} returns this */ proto.toit.api.GetAppResponse.prototype.clearApp = function() { return this.setApp(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.GetAppResponse.prototype.hasApp = function() { return jspb.Message.getField(this, 1) != 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.api.GetAppFilesRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.GetAppFilesRequest.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.api.GetAppFilesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppFilesRequest.toObject = function(includeInstance, msg) { var f, obj = { appId: msg.getAppId_asB64(), revision: jspb.Message.getFieldWithDefault(msg, 2, 0), path: jspb.Message.getFieldWithDefault(msg, 3, "") }; 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.api.GetAppFilesRequest} */ proto.toit.api.GetAppFilesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.GetAppFilesRequest; return proto.toit.api.GetAppFilesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.GetAppFilesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.GetAppFilesRequest} */ proto.toit.api.GetAppFilesRequest.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 {number} */ (reader.readUint64()); msg.setRevision(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setPath(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.GetAppFilesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.GetAppFilesRequest.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.api.GetAppFilesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppFilesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAppId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getRevision(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getPath(); if (f.length > 0) { writer.writeString( 3, f ); } }; /** * optional bytes app_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.GetAppFilesRequest.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.api.GetAppFilesRequest.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.api.GetAppFilesRequest.prototype.getAppId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAppId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.GetAppFilesRequest} returns this */ proto.toit.api.GetAppFilesRequest.prototype.setAppId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 revision = 2; * @return {number} */ proto.toit.api.GetAppFilesRequest.prototype.getRevision = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.toit.api.GetAppFilesRequest} returns this */ proto.toit.api.GetAppFilesRequest.prototype.setRevision = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional string path = 3; * @return {string} */ proto.toit.api.GetAppFilesRequest.prototype.getPath = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.toit.api.GetAppFilesRequest} returns this */ proto.toit.api.GetAppFilesRequest.prototype.setPath = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all * other fields in the group are cleared. During deserialization, if multiple * fields are encountered for a group, only the last value seen will be kept. * @private {!Array<!Array<number>>} * @const */ proto.toit.api.GetAppFilesResponse.oneofGroups_ = [[1,2]]; /** * @enum {number} */ proto.toit.api.GetAppFilesResponse.ResultCase = { RESULT_NOT_SET: 0, DIRECTORY: 1, FILE_CONTENT: 2 }; /** * @return {proto.toit.api.GetAppFilesResponse.ResultCase} */ proto.toit.api.GetAppFilesResponse.prototype.getResultCase = function() { return /** @type {proto.toit.api.GetAppFilesResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.toit.api.GetAppFilesResponse.oneofGroups_[0])); }; 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.api.GetAppFilesResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.GetAppFilesResponse.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.api.GetAppFilesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetAppFilesResponse.toObject = function(includeInstance, msg) { var f, obj = { directory: (f = msg.getDirectory()) && proto.toit.api.GetAppFilesResponse.Directory.toObject(includeInstance, f), fileContent: msg.getFileContent_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.api.GetAppFilesResponse} */ proto.toit.api.GetAppFilesResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.GetAppFilesResponse; return proto.toit.api.GetAppFilesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.GetAppFilesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.GetAppFilesResponse} */ proto.toit.api.GetAppFilesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.toit.api.GetAppFilesResponse.Directory; reader.readMessage(value,proto.toit.api.GetAppFilesResponse.Directory.deserializeBinaryFromReader); msg.setDirectory(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setFileContent(value); break; default: reader.skipField();