diff --git a/README.md b/README.md
index 9ba1c5758..69a6cc11c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# snet-dapp
-This Dapp allows you to browse the list of services from the SingularityNET Registry and call them.
+This Dapp allows you to browse the list of services from the SingularityNET Registry and call them. Once you register and publish the AI service in the publisher portal it reflect in the snet-dapp.
The beta dapp is under active development and will see several changes in the upcoming weeks
## How to call a Service
@@ -88,3 +88,17 @@ For the following [proto file](https://github.com/singnet/example-service/blob/m
npm run sandbox
+
+## Frequently Asked Questions
+
+Q:While creating the js files from proto file protoc-gen-grpc :unknown option:--js_out
+A:Add the protoc-gen-grpc.exe in to the programm files and to the system environment variables
+
+Q:During the creation of js files from the proto --grpc_out: options:mode is required
+A:Add mode --grpc_out=mode=grpcwebtext
+
+Q:For windows machine faced the eslint issues
+A:For temporarly solving this issue, disable the eslint using this command /*eslint-disable */
+
+Q: While publishing the service in to the publisher portal the metamask interaction looks failed with enough Ropsten ETH (It shown Not able to estimate gas)
+
diff --git a/src/assets/thirdPartyServices/index.js b/src/assets/thirdPartyServices/index.js
index 12c8422c1..ee377b0eb 100644
--- a/src/assets/thirdPartyServices/index.js
+++ b/src/assets/thirdPartyServices/index.js
@@ -1,6 +1,8 @@
+import { add } from "lodash";
import React, { lazy } from "react";
import AlertBox from "../../components/common/AlertBox";
+const ClientData = lazy(() => import("./snet/client_data"));
const ExampleService = lazy(() => import("./snet/example_service"));
const CNTKImageRecognition = lazy(() => import("./snet/cntk_image_recon"));
const CNTKNextDayTrend = lazy(() => import("./snet/cntk_next_day_trend"));
@@ -106,6 +108,7 @@ const addNunetCustomUI = (serviceId, CustomUIComponent) => {
thirdPartyCustomUIComponents.addCustomUIComponent("nunet", serviceId, CustomUIComponent);
};
+addSnetCustomUI("client-data", ClientData);
addSnetCustomUI("example-service", ExampleService);
addSnetCustomUI("freecall", ExampleService);
addSnetCustomUI("cntk-image-recon", CNTKImageRecognition);
@@ -192,4 +195,7 @@ thirdPartyCustomUIComponents.addCustomUIComponent("org_id_test_praveen", "test_c
// For testing phase 2 ropsten
thirdPartyCustomUIComponents.addCustomUIComponent("new_contract_test_1", "speed_detector_rt_v2", ExampleService);
+// thirdPartyCustomUIComponents.addCustomUIComponent("org_id", "service_id", ExampleService);
+thirdPartyCustomUIComponents.addCustomUIComponent("snet","test_data_client_data",ClientData);
+
export default thirdPartyCustomUIComponents;
diff --git a/src/assets/thirdPartyServices/snet/client_data/index.js b/src/assets/thirdPartyServices/snet/client_data/index.js
new file mode 100644
index 000000000..51bfd16d3
--- /dev/null
+++ b/src/assets/thirdPartyServices/snet/client_data/index.js
@@ -0,0 +1,191 @@
+/*eslint-disable*/
+import React, { Fragment } from "react";
+import Grid from "@material-ui/core/Grid";
+import Button from "@material-ui/core/Button";
+import { Checkbox,FormControlLabel } from "@material-ui/core";
+import * as grpcWeb from 'grpc-web';
+
+
+import OutlinedTextArea from "../../common/OutlinedTextArea";
+import OutlinedDropDown from "../../common/OutlinedDropdown";
+
+let todos = [
+ { id : '1',title : 'Todo 1',iscompleted : false },
+
+]
+const grpc = {};
+grpc.web = require('grpc-web');
+const methodDescriptor_TodoService_List = require('./todo_grpc_web_pb');
+const methodDescriptor_TodoService_Insert = require('./todo_grpc_web_pb');
+const TodoServiceClient = require('./todo_grpc_web_pb');
+const getTodoList = require('./todo_pb');
+
+// let data = methodDescriptor_TodoService_List.TodoList;
+// let insert = methodDescriptor_TodoService_Insert.Todo;
+let data_data = TodoServiceClient.TodoList;
+let insert_insert = TodoServiceClient.Todo;
+
+
+const initialUserInput = {
+ methodIndex: "0",
+ methodNames: [
+ {
+ label: "ListData",
+ content: "List",
+ value: "0",
+ },
+ {
+ label: "InsertData",
+ content: "insert",
+ value: "1",
+ },
+ ],
+ string_id : 0,
+ string_title : "0",
+ bool_iscompleted : false,
+ };
+
+export default class ClientData extends React.Component{
+ constructor(props){
+ super(props);
+ this.submitAction = this.submitAction.bind(this);
+ this.handleFormUpdate = this.handleFormUpdate.bind(this);
+ this.state = {...initialUserInput};
+ }
+ handleFormUpdate(event){
+ this.setState({
+ [event.target.name]:
+ event.target.value,
+ });
+
+ }
+
+ handleChangeCheckbox = e => this.setState({ bool_iscompleted: e.target.checked });
+
+
+
+ submitAction() {
+ console.log('hai');
+ const { methodIndex, methodNames } = this.state;
+ // const methodDescriptor = TodoServiceClient[methodNames[methodIndex].content];
+ const methodDescriptor = TodoServiceClient[methodNames[methodIndex].content];
+
+ console.log('75');
+ console.log(methodDescriptor);
+ console.log(grpcWeb.MethodType);
+ const request = new methodDescriptor.TodoList();
+
+ console.log('76');
+ // request.string_id('1');
+ // request.string_title('Todo1');
+ // request.bool_iscompleted(false);
+
+ const props = {
+ request,
+ onEnd: ({ message }) => {
+ this.setState({ ...initialUserInput, response: { value: message.getTodoList() } });
+ },
+ };
+ console.log('86');
+ this.props.serviceClient.unary(methodDescriptor, props);
+ }
+ // handleFocus = event => event.target.select();
+
+ renderForm(){
+ return(
+
+
+
+
+
+ {this.state.methodIndex === "1" ?(
+
+
+
+
+
+
+
+
+
+ }
+ label="Bool_iscompleted"
+ />
+
+
+ ) : (<>>)}
+
+
+
+
+
+ );
+ }
+
+ parseResponse() {
+ const { response } = this.state;
+ if (typeof response !== "undefined") {
+ if (typeof response === "string") {
+ return response;
+ }
+ return response.value;
+ }
+ }
+
+ renderComplete() {
+ const response = this.parseResponse();
+ return (
+
+ Response from service: {response}
+
+ );
+ }
+
+ render() {
+ console.log(this.state);
+
+ // return
{this.renderForm()}
;
+
+ if (this.props.isComplete) return {this.renderComplete()}
;
+ else {
+ return {this.renderForm()}
;
+ }
+ }
+
+}
diff --git a/src/assets/thirdPartyServices/snet/client_data/todo_grpc_web_pb.js b/src/assets/thirdPartyServices/snet/client_data/todo_grpc_web_pb.js
new file mode 100644
index 000000000..204126b8e
--- /dev/null
+++ b/src/assets/thirdPartyServices/snet/client_data/todo_grpc_web_pb.js
@@ -0,0 +1,197 @@
+
+/*eslint-disable*/
+/**
+ * @fileoverview gRPC-Web generated client stub for
+ * @enhanceable
+ * @public
+ */
+
+// GENERATED CODE -- DO NOT EDIT!
+
+
+/* eslint-disable */
+// @ts-nocheck
+
+
+
+const grpc = {};
+grpc.web = require('grpc-web');
+
+const proto = require('./todo_pb.js');
+
+/**
+ * @param {string} hostname
+ * @param {?Object} credentials
+ * @param {?grpc.web.ClientOptions} options
+ * @constructor
+ * @struct
+ * @final
+ */
+proto.TodoServiceClient =
+ function(hostname, credentials, options) {
+ if (!options) options = {};
+ options.format = 'text';
+
+ /**
+ * @private @const {!grpc.web.GrpcWebClientBase} The client
+ */
+ this.client_ = new grpc.web.GrpcWebClientBase(options);
+
+ /**
+ * @private @const {string} The hostname
+ */
+ this.hostname_ = hostname;
+
+};
+
+
+/**
+ * @param {string} hostname
+ * @param {?Object} credentials
+ * @param {?grpc.web.ClientOptions} options
+ * @constructor
+ * @struct
+ * @final
+ */
+proto.TodoServicePromiseClient =
+ function(hostname, credentials, options) {
+ if (!options) options = {};
+ options.format = 'text';
+
+ /**
+ * @private @const {!grpc.web.GrpcWebClientBase} The client
+ */
+ this.client_ = new grpc.web.GrpcWebClientBase(options);
+
+ /**
+ * @private @const {string} The hostname
+ */
+ this.hostname_ = hostname;
+
+};
+
+
+/**
+ * @const
+ * @type {!grpc.web.MethodDescriptor<
+ * !proto.Empty,
+ * !proto.TodoList>}
+ */
+const methodDescriptor_TodoService_List = new grpc.web.MethodDescriptor(
+ '/TodoService/List',
+ grpc.web.MethodType.UNARY,
+ proto.Empty,
+ proto.TodoList,
+ /**
+ * @param {!proto.Empty} request
+ * @return {!Uint8Array}
+ */
+ function(request) {
+ return request.serializeBinary();
+ },
+ proto.TodoList.deserializeBinary
+);
+
+
+/**
+ * @param {!proto.Empty} request The
+ * request proto
+ * @param {?Object} metadata User defined
+ * call metadata
+ * @param {function(?grpc.web.RpcError, ?proto.TodoList)}
+ * callback The callback function(error, response)
+ * @return {!grpc.web.ClientReadableStream|undefined}
+ * The XHR Node Readable Stream
+ */
+proto.TodoServiceClient.prototype.list =
+ function(request, metadata, callback) {
+ return this.client_.rpcCall(this.hostname_ +
+ '/TodoService/List',
+ request,
+ metadata || {},
+ methodDescriptor_TodoService_List,
+ callback);
+};
+
+
+/**
+ * @param {!proto.Empty} request The
+ * request proto
+ * @param {?Object=} metadata User defined
+ * call metadata
+ * @return {!Promise}
+ * Promise that resolves to the response
+ */
+proto.TodoServicePromiseClient.prototype.list =
+ function(request, metadata) {
+ return this.client_.unaryCall(this.hostname_ +
+ '/TodoService/List',
+ request,
+ metadata || {},
+ methodDescriptor_TodoService_List);
+};
+
+
+/**
+ * @const
+ * @type {!grpc.web.MethodDescriptor<
+ * !proto.Todo,
+ * !proto.Todo>}
+ */
+const methodDescriptor_TodoService_Insert = new grpc.web.MethodDescriptor(
+ '/TodoService/Insert',
+ grpc.web.MethodType.UNARY,
+ proto.Todo,
+ proto.Todo,
+ /**
+ * @param {!proto.Todo} request
+ * @return {!Uint8Array}
+ */
+ function(request) {
+ return request.serializeBinary();
+ },
+ proto.Todo.deserializeBinary
+);
+
+
+/**
+ * @param {!proto.Todo} request The
+ * request proto
+ * @param {?Object} metadata User defined
+ * call metadata
+ * @param {function(?grpc.web.RpcError, ?proto.Todo)}
+ * callback The callback function(error, response)
+ * @return {!grpc.web.ClientReadableStream|undefined}
+ * The XHR Node Readable Stream
+ */
+proto.TodoServiceClient.prototype.insert =
+ function(request, metadata, callback) {
+ return this.client_.rpcCall(this.hostname_ +
+ '/TodoService/Insert',
+ request,
+ metadata || {},
+ methodDescriptor_TodoService_Insert,
+ callback);
+};
+
+
+/**
+ * @param {!proto.Todo} request The
+ * request proto
+ * @param {?Object=} metadata User defined
+ * call metadata
+ * @return {!Promise}
+ * Promise that resolves to the response
+ */
+proto.TodoServicePromiseClient.prototype.insert =
+ function(request, metadata) {
+ return this.client_.unaryCall(this.hostname_ +
+ '/TodoService/Insert',
+ request,
+ metadata || {},
+ methodDescriptor_TodoService_Insert);
+};
+
+
+module.exports = proto;
+
diff --git a/src/assets/thirdPartyServices/snet/client_data/todo_pb.js b/src/assets/thirdPartyServices/snet/client_data/todo_pb.js
new file mode 100644
index 000000000..fec629571
--- /dev/null
+++ b/src/assets/thirdPartyServices/snet/client_data/todo_pb.js
@@ -0,0 +1,533 @@
+/*eslint-disable*/
+// source: todo.proto
+/**
+ * @fileoverview
+ * @enhanceable
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
+ * field starts with 'MSG_' and isn't a translatable message.
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+
+var jspb = require('google-protobuf');
+var goog = jspb;
+var global = Function('return this')();
+
+goog.exportSymbol('proto.Empty', null, global);
+goog.exportSymbol('proto.Todo', null, global);
+goog.exportSymbol('proto.TodoList', null, global);
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.Empty = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.Empty, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.Empty.displayName = 'proto.Empty';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.Todo = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.Todo, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.Todo.displayName = 'proto.Todo';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.TodoList = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.TodoList.repeatedFields_, null);
+};
+goog.inherits(proto.TodoList, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.TodoList.displayName = 'proto.TodoList';
+}
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.Empty.prototype.toObject = function(opt_includeInstance) {
+ return proto.Empty.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.Empty} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.Empty.toObject = function(includeInstance, msg) {
+ var f, obj = {
+
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.Empty}
+ */
+proto.Empty.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.Empty;
+ return proto.Empty.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.Empty} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.Empty}
+ */
+proto.Empty.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.Empty.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.Empty.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.Empty} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.Empty.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.Todo.prototype.toObject = function(opt_includeInstance) {
+ return proto.Todo.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.Todo} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.Todo.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ id: jspb.Message.getFieldWithDefault(msg, 1, ""),
+ title: jspb.Message.getFieldWithDefault(msg, 2, ""),
+ iscompleted: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.Todo}
+ */
+proto.Todo.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.Todo;
+ return proto.Todo.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.Todo} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.Todo}
+ */
+proto.Todo.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.setId(value);
+ break;
+ case 2:
+ var value = /** @type {string} */ (reader.readString());
+ msg.setTitle(value);
+ break;
+ case 3:
+ var value = /** @type {boolean} */ (reader.readBool());
+ msg.setIscompleted(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.Todo.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.Todo.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.Todo} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.Todo.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getId();
+ if (f.length > 0) {
+ writer.writeString(
+ 1,
+ f
+ );
+ }
+ f = message.getTitle();
+ if (f.length > 0) {
+ writer.writeString(
+ 2,
+ f
+ );
+ }
+ f = message.getIscompleted();
+ if (f) {
+ writer.writeBool(
+ 3,
+ f
+ );
+ }
+};
+
+
+/**
+ * optional string id = 1;
+ * @return {string}
+ */
+proto.Todo.prototype.getId = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.Todo} returns this
+ */
+proto.Todo.prototype.setId = function(value) {
+ return jspb.Message.setProto3StringField(this, 1, value);
+};
+
+
+/**
+ * optional string title = 2;
+ * @return {string}
+ */
+proto.Todo.prototype.getTitle = function() {
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.Todo} returns this
+ */
+proto.Todo.prototype.setTitle = function(value) {
+ return jspb.Message.setProto3StringField(this, 2, value);
+};
+
+
+/**
+ * optional bool iscompleted = 3;
+ * @return {boolean}
+ */
+proto.Todo.prototype.getIscompleted = function() {
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.Todo} returns this
+ */
+proto.Todo.prototype.setIscompleted = function(value) {
+ return jspb.Message.setProto3BooleanField(this, 3, value);
+};
+
+
+
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array}
+ * @const
+ */
+proto.TodoList.repeatedFields_ = [1];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.TodoList.prototype.toObject = function(opt_includeInstance) {
+ return proto.TodoList.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.TodoList} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.TodoList.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ todoList: jspb.Message.toObjectList(msg.getTodoList(),
+ proto.Todo.toObject, includeInstance)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.TodoList}
+ */
+proto.TodoList.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.TodoList;
+ return proto.TodoList.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.TodoList} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.TodoList}
+ */
+proto.TodoList.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = new proto.Todo;
+ reader.readMessage(value,proto.Todo.deserializeBinaryFromReader);
+ msg.addTodo(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.TodoList.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.TodoList.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.TodoList} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.TodoList.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getTodoList();
+ if (f.length > 0) {
+ writer.writeRepeatedMessage(
+ 1,
+ f,
+ proto.Todo.serializeBinaryToWriter
+ );
+ }
+};
+
+
+/**
+ * repeated Todo todo = 1;
+ * @return {!Array}
+ */
+proto.TodoList.prototype.getTodoList = function() {
+ return /** @type{!Array} */ (
+ jspb.Message.getRepeatedWrapperField(this, proto.Todo, 1));
+};
+
+
+/**
+ * @param {!Array} value
+ * @return {!proto.TodoList} returns this
+*/
+proto.TodoList.prototype.setTodoList = function(value) {
+ return jspb.Message.setRepeatedWrapperField(this, 1, value);
+};
+
+
+/**
+ * @param {!proto.Todo=} opt_value
+ * @param {number=} opt_index
+ * @return {!proto.Todo}
+ */
+proto.TodoList.prototype.addTodo = function(opt_value, opt_index) {
+ return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.Todo, opt_index);
+};
+
+
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.TodoList} returns this
+ */
+proto.TodoList.prototype.clearTodoList = function() {
+ return this.setTodoList([]);
+};
+
+
+goog.object.extend(exports, proto);