diff --git a/package.json b/package.json index 46873c5f2..188046d21 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "scrypt": "github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb", "singularitynet-platform-contracts": "1.0.1", "slick-carousel": "^1.8.1", - "snet-sdk-web": "2.0.0-beta.0", + "snet-sdk-web": "3.0.0", "style-loader": "^2.0.0", "utf8": "^3.0.0", "validate.js": "^0.13.1", diff --git a/src/assets/thirdPartyServices/snet/example_service/example_service_pb.js b/src/assets/thirdPartyServices/snet/example_service/example_service_pb.js index af3c66b99..d06a75ff5 100644 --- a/src/assets/thirdPartyServices/snet/example_service/example_service_pb.js +++ b/src/assets/thirdPartyServices/snet/example_service/example_service_pb.js @@ -12,8 +12,15 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); -goog.exportSymbol('proto.example_service.Numbers', null, global); -goog.exportSymbol('proto.example_service.Result', null, global); +var singnet_snet$daemon_training_training_pb = require('./training_pb.js'); +var singnet_snet$daemon_pricing_pricing_pb = require('./pricing_pb.js'); +goog.exportSymbol('example_service.AddressList', null, global); +goog.exportSymbol('example_service.ModelId', null, global); +goog.exportSymbol('example_service.Numbers', null, global); +goog.exportSymbol('example_service.Result', null, global); +goog.exportSymbol('example_service.TrainingRequest', null, global); +goog.exportSymbol('example_service.TrainingResponse', null, global); + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -24,17 +31,186 @@ goog.exportSymbol('proto.example_service.Result', null, global); * @extends {jspb.Message} * @constructor */ -proto.example_service.Numbers = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +example_service.AddressList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, example_service.AddressList.repeatedFields_, null); }; -goog.inherits(proto.example_service.Numbers, jspb.Message); +goog.inherits(example_service.AddressList, jspb.Message); if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.example_service.Numbers.displayName = 'proto.example_service.Numbers'; + example_service.AddressList.displayName = 'example_service.AddressList'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +example_service.AddressList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +example_service.AddressList.prototype.toObject = function(opt_includeInstance) { + return example_service.AddressList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!example_service.AddressList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.AddressList.toObject = function(includeInstance, msg) { + var f, obj = { + addressList: jspb.Message.getRepeatedField(msg, 1), + modelDetails: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; } + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!example_service.AddressList} + */ +example_service.AddressList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new example_service.AddressList; + return example_service.AddressList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!example_service.AddressList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!example_service.AddressList} + */ +example_service.AddressList.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.addAddress(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setModelDetails(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +example_service.AddressList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + example_service.AddressList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!example_service.AddressList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.AddressList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddressList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getModelDetails(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * repeated string address = 1; + * @return {!Array} + */ +example_service.AddressList.prototype.getAddressList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +example_service.AddressList.prototype.setAddressList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +example_service.AddressList.prototype.addAddress = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +example_service.AddressList.prototype.clearAddressList = function() { + this.setAddressList([]); +}; + + +/** + * optional string model_details = 2; + * @return {string} + */ +example_service.AddressList.prototype.getModelDetails = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +example_service.AddressList.prototype.setModelDetails = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -45,51 +221,45 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.example_service.Result = function(opt_data) { +example_service.Numbers = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.example_service.Result, jspb.Message); +goog.inherits(example_service.Numbers, jspb.Message); if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.example_service.Result.displayName = 'proto.example_service.Result'; + example_service.Numbers.displayName = 'example_service.Numbers'; } - if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. + * Creates an object representation of this proto suitable for use in Soy templates. * 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_, 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 + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.example_service.Numbers.prototype.toObject = function(opt_includeInstance) { - return proto.example_service.Numbers.toObject(opt_includeInstance, this); +example_service.Numbers.prototype.toObject = function(opt_includeInstance) { + return example_service.Numbers.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: + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.example_service.Numbers} msg The msg instance to transform. + * @param {!example_service.Numbers} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.example_service.Numbers.toObject = function(includeInstance, msg) { +example_service.Numbers.toObject = function(includeInstance, msg) { var f, obj = { - a: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), - b: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0) + a: +jspb.Message.getFieldWithDefault(msg, 1, 0.0), + b: +jspb.Message.getFieldWithDefault(msg, 2, 0.0), + modelId: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { @@ -103,23 +273,23 @@ proto.example_service.Numbers.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.example_service.Numbers} + * @return {!example_service.Numbers} */ -proto.example_service.Numbers.deserializeBinary = function(bytes) { +example_service.Numbers.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.example_service.Numbers; - return proto.example_service.Numbers.deserializeBinaryFromReader(msg, reader); + var msg = new example_service.Numbers; + return example_service.Numbers.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.example_service.Numbers} msg The message object to deserialize into. + * @param {!example_service.Numbers} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.example_service.Numbers} + * @return {!example_service.Numbers} */ -proto.example_service.Numbers.deserializeBinaryFromReader = function(msg, reader) { +example_service.Numbers.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -134,6 +304,10 @@ proto.example_service.Numbers.deserializeBinaryFromReader = function(msg, reader var value = /** @type {number} */ (reader.readFloat()); msg.setB(value); break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setModelId(value); + break; default: reader.skipField(); break; @@ -147,9 +321,9 @@ proto.example_service.Numbers.deserializeBinaryFromReader = function(msg, reader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.example_service.Numbers.prototype.serializeBinary = function() { +example_service.Numbers.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.example_service.Numbers.serializeBinaryToWriter(this, writer); + example_service.Numbers.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -157,11 +331,11 @@ proto.example_service.Numbers.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.example_service.Numbers} message + * @param {!example_service.Numbers} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.example_service.Numbers.serializeBinaryToWriter = function(message, writer) { +example_service.Numbers.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getA(); if (f !== 0.0) { @@ -177,6 +351,13 @@ proto.example_service.Numbers.serializeBinaryToWriter = function(message, writer f ); } + f = message.getModelId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } }; @@ -184,13 +365,13 @@ proto.example_service.Numbers.serializeBinaryToWriter = function(message, writer * optional float a = 1; * @return {number} */ -proto.example_service.Numbers.prototype.getA = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +example_service.Numbers.prototype.getA = function() { + return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 1, 0.0)); }; /** @param {number} value */ -proto.example_service.Numbers.prototype.setA = function(value) { +example_service.Numbers.prototype.setA = function(value) { jspb.Message.setProto3FloatField(this, 1, value); }; @@ -199,50 +380,80 @@ proto.example_service.Numbers.prototype.setA = function(value) { * optional float b = 2; * @return {number} */ -proto.example_service.Numbers.prototype.getB = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +example_service.Numbers.prototype.getB = function() { + return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 2, 0.0)); }; /** @param {number} value */ -proto.example_service.Numbers.prototype.setB = function(value) { +example_service.Numbers.prototype.setB = function(value) { jspb.Message.setProto3FloatField(this, 2, value); }; +/** + * optional string model_id = 3; + * @return {string} + */ +example_service.Numbers.prototype.getModelId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +example_service.Numbers.prototype.setModelId = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * 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 + */ +example_service.Result = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(example_service.Result, jspb.Message); +if (goog.DEBUG && !COMPILED) { + example_service.Result.displayName = 'example_service.Result'; +} if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. + * Creates an object representation of this proto suitable for use in Soy templates. * 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_, 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 + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ -proto.example_service.Result.prototype.toObject = function(opt_includeInstance) { - return proto.example_service.Result.toObject(opt_includeInstance, this); +example_service.Result.prototype.toObject = function(opt_includeInstance) { + return example_service.Result.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: + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.example_service.Result} msg The msg instance to transform. + * @param {!example_service.Result} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.example_service.Result.toObject = function(includeInstance, msg) { +example_service.Result.toObject = function(includeInstance, msg) { var f, obj = { - value: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0) + value: +jspb.Message.getFieldWithDefault(msg, 1, 0.0) }; if (includeInstance) { @@ -256,23 +467,23 @@ proto.example_service.Result.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.example_service.Result} + * @return {!example_service.Result} */ -proto.example_service.Result.deserializeBinary = function(bytes) { +example_service.Result.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.example_service.Result; - return proto.example_service.Result.deserializeBinaryFromReader(msg, reader); + var msg = new example_service.Result; + return example_service.Result.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.example_service.Result} msg The message object to deserialize into. + * @param {!example_service.Result} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.example_service.Result} + * @return {!example_service.Result} */ -proto.example_service.Result.deserializeBinaryFromReader = function(msg, reader) { +example_service.Result.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -296,9 +507,9 @@ proto.example_service.Result.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.example_service.Result.prototype.serializeBinary = function() { +example_service.Result.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.example_service.Result.serializeBinaryToWriter(this, writer); + example_service.Result.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -306,11 +517,11 @@ proto.example_service.Result.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.example_service.Result} message + * @param {!example_service.Result} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.example_service.Result.serializeBinaryToWriter = function(message, writer) { +example_service.Result.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getValue(); if (f !== 0.0) { @@ -326,15 +537,603 @@ proto.example_service.Result.serializeBinaryToWriter = function(message, writer) * optional float value = 1; * @return {number} */ -proto.example_service.Result.prototype.getValue = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +example_service.Result.prototype.getValue = function() { + return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 1, 0.0)); }; /** @param {number} value */ -proto.example_service.Result.prototype.setValue = function(value) { +example_service.Result.prototype.setValue = function(value) { jspb.Message.setProto3FloatField(this, 1, value); }; -goog.object.extend(exports, proto.example_service); + +/** + * 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 + */ +example_service.ModelId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(example_service.ModelId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + example_service.ModelId.displayName = 'example_service.ModelId'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +example_service.ModelId.prototype.toObject = function(opt_includeInstance) { + return example_service.ModelId.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!example_service.ModelId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.ModelId.toObject = function(includeInstance, msg) { + var f, obj = { + modelId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!example_service.ModelId} + */ +example_service.ModelId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new example_service.ModelId; + return example_service.ModelId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!example_service.ModelId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!example_service.ModelId} + */ +example_service.ModelId.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.setModelId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +example_service.ModelId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + example_service.ModelId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!example_service.ModelId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.ModelId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getModelId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string model_id = 1; + * @return {string} + */ +example_service.ModelId.prototype.getModelId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +example_service.ModelId.prototype.setModelId = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * 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 + */ +example_service.TrainingRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(example_service.TrainingRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + example_service.TrainingRequest.displayName = 'example_service.TrainingRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +example_service.TrainingRequest.prototype.toObject = function(opt_includeInstance) { + return example_service.TrainingRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!example_service.TrainingRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.TrainingRequest.toObject = function(includeInstance, msg) { + var f, obj = { + link: jspb.Message.getFieldWithDefault(msg, 1, ""), + address: jspb.Message.getFieldWithDefault(msg, 2, ""), + modelId: jspb.Message.getFieldWithDefault(msg, 3, ""), + requestId: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!example_service.TrainingRequest} + */ +example_service.TrainingRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new example_service.TrainingRequest; + return example_service.TrainingRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!example_service.TrainingRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!example_service.TrainingRequest} + */ +example_service.TrainingRequest.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.setLink(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setAddress(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setModelId(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +example_service.TrainingRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + example_service.TrainingRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!example_service.TrainingRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.TrainingRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLink(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAddress(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getModelId(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string link = 1; + * @return {string} + */ +example_service.TrainingRequest.prototype.getLink = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +example_service.TrainingRequest.prototype.setLink = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string address = 2; + * @return {string} + */ +example_service.TrainingRequest.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +example_service.TrainingRequest.prototype.setAddress = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string model_id = 3; + * @return {string} + */ +example_service.TrainingRequest.prototype.getModelId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +example_service.TrainingRequest.prototype.setModelId = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string request_id = 4; + * @return {string} + */ +example_service.TrainingRequest.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +example_service.TrainingRequest.prototype.setRequestId = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + + +/** + * 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 + */ +example_service.TrainingResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(example_service.TrainingResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + example_service.TrainingResponse.displayName = 'example_service.TrainingResponse'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +example_service.TrainingResponse.prototype.toObject = function(opt_includeInstance) { + return example_service.TrainingResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!example_service.TrainingResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.TrainingResponse.toObject = function(includeInstance, msg) { + var f, obj = { + link: jspb.Message.getFieldWithDefault(msg, 1, ""), + modelId: jspb.Message.getFieldWithDefault(msg, 2, ""), + status: jspb.Message.getFieldWithDefault(msg, 3, ""), + requestId: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!example_service.TrainingResponse} + */ +example_service.TrainingResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new example_service.TrainingResponse; + return example_service.TrainingResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!example_service.TrainingResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!example_service.TrainingResponse} + */ +example_service.TrainingResponse.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.setLink(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setModelId(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setStatus(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setRequestId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +example_service.TrainingResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + example_service.TrainingResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!example_service.TrainingResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +example_service.TrainingResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLink(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getModelId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getStatus(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getRequestId(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional string link = 1; + * @return {string} + */ +example_service.TrainingResponse.prototype.getLink = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +example_service.TrainingResponse.prototype.setLink = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string model_id = 2; + * @return {string} + */ +example_service.TrainingResponse.prototype.getModelId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +example_service.TrainingResponse.prototype.setModelId = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string status = 3; + * @return {string} + */ +example_service.TrainingResponse.prototype.getStatus = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +example_service.TrainingResponse.prototype.setStatus = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string request_id = 4; + * @return {string} + */ +example_service.TrainingResponse.prototype.getRequestId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +example_service.TrainingResponse.prototype.setRequestId = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +goog.object.extend(exports, example_service); diff --git a/src/assets/thirdPartyServices/snet/example_service/example_service_pb_service.js b/src/assets/thirdPartyServices/snet/example_service/example_service_pb_service.js index 2c53b0a39..7b705f987 100644 --- a/src/assets/thirdPartyServices/snet/example_service/example_service_pb_service.js +++ b/src/assets/thirdPartyServices/snet/example_service/example_service_pb_service.js @@ -1,7 +1,9 @@ // package: example_service -// file: example_service.proto +// file: singnet/example-service/service/service_spec/example_service.proto +/* eslint-disable */ -var example_service_pb = require("./example_service_pb"); +var singnet_example_service_service_service_spec_example_service_pb = require("./example_service_pb"); +var singnet_snet_daemon_pricing_pricing_pb = require("./pricing_pb"); var grpc = require("@improbable-eng/grpc-web").grpc; var Calculator = (function () { @@ -10,13 +12,49 @@ var Calculator = (function () { return Calculator; }()); +Calculator.train_add = { + methodName: "train_add", + service: Calculator, + requestStream: false, + responseStream: false, + requestType: singnet_example_service_service_service_spec_example_service_pb.TrainingRequest, + responseType: singnet_example_service_service_service_spec_example_service_pb.TrainingResponse +}; + +Calculator.train_subtraction = { + methodName: "train_subtraction", + service: Calculator, + requestStream: false, + responseStream: false, + requestType: singnet_example_service_service_service_spec_example_service_pb.TrainingRequest, + responseType: singnet_example_service_service_service_spec_example_service_pb.TrainingResponse +}; + +Calculator.dynamic_pricing_train_add = { + methodName: "dynamic_pricing_train_add", + service: Calculator, + requestStream: false, + responseStream: false, + requestType: singnet_example_service_service_service_spec_example_service_pb.TrainingRequest, + responseType: singnet_snet_daemon_pricing_pricing_pb.PriceInCogs +}; + +Calculator.dynamic_pricing_add = { + methodName: "dynamic_pricing_add", + service: Calculator, + requestStream: false, + responseStream: false, + requestType: singnet_example_service_service_service_spec_example_service_pb.Numbers, + responseType: singnet_snet_daemon_pricing_pricing_pb.PriceInCogs +}; + Calculator.add = { methodName: "add", service: Calculator, requestStream: false, responseStream: false, - requestType: example_service_pb.Numbers, - responseType: example_service_pb.Result + requestType: singnet_example_service_service_service_spec_example_service_pb.Numbers, + responseType: singnet_example_service_service_service_spec_example_service_pb.Result }; Calculator.sub = { @@ -24,8 +62,8 @@ Calculator.sub = { service: Calculator, requestStream: false, responseStream: false, - requestType: example_service_pb.Numbers, - responseType: example_service_pb.Result + requestType: singnet_example_service_service_service_spec_example_service_pb.Numbers, + responseType: singnet_example_service_service_service_spec_example_service_pb.Result }; Calculator.mul = { @@ -33,8 +71,8 @@ Calculator.mul = { service: Calculator, requestStream: false, responseStream: false, - requestType: example_service_pb.Numbers, - responseType: example_service_pb.Result + requestType: singnet_example_service_service_service_spec_example_service_pb.Numbers, + responseType: singnet_example_service_service_service_spec_example_service_pb.Result }; Calculator.div = { @@ -42,8 +80,8 @@ Calculator.div = { service: Calculator, requestStream: false, responseStream: false, - requestType: example_service_pb.Numbers, - responseType: example_service_pb.Result + requestType: singnet_example_service_service_service_spec_example_service_pb.Numbers, + responseType: singnet_example_service_service_service_spec_example_service_pb.Result }; exports.Calculator = Calculator; @@ -53,6 +91,130 @@ function CalculatorClient(serviceHost, options) { this.options = options || {}; } +CalculatorClient.prototype.train_add = function train_add(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Calculator.train_add, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +CalculatorClient.prototype.train_subtraction = function train_subtraction(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Calculator.train_subtraction, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +CalculatorClient.prototype.dynamic_pricing_train_add = function dynamic_pricing_train_add(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Calculator.dynamic_pricing_train_add, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +CalculatorClient.prototype.dynamic_pricing_add = function dynamic_pricing_add(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Calculator.dynamic_pricing_add, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + CalculatorClient.prototype.add = function add(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; @@ -60,10 +222,10 @@ CalculatorClient.prototype.add = function add(requestMessage, metadata, callback var client = grpc.unary(Calculator.add, { request: requestMessage, host: this.serviceHost, - metadata: metadata, + metadata, transport: this.options.transport, debug: this.options.debug, - onEnd: function (response) { + onEnd (response) { if (callback) { if (response.status !== grpc.Code.OK) { var err = new Error(response.statusMessage); @@ -77,7 +239,7 @@ CalculatorClient.prototype.add = function add(requestMessage, metadata, callback } }); return { - cancel: function () { + cancel () { callback = null; client.close(); } @@ -91,10 +253,10 @@ CalculatorClient.prototype.sub = function sub(requestMessage, metadata, callback var client = grpc.unary(Calculator.sub, { request: requestMessage, host: this.serviceHost, - metadata: metadata, + metadata, transport: this.options.transport, debug: this.options.debug, - onEnd: function (response) { + onEnd (response) { if (callback) { if (response.status !== grpc.Code.OK) { var err = new Error(response.statusMessage); @@ -108,7 +270,7 @@ CalculatorClient.prototype.sub = function sub(requestMessage, metadata, callback } }); return { - cancel: function () { + cancel () { callback = null; client.close(); } @@ -122,10 +284,10 @@ CalculatorClient.prototype.mul = function mul(requestMessage, metadata, callback var client = grpc.unary(Calculator.mul, { request: requestMessage, host: this.serviceHost, - metadata: metadata, + metadata, transport: this.options.transport, debug: this.options.debug, - onEnd: function (response) { + onEnd (response) { if (callback) { if (response.status !== grpc.Code.OK) { var err = new Error(response.statusMessage); @@ -139,7 +301,7 @@ CalculatorClient.prototype.mul = function mul(requestMessage, metadata, callback } }); return { - cancel: function () { + cancel () { callback = null; client.close(); } @@ -153,10 +315,10 @@ CalculatorClient.prototype.div = function div(requestMessage, metadata, callback var client = grpc.unary(Calculator.div, { request: requestMessage, host: this.serviceHost, - metadata: metadata, + metadata, transport: this.options.transport, debug: this.options.debug, - onEnd: function (response) { + onEnd (response) { if (callback) { if (response.status !== grpc.Code.OK) { var err = new Error(response.statusMessage); @@ -170,7 +332,7 @@ CalculatorClient.prototype.div = function div(requestMessage, metadata, callback } }); return { - cancel: function () { + cancel () { callback = null; client.close(); } diff --git a/src/assets/thirdPartyServices/snet/example_service/pricing_pb.js b/src/assets/thirdPartyServices/snet/example_service/pricing_pb.js new file mode 100644 index 000000000..aaf2226a4 --- /dev/null +++ b/src/assets/thirdPartyServices/snet/example_service/pricing_pb.js @@ -0,0 +1,328 @@ +/** + * @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! +/* eslint-disable */ + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); +goog.exportSymbol('pricing.EstimatePrice', null, global); +goog.exportSymbol('pricing.PriceInCogs', null, global); +goog.exportSymbol('pricing.myMethodOption', 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 + */ +pricing.EstimatePrice = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(pricing.EstimatePrice, jspb.Message); +if (goog.DEBUG && !COMPILED) { + pricing.EstimatePrice.displayName = 'pricing.EstimatePrice'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +pricing.EstimatePrice.prototype.toObject = function(opt_includeInstance) { + return pricing.EstimatePrice.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!pricing.EstimatePrice} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +pricing.EstimatePrice.toObject = function(includeInstance, msg) { + var f, obj = { + estimatepricemethod: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!pricing.EstimatePrice} + */ +pricing.EstimatePrice.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new pricing.EstimatePrice; + return pricing.EstimatePrice.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!pricing.EstimatePrice} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!pricing.EstimatePrice} + */ +pricing.EstimatePrice.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.setEstimatepricemethod(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +pricing.EstimatePrice.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + pricing.EstimatePrice.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!pricing.EstimatePrice} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +pricing.EstimatePrice.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getEstimatepricemethod(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string estimatePriceMethod = 1; + * @return {string} + */ +pricing.EstimatePrice.prototype.getEstimatepricemethod = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +pricing.EstimatePrice.prototype.setEstimatepricemethod = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * 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 + */ +pricing.PriceInCogs = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(pricing.PriceInCogs, jspb.Message); +if (goog.DEBUG && !COMPILED) { + pricing.PriceInCogs.displayName = 'pricing.PriceInCogs'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +pricing.PriceInCogs.prototype.toObject = function(opt_includeInstance) { + return pricing.PriceInCogs.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!pricing.PriceInCogs} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +pricing.PriceInCogs.toObject = function(includeInstance, msg) { + var f, obj = { + price: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!pricing.PriceInCogs} + */ +pricing.PriceInCogs.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new pricing.PriceInCogs; + return pricing.PriceInCogs.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!pricing.PriceInCogs} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!pricing.PriceInCogs} + */ +pricing.PriceInCogs.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setPrice(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +pricing.PriceInCogs.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + pricing.PriceInCogs.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!pricing.PriceInCogs} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +pricing.PriceInCogs.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPrice(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } +}; + + +/** + * optional uint64 price = 1; + * @return {number} + */ +pricing.PriceInCogs.prototype.getPrice = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +pricing.PriceInCogs.prototype.setPrice = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `myMethodOption`. + * @type {!jspb.ExtensionFieldInfo} + */ +pricing.myMethodOption = new jspb.ExtensionFieldInfo( + 9999127, + {myMethodOption: 0}, + pricing.EstimatePrice, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + pricing.EstimatePrice.toObject), + 0); + +google_protobuf_descriptor_pb.MethodOptions.extensionsBinary[9999127] = new jspb.ExtensionFieldBinaryInfo( + pricing.myMethodOption, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + pricing.EstimatePrice.serializeBinaryToWriter, + pricing.EstimatePrice.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +google_protobuf_descriptor_pb.MethodOptions.extensions[9999127] = pricing.myMethodOption; + +goog.object.extend(exports, pricing); diff --git a/src/assets/thirdPartyServices/snet/example_service/pricing_pb_service.js b/src/assets/thirdPartyServices/snet/example_service/pricing_pb_service.js new file mode 100644 index 000000000..b99d01904 --- /dev/null +++ b/src/assets/thirdPartyServices/snet/example_service/pricing_pb_service.js @@ -0,0 +1,3 @@ +// package: pricing +// file: singnet/snet-daemon/pricing/pricing.proto + diff --git a/src/assets/thirdPartyServices/snet/example_service/training_pb.js b/src/assets/thirdPartyServices/snet/example_service/training_pb.js new file mode 100644 index 000000000..f780d05cb --- /dev/null +++ b/src/assets/thirdPartyServices/snet/example_service/training_pb.js @@ -0,0 +1,2117 @@ +/** + * @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! +/* eslint-disable */ + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); +goog.exportSymbol('training.AccessibleModelsRequest', null, global); +goog.exportSymbol('training.AccessibleModelsResponse', null, global); +goog.exportSymbol('training.AuthorizationDetails', null, global); +goog.exportSymbol('training.CreateModelRequest', null, global); +goog.exportSymbol('training.ModelDetails', null, global); +goog.exportSymbol('training.ModelDetailsRequest', null, global); +goog.exportSymbol('training.ModelDetailsResponse', null, global); +goog.exportSymbol('training.Status', null, global); +goog.exportSymbol('training.TrainingMethodOption', null, global); +goog.exportSymbol('training.UpdateModelRequest', null, global); +goog.exportSymbol('training.myMethodOption', 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 + */ +training.ModelDetails = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, training.ModelDetails.repeatedFields_, null); +}; +goog.inherits(training.ModelDetails, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.ModelDetails.displayName = 'training.ModelDetails'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +training.ModelDetails.repeatedFields_ = [8]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.ModelDetails.prototype.toObject = function(opt_includeInstance) { + return training.ModelDetails.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.ModelDetails} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.ModelDetails.toObject = function(includeInstance, msg) { + var f, obj = { + modelId: jspb.Message.getFieldWithDefault(msg, 1, ""), + grpcMethodName: jspb.Message.getFieldWithDefault(msg, 2, ""), + grpcServiceName: jspb.Message.getFieldWithDefault(msg, 3, ""), + description: jspb.Message.getFieldWithDefault(msg, 4, ""), + status: jspb.Message.getFieldWithDefault(msg, 6, ""), + updatedDate: jspb.Message.getFieldWithDefault(msg, 7, ""), + addressListList: jspb.Message.getRepeatedField(msg, 8), + trainingDataLink: jspb.Message.getFieldWithDefault(msg, 9, ""), + modelName: jspb.Message.getFieldWithDefault(msg, 10, ""), + organizationId: jspb.Message.getFieldWithDefault(msg, 11, ""), + serviceId: jspb.Message.getFieldWithDefault(msg, 12, ""), + groupId: jspb.Message.getFieldWithDefault(msg, 13, ""), + isPubliclyAccessible: jspb.Message.getFieldWithDefault(msg, 14, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!training.ModelDetails} + */ +training.ModelDetails.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.ModelDetails; + return training.ModelDetails.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.ModelDetails} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.ModelDetails} + */ +training.ModelDetails.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.setModelId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setGrpcMethodName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setGrpcServiceName(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setStatus(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setUpdatedDate(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.addAddressList(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setTrainingDataLink(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setModelName(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setOrganizationId(value); + break; + case 12: + var value = /** @type {string} */ (reader.readString()); + msg.setServiceId(value); + break; + case 13: + var value = /** @type {string} */ (reader.readString()); + msg.setGroupId(value); + break; + case 14: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsPubliclyAccessible(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.ModelDetails.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.ModelDetails.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.ModelDetails} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.ModelDetails.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getModelId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getGrpcMethodName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getGrpcServiceName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getStatus(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getUpdatedDate(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getAddressListList(); + if (f.length > 0) { + writer.writeRepeatedString( + 8, + f + ); + } + f = message.getTrainingDataLink(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getModelName(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getOrganizationId(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } + f = message.getServiceId(); + if (f.length > 0) { + writer.writeString( + 12, + f + ); + } + f = message.getGroupId(); + if (f.length > 0) { + writer.writeString( + 13, + f + ); + } + f = message.getIsPubliclyAccessible(); + if (f) { + writer.writeBool( + 14, + f + ); + } +}; + + +/** + * optional string model_id = 1; + * @return {string} + */ +training.ModelDetails.prototype.getModelId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setModelId = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string grpc_method_name = 2; + * @return {string} + */ +training.ModelDetails.prototype.getGrpcMethodName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setGrpcMethodName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string grpc_service_name = 3; + * @return {string} + */ +training.ModelDetails.prototype.getGrpcServiceName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setGrpcServiceName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string description = 4; + * @return {string} + */ +training.ModelDetails.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string status = 6; + * @return {string} + */ +training.ModelDetails.prototype.getStatus = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setStatus = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string updated_date = 7; + * @return {string} + */ +training.ModelDetails.prototype.getUpdatedDate = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setUpdatedDate = function(value) { + jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * repeated string address_list = 8; + * @return {!Array} + */ +training.ModelDetails.prototype.getAddressListList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 8)); +}; + + +/** @param {!Array} value */ +training.ModelDetails.prototype.setAddressListList = function(value) { + jspb.Message.setField(this, 8, value || []); +}; + + +/** + * @param {!string} value + * @param {number=} opt_index + */ +training.ModelDetails.prototype.addAddressList = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 8, value, opt_index); +}; + + +training.ModelDetails.prototype.clearAddressListList = function() { + this.setAddressListList([]); +}; + + +/** + * optional string training_data_link = 9; + * @return {string} + */ +training.ModelDetails.prototype.getTrainingDataLink = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setTrainingDataLink = function(value) { + jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string model_name = 10; + * @return {string} + */ +training.ModelDetails.prototype.getModelName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setModelName = function(value) { + jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string organization_id = 11; + * @return {string} + */ +training.ModelDetails.prototype.getOrganizationId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setOrganizationId = function(value) { + jspb.Message.setProto3StringField(this, 11, value); +}; + + +/** + * optional string service_id = 12; + * @return {string} + */ +training.ModelDetails.prototype.getServiceId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setServiceId = function(value) { + jspb.Message.setProto3StringField(this, 12, value); +}; + + +/** + * optional string group_id = 13; + * @return {string} + */ +training.ModelDetails.prototype.getGroupId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); +}; + + +/** @param {string} value */ +training.ModelDetails.prototype.setGroupId = function(value) { + jspb.Message.setProto3StringField(this, 13, value); +}; + + +/** + * optional bool is_publicly_accessible = 14; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +training.ModelDetails.prototype.getIsPubliclyAccessible = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 14, false)); +}; + + +/** @param {boolean} value */ +training.ModelDetails.prototype.setIsPubliclyAccessible = function(value) { + jspb.Message.setProto3BooleanField(this, 14, value); +}; + + + +/** + * 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 + */ +training.AuthorizationDetails = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.AuthorizationDetails, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.AuthorizationDetails.displayName = 'training.AuthorizationDetails'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.AuthorizationDetails.prototype.toObject = function(opt_includeInstance) { + return training.AuthorizationDetails.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.AuthorizationDetails} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.AuthorizationDetails.toObject = function(includeInstance, msg) { + var f, obj = { + currentBlock: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: jspb.Message.getFieldWithDefault(msg, 2, ""), + signature: msg.getSignature_asB64(), + signerAddress: jspb.Message.getFieldWithDefault(msg, 4, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!training.AuthorizationDetails} + */ +training.AuthorizationDetails.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.AuthorizationDetails; + return training.AuthorizationDetails.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.AuthorizationDetails} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.AuthorizationDetails} + */ +training.AuthorizationDetails.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setCurrentBlock(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setSignerAddress(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.AuthorizationDetails.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.AuthorizationDetails.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.AuthorizationDetails} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.AuthorizationDetails.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCurrentBlock(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getSignerAddress(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } +}; + + +/** + * optional uint64 current_block = 1; + * @return {number} + */ +training.AuthorizationDetails.prototype.getCurrentBlock = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +training.AuthorizationDetails.prototype.setCurrentBlock = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +training.AuthorizationDetails.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +training.AuthorizationDetails.prototype.setMessage = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes signature = 3; + * @return {!(string|Uint8Array)} + */ +training.AuthorizationDetails.prototype.getSignature = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes signature = 3; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +training.AuthorizationDetails.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +training.AuthorizationDetails.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** @param {!(string|Uint8Array)} value */ +training.AuthorizationDetails.prototype.setSignature = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional string signer_address = 4; + * @return {string} + */ +training.AuthorizationDetails.prototype.getSignerAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +training.AuthorizationDetails.prototype.setSignerAddress = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + + +/** + * 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 + */ +training.CreateModelRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.CreateModelRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.CreateModelRequest.displayName = 'training.CreateModelRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.CreateModelRequest.prototype.toObject = function(opt_includeInstance) { + return training.CreateModelRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.CreateModelRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.CreateModelRequest.toObject = function(includeInstance, msg) { + var f, obj = { + authorization: (f = msg.getAuthorization()) && training.AuthorizationDetails.toObject(includeInstance, f), + modelDetails: (f = msg.getModelDetails()) && training.ModelDetails.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 {!training.CreateModelRequest} + */ +training.CreateModelRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.CreateModelRequest; + return training.CreateModelRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.CreateModelRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.CreateModelRequest} + */ +training.CreateModelRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new training.AuthorizationDetails; + reader.readMessage(value,training.AuthorizationDetails.deserializeBinaryFromReader); + msg.setAuthorization(value); + break; + case 2: + var value = new training.ModelDetails; + reader.readMessage(value,training.ModelDetails.deserializeBinaryFromReader); + msg.setModelDetails(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.CreateModelRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.CreateModelRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.CreateModelRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.CreateModelRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAuthorization(); + if (f != null) { + writer.writeMessage( + 1, + f, + training.AuthorizationDetails.serializeBinaryToWriter + ); + } + f = message.getModelDetails(); + if (f != null) { + writer.writeMessage( + 2, + f, + training.ModelDetails.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AuthorizationDetails authorization = 1; + * @return {?training.AuthorizationDetails} + */ +training.CreateModelRequest.prototype.getAuthorization = function() { + return /** @type{?training.AuthorizationDetails} */ ( + jspb.Message.getWrapperField(this, training.AuthorizationDetails, 1)); +}; + + +/** @param {?training.AuthorizationDetails|undefined} value */ +training.CreateModelRequest.prototype.setAuthorization = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +training.CreateModelRequest.prototype.clearAuthorization = function() { + this.setAuthorization(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.CreateModelRequest.prototype.hasAuthorization = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ModelDetails model_details = 2; + * @return {?training.ModelDetails} + */ +training.CreateModelRequest.prototype.getModelDetails = function() { + return /** @type{?training.ModelDetails} */ ( + jspb.Message.getWrapperField(this, training.ModelDetails, 2)); +}; + + +/** @param {?training.ModelDetails|undefined} value */ +training.CreateModelRequest.prototype.setModelDetails = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +training.CreateModelRequest.prototype.clearModelDetails = function() { + this.setModelDetails(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.CreateModelRequest.prototype.hasModelDetails = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * 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 + */ +training.AccessibleModelsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.AccessibleModelsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.AccessibleModelsRequest.displayName = 'training.AccessibleModelsRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.AccessibleModelsRequest.prototype.toObject = function(opt_includeInstance) { + return training.AccessibleModelsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.AccessibleModelsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.AccessibleModelsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + grpcMethodName: jspb.Message.getFieldWithDefault(msg, 1, ""), + grpcServiceName: jspb.Message.getFieldWithDefault(msg, 2, ""), + authorization: (f = msg.getAuthorization()) && training.AuthorizationDetails.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 {!training.AccessibleModelsRequest} + */ +training.AccessibleModelsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.AccessibleModelsRequest; + return training.AccessibleModelsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.AccessibleModelsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.AccessibleModelsRequest} + */ +training.AccessibleModelsRequest.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.setGrpcMethodName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setGrpcServiceName(value); + break; + case 3: + var value = new training.AuthorizationDetails; + reader.readMessage(value,training.AuthorizationDetails.deserializeBinaryFromReader); + msg.setAuthorization(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.AccessibleModelsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.AccessibleModelsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.AccessibleModelsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.AccessibleModelsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGrpcMethodName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getGrpcServiceName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getAuthorization(); + if (f != null) { + writer.writeMessage( + 3, + f, + training.AuthorizationDetails.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string grpc_method_name = 1; + * @return {string} + */ +training.AccessibleModelsRequest.prototype.getGrpcMethodName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +training.AccessibleModelsRequest.prototype.setGrpcMethodName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string grpc_service_name = 2; + * @return {string} + */ +training.AccessibleModelsRequest.prototype.getGrpcServiceName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +training.AccessibleModelsRequest.prototype.setGrpcServiceName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional AuthorizationDetails authorization = 3; + * @return {?training.AuthorizationDetails} + */ +training.AccessibleModelsRequest.prototype.getAuthorization = function() { + return /** @type{?training.AuthorizationDetails} */ ( + jspb.Message.getWrapperField(this, training.AuthorizationDetails, 3)); +}; + + +/** @param {?training.AuthorizationDetails|undefined} value */ +training.AccessibleModelsRequest.prototype.setAuthorization = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +training.AccessibleModelsRequest.prototype.clearAuthorization = function() { + this.setAuthorization(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.AccessibleModelsRequest.prototype.hasAuthorization = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * 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 + */ +training.AccessibleModelsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, training.AccessibleModelsResponse.repeatedFields_, null); +}; +goog.inherits(training.AccessibleModelsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.AccessibleModelsResponse.displayName = 'training.AccessibleModelsResponse'; +} +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +training.AccessibleModelsResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.AccessibleModelsResponse.prototype.toObject = function(opt_includeInstance) { + return training.AccessibleModelsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.AccessibleModelsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.AccessibleModelsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + listOfModelsList: jspb.Message.toObjectList(msg.getListOfModelsList(), + training.ModelDetails.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 {!training.AccessibleModelsResponse} + */ +training.AccessibleModelsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.AccessibleModelsResponse; + return training.AccessibleModelsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.AccessibleModelsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.AccessibleModelsResponse} + */ +training.AccessibleModelsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new training.ModelDetails; + reader.readMessage(value,training.ModelDetails.deserializeBinaryFromReader); + msg.addListOfModels(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.AccessibleModelsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.AccessibleModelsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.AccessibleModelsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.AccessibleModelsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getListOfModelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + training.ModelDetails.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated ModelDetails list_of_models = 1; + * @return {!Array} + */ +training.AccessibleModelsResponse.prototype.getListOfModelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, training.ModelDetails, 1)); +}; + + +/** @param {!Array} value */ +training.AccessibleModelsResponse.prototype.setListOfModelsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!training.ModelDetails=} opt_value + * @param {number=} opt_index + * @return {!training.ModelDetails} + */ +training.AccessibleModelsResponse.prototype.addListOfModels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, training.ModelDetails, opt_index); +}; + + +training.AccessibleModelsResponse.prototype.clearListOfModelsList = function() { + this.setListOfModelsList([]); +}; + + + +/** + * 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 + */ +training.ModelDetailsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.ModelDetailsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.ModelDetailsRequest.displayName = 'training.ModelDetailsRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.ModelDetailsRequest.prototype.toObject = function(opt_includeInstance) { + return training.ModelDetailsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.ModelDetailsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.ModelDetailsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + modelDetails: (f = msg.getModelDetails()) && training.ModelDetails.toObject(includeInstance, f), + authorization: (f = msg.getAuthorization()) && training.AuthorizationDetails.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 {!training.ModelDetailsRequest} + */ +training.ModelDetailsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.ModelDetailsRequest; + return training.ModelDetailsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.ModelDetailsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.ModelDetailsRequest} + */ +training.ModelDetailsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new training.ModelDetails; + reader.readMessage(value,training.ModelDetails.deserializeBinaryFromReader); + msg.setModelDetails(value); + break; + case 2: + var value = new training.AuthorizationDetails; + reader.readMessage(value,training.AuthorizationDetails.deserializeBinaryFromReader); + msg.setAuthorization(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.ModelDetailsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.ModelDetailsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.ModelDetailsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.ModelDetailsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getModelDetails(); + if (f != null) { + writer.writeMessage( + 1, + f, + training.ModelDetails.serializeBinaryToWriter + ); + } + f = message.getAuthorization(); + if (f != null) { + writer.writeMessage( + 2, + f, + training.AuthorizationDetails.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ModelDetails model_details = 1; + * @return {?training.ModelDetails} + */ +training.ModelDetailsRequest.prototype.getModelDetails = function() { + return /** @type{?training.ModelDetails} */ ( + jspb.Message.getWrapperField(this, training.ModelDetails, 1)); +}; + + +/** @param {?training.ModelDetails|undefined} value */ +training.ModelDetailsRequest.prototype.setModelDetails = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +training.ModelDetailsRequest.prototype.clearModelDetails = function() { + this.setModelDetails(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.ModelDetailsRequest.prototype.hasModelDetails = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional AuthorizationDetails authorization = 2; + * @return {?training.AuthorizationDetails} + */ +training.ModelDetailsRequest.prototype.getAuthorization = function() { + return /** @type{?training.AuthorizationDetails} */ ( + jspb.Message.getWrapperField(this, training.AuthorizationDetails, 2)); +}; + + +/** @param {?training.AuthorizationDetails|undefined} value */ +training.ModelDetailsRequest.prototype.setAuthorization = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +training.ModelDetailsRequest.prototype.clearAuthorization = function() { + this.setAuthorization(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.ModelDetailsRequest.prototype.hasAuthorization = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * 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 + */ +training.TrainingMethodOption = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.TrainingMethodOption, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.TrainingMethodOption.displayName = 'training.TrainingMethodOption'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.TrainingMethodOption.prototype.toObject = function(opt_includeInstance) { + return training.TrainingMethodOption.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.TrainingMethodOption} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.TrainingMethodOption.toObject = function(includeInstance, msg) { + var f, obj = { + trainingmethodindicator: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!training.TrainingMethodOption} + */ +training.TrainingMethodOption.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.TrainingMethodOption; + return training.TrainingMethodOption.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.TrainingMethodOption} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.TrainingMethodOption} + */ +training.TrainingMethodOption.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.setTrainingmethodindicator(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.TrainingMethodOption.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.TrainingMethodOption.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.TrainingMethodOption} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.TrainingMethodOption.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTrainingmethodindicator(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string trainingMethodIndicator = 1; + * @return {string} + */ +training.TrainingMethodOption.prototype.getTrainingmethodindicator = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +training.TrainingMethodOption.prototype.setTrainingmethodindicator = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * 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 + */ +training.UpdateModelRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.UpdateModelRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.UpdateModelRequest.displayName = 'training.UpdateModelRequest'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.UpdateModelRequest.prototype.toObject = function(opt_includeInstance) { + return training.UpdateModelRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.UpdateModelRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.UpdateModelRequest.toObject = function(includeInstance, msg) { + var f, obj = { + updateModelDetails: (f = msg.getUpdateModelDetails()) && training.ModelDetails.toObject(includeInstance, f), + authorization: (f = msg.getAuthorization()) && training.AuthorizationDetails.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 {!training.UpdateModelRequest} + */ +training.UpdateModelRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.UpdateModelRequest; + return training.UpdateModelRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.UpdateModelRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.UpdateModelRequest} + */ +training.UpdateModelRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new training.ModelDetails; + reader.readMessage(value,training.ModelDetails.deserializeBinaryFromReader); + msg.setUpdateModelDetails(value); + break; + case 2: + var value = new training.AuthorizationDetails; + reader.readMessage(value,training.AuthorizationDetails.deserializeBinaryFromReader); + msg.setAuthorization(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.UpdateModelRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.UpdateModelRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.UpdateModelRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.UpdateModelRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUpdateModelDetails(); + if (f != null) { + writer.writeMessage( + 1, + f, + training.ModelDetails.serializeBinaryToWriter + ); + } + f = message.getAuthorization(); + if (f != null) { + writer.writeMessage( + 2, + f, + training.AuthorizationDetails.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ModelDetails update_model_details = 1; + * @return {?training.ModelDetails} + */ +training.UpdateModelRequest.prototype.getUpdateModelDetails = function() { + return /** @type{?training.ModelDetails} */ ( + jspb.Message.getWrapperField(this, training.ModelDetails, 1)); +}; + + +/** @param {?training.ModelDetails|undefined} value */ +training.UpdateModelRequest.prototype.setUpdateModelDetails = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +training.UpdateModelRequest.prototype.clearUpdateModelDetails = function() { + this.setUpdateModelDetails(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.UpdateModelRequest.prototype.hasUpdateModelDetails = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional AuthorizationDetails authorization = 2; + * @return {?training.AuthorizationDetails} + */ +training.UpdateModelRequest.prototype.getAuthorization = function() { + return /** @type{?training.AuthorizationDetails} */ ( + jspb.Message.getWrapperField(this, training.AuthorizationDetails, 2)); +}; + + +/** @param {?training.AuthorizationDetails|undefined} value */ +training.UpdateModelRequest.prototype.setAuthorization = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +training.UpdateModelRequest.prototype.clearAuthorization = function() { + this.setAuthorization(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.UpdateModelRequest.prototype.hasAuthorization = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * 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 + */ +training.ModelDetailsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(training.ModelDetailsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + training.ModelDetailsResponse.displayName = 'training.ModelDetailsResponse'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +training.ModelDetailsResponse.prototype.toObject = function(opt_includeInstance) { + return training.ModelDetailsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!training.ModelDetailsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.ModelDetailsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + status: jspb.Message.getFieldWithDefault(msg, 1, 0), + modelDetails: (f = msg.getModelDetails()) && training.ModelDetails.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 {!training.ModelDetailsResponse} + */ +training.ModelDetailsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new training.ModelDetailsResponse; + return training.ModelDetailsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!training.ModelDetailsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!training.ModelDetailsResponse} + */ +training.ModelDetailsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!training.Status} */ (reader.readEnum()); + msg.setStatus(value); + break; + case 2: + var value = new training.ModelDetails; + reader.readMessage(value,training.ModelDetails.deserializeBinaryFromReader); + msg.setModelDetails(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +training.ModelDetailsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + training.ModelDetailsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!training.ModelDetailsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +training.ModelDetailsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatus(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getModelDetails(); + if (f != null) { + writer.writeMessage( + 2, + f, + training.ModelDetails.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Status status = 1; + * @return {!training.Status} + */ +training.ModelDetailsResponse.prototype.getStatus = function() { + return /** @type {!training.Status} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!training.Status} value */ +training.ModelDetailsResponse.prototype.setStatus = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional ModelDetails model_details = 2; + * @return {?training.ModelDetails} + */ +training.ModelDetailsResponse.prototype.getModelDetails = function() { + return /** @type{?training.ModelDetails} */ ( + jspb.Message.getWrapperField(this, training.ModelDetails, 2)); +}; + + +/** @param {?training.ModelDetails|undefined} value */ +training.ModelDetailsResponse.prototype.setModelDetails = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +training.ModelDetailsResponse.prototype.clearModelDetails = function() { + this.setModelDetails(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {!boolean} + */ +training.ModelDetailsResponse.prototype.hasModelDetails = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * @enum {number} + */ +training.Status = { + CREATED: 0, + IN_PROGRESS: 1, + ERRORED: 2, + COMPLETED: 3, + DELETED: 4 +}; + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `myMethodOption`. + * @type {!jspb.ExtensionFieldInfo} + */ +training.myMethodOption = new jspb.ExtensionFieldInfo( + 9999197, + {myMethodOption: 0}, + training.TrainingMethodOption, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + training.TrainingMethodOption.toObject), + 0); + +google_protobuf_descriptor_pb.MethodOptions.extensionsBinary[9999197] = new jspb.ExtensionFieldBinaryInfo( + training.myMethodOption, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + training.TrainingMethodOption.serializeBinaryToWriter, + training.TrainingMethodOption.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +google_protobuf_descriptor_pb.MethodOptions.extensions[9999197] = training.myMethodOption; + +goog.object.extend(exports, training); diff --git a/src/assets/thirdPartyServices/snet/example_service/training_pb_service.js b/src/assets/thirdPartyServices/snet/example_service/training_pb_service.js new file mode 100644 index 000000000..3b0495857 --- /dev/null +++ b/src/assets/thirdPartyServices/snet/example_service/training_pb_service.js @@ -0,0 +1,222 @@ +// package: training +// file: singnet/snet-daemon/training/training.proto +/* eslint-disable */ + +var singnet_snet_daemon_training_training_pb = require("./training_pb"); +var grpc = require("@improbable-eng/grpc-web").grpc; + +var Model = (function () { + function Model() {} + Model.serviceName = "training.Model"; + return Model; +}()); + +Model.create_model = { + methodName: "create_model", + service: Model, + requestStream: false, + responseStream: false, + requestType: singnet_snet_daemon_training_training_pb.CreateModelRequest, + responseType: singnet_snet_daemon_training_training_pb.ModelDetailsResponse +}; + +Model.delete_model = { + methodName: "delete_model", + service: Model, + requestStream: false, + responseStream: false, + requestType: singnet_snet_daemon_training_training_pb.UpdateModelRequest, + responseType: singnet_snet_daemon_training_training_pb.ModelDetailsResponse +}; + +Model.get_model_status = { + methodName: "get_model_status", + service: Model, + requestStream: false, + responseStream: false, + requestType: singnet_snet_daemon_training_training_pb.ModelDetailsRequest, + responseType: singnet_snet_daemon_training_training_pb.ModelDetailsResponse +}; + +Model.update_model_access = { + methodName: "update_model_access", + service: Model, + requestStream: false, + responseStream: false, + requestType: singnet_snet_daemon_training_training_pb.UpdateModelRequest, + responseType: singnet_snet_daemon_training_training_pb.ModelDetailsResponse +}; + +Model.get_all_models = { + methodName: "get_all_models", + service: Model, + requestStream: false, + responseStream: false, + requestType: singnet_snet_daemon_training_training_pb.AccessibleModelsRequest, + responseType: singnet_snet_daemon_training_training_pb.AccessibleModelsResponse +}; + +exports.Model = Model; + +function ModelClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +ModelClient.prototype.create_model = function create_model(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Model.create_model, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +ModelClient.prototype.delete_model = function delete_model(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Model.delete_model, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +ModelClient.prototype.get_model_status = function get_model_status(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Model.get_model_status, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +ModelClient.prototype.update_model_access = function update_model_access(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Model.update_model_access, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +ModelClient.prototype.get_all_models = function get_all_models(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Model.get_all_models, { + request: requestMessage, + host: this.serviceHost, + metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel () { + callback = null; + client.close(); + } + }; +}; + +exports.ModelClient = ModelClient; + diff --git a/src/components/ServiceDetails/AboutService/index.js b/src/components/ServiceDetails/AboutService/index.js index 2de424edd..8d4e5b719 100644 --- a/src/components/ServiceDetails/AboutService/index.js +++ b/src/components/ServiceDetails/AboutService/index.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React from "react"; import Grid from "@material-ui/core/Grid"; import { withStyles } from "@material-ui/styles"; import { connect } from "react-redux"; @@ -10,9 +10,6 @@ import ProjectDetails from "../ProjectDetails"; import MediaGallery from "../MediaGallery"; import PromoBox from "./PromoBox"; import ExistingModel from "../ExistingModel"; -import { alertTypes } from "../../common/AlertBox"; -import { LoaderContent } from "../../../utility/constants/LoaderContent"; -import { loaderActions, userActions } from "../../../Redux/actionCreators"; const AboutService = ({ classes, @@ -23,11 +20,19 @@ const AboutService = ({ demoExampleRef, scrollToView, demoComponentRequired, - haveANewModel + training, + editModel }) => { const RenderExistingModel = () => { - if (process.env.REACT_APP_TRAINING_ENABLE === "true") { - return ; + if (process.env.REACT_APP_TRAINING_ENABLE === "true" && Object.keys(training).length && isLoggedIn) { + return ( + + ); } return null; }; @@ -75,15 +80,6 @@ const AboutService = ({ const mapStateToProps = state => ({ isLoggedIn: state.userReducer.login.isLoggedIn, - wallet: state.userReducer.wallet, -}); - -const mapDispatchToProps = dispatch => ({ - startMMconnectLoader: () => dispatch(loaderActions.startAppLoader(LoaderContent.CONNECT_METAMASK)), - updateWallet: ({ type, address }) => dispatch(userActions.updateWallet({ type, address })), - registerWallet: (address, type) => dispatch(userActions.registerWallet(address, type)), - fetchAvailableUserWallets: () => dispatch(userActions.fetchAvailableUserWallets()), - stopLoader: () => dispatch(loaderActions.stopAppLoader), }); -export default connect(mapStateToProps, mapDispatchToProps)(withStyles(useStyles)(AboutService)); +export default connect(mapStateToProps)(withStyles(useStyles)(AboutService)); diff --git a/src/components/ServiceDetails/ExistingModel/ModelDetails/index.js b/src/components/ServiceDetails/ExistingModel/ModelDetails/index.js index b63390dc1..df99bb834 100644 --- a/src/components/ServiceDetails/ExistingModel/ModelDetails/index.js +++ b/src/components/ServiceDetails/ExistingModel/ModelDetails/index.js @@ -1,6 +1,5 @@ import React from "react"; import { withStyles } from "@material-ui/styles"; - import { useStyles } from "./styles"; import Button from "@material-ui/core/Button"; import EditIcon from "@material-ui/icons/Edit"; @@ -11,52 +10,54 @@ import Typography from "@material-ui/core/Typography"; import Modal from "@material-ui/core/Modal"; import StyledButton from "../../../common/StyledButton"; -const ModelDetails = ({ classes, title, id, description, status, accessTo, lastUpdate }) => { +const ModelDetails = ({ classes, model, deleteModels, editModel }) => { const [open, setOpen] = React.useState(false); const handleOpenModal = () => setOpen(true); const handleCloseModal = () => setOpen(false); - const handleDeleteModel = () => { - setOpen(false); - } + + const handleDeleteModel = () => { + deleteModels(model); + setOpen(false); + }; + + const handleEditModel = () => { + editModel(model); + }; + return ( <>
-

{title}

+

{model.modelName}

- Model id: {id} + Model id: {model.modelId}

-

{description}

+

{model.description}

- Status: {status} + Status: {model.status}

Access: - {/* { */} - {/* accessTo === 'limited' ? */} - <> - limited(4) -

    -
  • 90986239898
  • -
  • 90986239898
  • -
  • 90986239898
  • -
  • 90986239898
  • -
- - {/* : {accessTo} */} - {/* } */} + <> + {`limited(${model.addressList.length})`} +
    + {model.addressList.map(address => ( +
  • {address}
  • + ))} +
+

-

Last update: {lastUpdate}

+

Last update: {model.updatedDate}

-