UNPKG

@toitware/api

Version:
1,614 lines (1,404 loc) 62.2 kB
// source: toit/api/auth.proto /** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); goog.object.extend(proto, google_protobuf_duration_pb); goog.exportSymbol('proto.toit.api.AuthResponse', null, global); goog.exportSymbol('proto.toit.api.ChangeOrganizationRequest', null, global); goog.exportSymbol('proto.toit.api.CreateOrganizationRequest', null, global); goog.exportSymbol('proto.toit.api.CreateOrganizationRequest.Organization', null, global); goog.exportSymbol('proto.toit.api.CreateOrganizationRequest.User', null, global); goog.exportSymbol('proto.toit.api.CreateOrganizationResponse', null, global); goog.exportSymbol('proto.toit.api.LoginRequest', null, global); goog.exportSymbol('proto.toit.api.LogoutRequest', null, global); goog.exportSymbol('proto.toit.api.LogoutResponse', null, global); goog.exportSymbol('proto.toit.api.RefreshRequest', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.LoginRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.LoginRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.LoginRequest.displayName = 'proto.toit.api.LoginRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.RefreshRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.RefreshRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.RefreshRequest.displayName = 'proto.toit.api.RefreshRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.AuthResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.AuthResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.AuthResponse.displayName = 'proto.toit.api.AuthResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.LogoutRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.LogoutRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.LogoutRequest.displayName = 'proto.toit.api.LogoutRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.LogoutResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.LogoutResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.LogoutResponse.displayName = 'proto.toit.api.LogoutResponse'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.ChangeOrganizationRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ChangeOrganizationRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ChangeOrganizationRequest.displayName = 'proto.toit.api.ChangeOrganizationRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.CreateOrganizationRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateOrganizationRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateOrganizationRequest.displayName = 'proto.toit.api.CreateOrganizationRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.CreateOrganizationRequest.Organization = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateOrganizationRequest.Organization, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateOrganizationRequest.Organization.displayName = 'proto.toit.api.CreateOrganizationRequest.Organization'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.CreateOrganizationRequest.User = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateOrganizationRequest.User, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateOrganizationRequest.User.displayName = 'proto.toit.api.CreateOrganizationRequest.User'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.toit.api.CreateOrganizationResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateOrganizationResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateOrganizationResponse.displayName = 'proto.toit.api.CreateOrganizationResponse'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.LoginRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.LoginRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.LoginRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.LoginRequest.toObject = function(includeInstance, msg) { var f, obj = { username: jspb.Message.getFieldWithDefault(msg, 1, ""), password: jspb.Message.getFieldWithDefault(msg, 2, ""), remember: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), organizationId: msg.getOrganizationId_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.api.LoginRequest} */ proto.toit.api.LoginRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.LoginRequest; return proto.toit.api.LoginRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.LoginRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.LoginRequest} */ proto.toit.api.LoginRequest.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.setUsername(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setPassword(value); break; case 3: var value = /** @type {boolean} */ (reader.readBool()); msg.setRemember(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOrganizationId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.LoginRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.LoginRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.LoginRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.LoginRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getUsername(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getPassword(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getRemember(); if (f) { writer.writeBool( 3, f ); } f = message.getOrganizationId_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } }; /** * optional string username = 1; * @return {string} */ proto.toit.api.LoginRequest.prototype.getUsername = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.toit.api.LoginRequest} returns this */ proto.toit.api.LoginRequest.prototype.setUsername = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string password = 2; * @return {string} */ proto.toit.api.LoginRequest.prototype.getPassword = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.toit.api.LoginRequest} returns this */ proto.toit.api.LoginRequest.prototype.setPassword = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional bool remember = 3; * @return {boolean} */ proto.toit.api.LoginRequest.prototype.getRemember = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; /** * @param {boolean} value * @return {!proto.toit.api.LoginRequest} returns this */ proto.toit.api.LoginRequest.prototype.setRemember = function(value) { return jspb.Message.setProto3BooleanField(this, 3, value); }; /** * optional bytes organization_id = 4; * @return {!(string|Uint8Array)} */ proto.toit.api.LoginRequest.prototype.getOrganizationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes organization_id = 4; * This is a type-conversion wrapper around `getOrganizationId()` * @return {string} */ proto.toit.api.LoginRequest.prototype.getOrganizationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOrganizationId())); }; /** * optional bytes organization_id = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOrganizationId()` * @return {!Uint8Array} */ proto.toit.api.LoginRequest.prototype.getOrganizationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOrganizationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.LoginRequest} returns this */ proto.toit.api.LoginRequest.prototype.setOrganizationId = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.RefreshRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.RefreshRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.RefreshRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.RefreshRequest.toObject = function(includeInstance, msg) { var f, obj = { refreshToken: msg.getRefreshToken_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.api.RefreshRequest} */ proto.toit.api.RefreshRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.RefreshRequest; return proto.toit.api.RefreshRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.RefreshRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.RefreshRequest} */ proto.toit.api.RefreshRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setRefreshToken(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.RefreshRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.RefreshRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.RefreshRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.RefreshRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getRefreshToken_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } }; /** * optional bytes refresh_token = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.RefreshRequest.prototype.getRefreshToken = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes refresh_token = 1; * This is a type-conversion wrapper around `getRefreshToken()` * @return {string} */ proto.toit.api.RefreshRequest.prototype.getRefreshToken_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getRefreshToken())); }; /** * optional bytes refresh_token = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getRefreshToken()` * @return {!Uint8Array} */ proto.toit.api.RefreshRequest.prototype.getRefreshToken_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getRefreshToken())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.RefreshRequest} returns this */ proto.toit.api.RefreshRequest.prototype.setRefreshToken = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.AuthResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.AuthResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.AuthResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.AuthResponse.toObject = function(includeInstance, msg) { var f, obj = { accessToken: msg.getAccessToken_asB64(), tokenType: jspb.Message.getFieldWithDefault(msg, 2, ""), expiresIn: (f = msg.getExpiresIn()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), refreshToken: msg.getRefreshToken_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.api.AuthResponse} */ proto.toit.api.AuthResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.AuthResponse; return proto.toit.api.AuthResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.AuthResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.AuthResponse} */ proto.toit.api.AuthResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setAccessToken(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setTokenType(value); break; case 3: var value = new google_protobuf_duration_pb.Duration; reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); msg.setExpiresIn(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setRefreshToken(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.AuthResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.AuthResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.AuthResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.AuthResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getAccessToken_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getTokenType(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getExpiresIn(); if (f != null) { writer.writeMessage( 3, f, google_protobuf_duration_pb.Duration.serializeBinaryToWriter ); } f = message.getRefreshToken_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } }; /** * optional bytes access_token = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.AuthResponse.prototype.getAccessToken = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes access_token = 1; * This is a type-conversion wrapper around `getAccessToken()` * @return {string} */ proto.toit.api.AuthResponse.prototype.getAccessToken_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAccessToken())); }; /** * optional bytes access_token = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAccessToken()` * @return {!Uint8Array} */ proto.toit.api.AuthResponse.prototype.getAccessToken_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAccessToken())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.AuthResponse} returns this */ proto.toit.api.AuthResponse.prototype.setAccessToken = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional string token_type = 2; * @return {string} */ proto.toit.api.AuthResponse.prototype.getTokenType = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.toit.api.AuthResponse} returns this */ proto.toit.api.AuthResponse.prototype.setTokenType = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional google.protobuf.Duration expires_in = 3; * @return {?proto.google.protobuf.Duration} */ proto.toit.api.AuthResponse.prototype.getExpiresIn = function() { return /** @type{?proto.google.protobuf.Duration} */ ( jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 3)); }; /** * @param {?proto.google.protobuf.Duration|undefined} value * @return {!proto.toit.api.AuthResponse} returns this */ proto.toit.api.AuthResponse.prototype.setExpiresIn = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.AuthResponse} returns this */ proto.toit.api.AuthResponse.prototype.clearExpiresIn = function() { return this.setExpiresIn(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.AuthResponse.prototype.hasExpiresIn = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional bytes refresh_token = 4; * @return {!(string|Uint8Array)} */ proto.toit.api.AuthResponse.prototype.getRefreshToken = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes refresh_token = 4; * This is a type-conversion wrapper around `getRefreshToken()` * @return {string} */ proto.toit.api.AuthResponse.prototype.getRefreshToken_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getRefreshToken())); }; /** * optional bytes refresh_token = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getRefreshToken()` * @return {!Uint8Array} */ proto.toit.api.AuthResponse.prototype.getRefreshToken_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getRefreshToken())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.AuthResponse} returns this */ proto.toit.api.AuthResponse.prototype.setRefreshToken = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.LogoutRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.LogoutRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.LogoutRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.LogoutRequest.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.toit.api.LogoutRequest} */ proto.toit.api.LogoutRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.LogoutRequest; return proto.toit.api.LogoutRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.LogoutRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.LogoutRequest} */ proto.toit.api.LogoutRequest.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.toit.api.LogoutRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.LogoutRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.LogoutRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.LogoutRequest.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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.LogoutResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.LogoutResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.LogoutResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.LogoutResponse.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.toit.api.LogoutResponse} */ proto.toit.api.LogoutResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.LogoutResponse; return proto.toit.api.LogoutResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.LogoutResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.LogoutResponse} */ proto.toit.api.LogoutResponse.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.toit.api.LogoutResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.LogoutResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.LogoutResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.LogoutResponse.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_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.ChangeOrganizationRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.ChangeOrganizationRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.ChangeOrganizationRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ChangeOrganizationRequest.toObject = function(includeInstance, msg) { var f, obj = { organizationId: msg.getOrganizationId_asB64(), refreshToken: msg.getRefreshToken_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.api.ChangeOrganizationRequest} */ proto.toit.api.ChangeOrganizationRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ChangeOrganizationRequest; return proto.toit.api.ChangeOrganizationRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ChangeOrganizationRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ChangeOrganizationRequest} */ proto.toit.api.ChangeOrganizationRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOrganizationId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setRefreshToken(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.ChangeOrganizationRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.ChangeOrganizationRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.ChangeOrganizationRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ChangeOrganizationRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOrganizationId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getRefreshToken_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional bytes organization_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.ChangeOrganizationRequest.prototype.getOrganizationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes organization_id = 1; * This is a type-conversion wrapper around `getOrganizationId()` * @return {string} */ proto.toit.api.ChangeOrganizationRequest.prototype.getOrganizationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOrganizationId())); }; /** * optional bytes organization_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOrganizationId()` * @return {!Uint8Array} */ proto.toit.api.ChangeOrganizationRequest.prototype.getOrganizationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOrganizationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ChangeOrganizationRequest} returns this */ proto.toit.api.ChangeOrganizationRequest.prototype.setOrganizationId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes refresh_token = 2; * @return {!(string|Uint8Array)} */ proto.toit.api.ChangeOrganizationRequest.prototype.getRefreshToken = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes refresh_token = 2; * This is a type-conversion wrapper around `getRefreshToken()` * @return {string} */ proto.toit.api.ChangeOrganizationRequest.prototype.getRefreshToken_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getRefreshToken())); }; /** * optional bytes refresh_token = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getRefreshToken()` * @return {!Uint8Array} */ proto.toit.api.ChangeOrganizationRequest.prototype.getRefreshToken_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getRefreshToken())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ChangeOrganizationRequest} returns this */ proto.toit.api.ChangeOrganizationRequest.prototype.setRefreshToken = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.CreateOrganizationRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.CreateOrganizationRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.CreateOrganizationRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateOrganizationRequest.toObject = function(includeInstance, msg) { var f, obj = { organization: (f = msg.getOrganization()) && proto.toit.api.CreateOrganizationRequest.Organization.toObject(includeInstance, f), user: (f = msg.getUser()) && proto.toit.api.CreateOrganizationRequest.User.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.toit.api.CreateOrganizationRequest} */ proto.toit.api.CreateOrganizationRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateOrganizationRequest; return proto.toit.api.CreateOrganizationRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateOrganizationRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateOrganizationRequest} */ proto.toit.api.CreateOrganizationRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.toit.api.CreateOrganizationRequest.Organization; reader.readMessage(value,proto.toit.api.CreateOrganizationRequest.Organization.deserializeBinaryFromReader); msg.setOrganization(value); break; case 2: var value = new proto.toit.api.CreateOrganizationRequest.User; reader.readMessage(value,proto.toit.api.CreateOrganizationRequest.User.deserializeBinaryFromReader); msg.setUser(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.CreateOrganizationRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.CreateOrganizationRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.CreateOrganizationRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateOrganizationRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getOrganization(); if (f != null) { writer.writeMessage( 1, f, proto.toit.api.CreateOrganizationRequest.Organization.serializeBinaryToWriter ); } f = message.getUser(); if (f != null) { writer.writeMessage( 2, f, proto.toit.api.CreateOrganizationRequest.User.serializeBinaryToWriter ); } }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.toit.api.CreateOrganizationRequest.Organization.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.CreateOrganizationRequest.Organization.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.toit.api.CreateOrganizationRequest.Organization} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateOrganizationRequest.Organization.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, ""), email: 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 {!proto.toit.api.CreateOrganizationRequest.Organization} */ proto.toit.api.CreateOrganizationRequest.Organization.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateOrganizationRequest.Organization; return proto.toit.api.CreateOrganizationRequest.Organization.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateOrganizationRequest.Organization} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateOrganizationRequest.Organization} */ proto.toit.api.CreateOrganizationRequest.Organization.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setName(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setEmail(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.CreateOrganizationRequest.Organization.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.CreateOrganizationRequest.Organization.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.toit.api.CreateOrganizationRequest.Organization} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateOrganizationRequest.Organization.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getEmail(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional string name = 1; * @return {string} */ proto.toit.api.CreateOrganizationRequest.Organization.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.toit.api.CreateOrganizationRequest.Organization} returns this */ proto.toit.api.CreateOrganizationRequest.Organization.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string email = 2; * @return {string} */ proto.toit.api.CreateOrganizationRequest.Organization.prototype.getEmail = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {str