types/js/signature_pb.js
2017-12-14 14:39:53 -05:00

353 lines
9.3 KiB
JavaScript

/**
* @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 certificate_pb = require('./certificate_pb.js');
goog.exportSymbol('proto.pb.Signature', null, global);
goog.exportSymbol('proto.pb.Signature.Version', 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.pb.Signature = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.Signature, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.pb.Signature.displayName = 'proto.pb.Signature';
}
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_<name>, 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}
*/
proto.pb.Signature.prototype.toObject = function(opt_includeInstance) {
return proto.pb.Signature.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 {!proto.pb.Signature} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.Signature.toObject = function(includeInstance, msg) {
var f, obj = {
version: jspb.Message.getField(msg, 1),
signaturetype: jspb.Message.getField(msg, 2),
signature: msg.getSignature_asB64(),
certificateid: msg.getCertificateid_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.pb.Signature}
*/
proto.pb.Signature.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.Signature;
return proto.pb.Signature.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.Signature} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.Signature}
*/
proto.pb.Signature.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.pb.Signature.Version} */ (reader.readEnum());
msg.setVersion(value);
break;
case 2:
var value = /** @type {!proto.pb.KeyType} */ (reader.readEnum());
msg.setSignaturetype(value);
break;
case 3:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setSignature(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setCertificateid(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.Signature.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.Signature.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.Signature} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.Signature.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = /** @type {!proto.pb.Signature.Version} */ (jspb.Message.getField(message, 1));
if (f != null) {
writer.writeEnum(
1,
f
);
}
f = /** @type {!proto.pb.KeyType} */ (jspb.Message.getField(message, 2));
if (f != null) {
writer.writeEnum(
2,
f
);
}
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3));
if (f != null) {
writer.writeBytes(
3,
f
);
}
f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4));
if (f != null) {
writer.writeBytes(
4,
f
);
}
};
/**
* @enum {number}
*/
proto.pb.Signature.Version = {
UNKNOWN_VERSION: 0,
_0_0_1: 1
};
/**
* required Version version = 1;
* @return {!proto.pb.Signature.Version}
*/
proto.pb.Signature.prototype.getVersion = function() {
return /** @type {!proto.pb.Signature.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/** @param {!proto.pb.Signature.Version} value */
proto.pb.Signature.prototype.setVersion = function(value) {
jspb.Message.setField(this, 1, value);
};
proto.pb.Signature.prototype.clearVersion = function() {
jspb.Message.setField(this, 1, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Signature.prototype.hasVersion = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* required KeyType signatureType = 2;
* @return {!proto.pb.KeyType}
*/
proto.pb.Signature.prototype.getSignaturetype = function() {
return /** @type {!proto.pb.KeyType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/** @param {!proto.pb.KeyType} value */
proto.pb.Signature.prototype.setSignaturetype = function(value) {
jspb.Message.setField(this, 2, value);
};
proto.pb.Signature.prototype.clearSignaturetype = function() {
jspb.Message.setField(this, 2, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Signature.prototype.hasSignaturetype = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* required bytes signature = 3;
* @return {!(string|Uint8Array)}
*/
proto.pb.Signature.prototype.getSignature = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* required bytes signature = 3;
* This is a type-conversion wrapper around `getSignature()`
* @return {string}
*/
proto.pb.Signature.prototype.getSignature_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getSignature()));
};
/**
* required 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}
*/
proto.pb.Signature.prototype.getSignature_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getSignature()));
};
/** @param {!(string|Uint8Array)} value */
proto.pb.Signature.prototype.setSignature = function(value) {
jspb.Message.setField(this, 3, value);
};
proto.pb.Signature.prototype.clearSignature = function() {
jspb.Message.setField(this, 3, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Signature.prototype.hasSignature = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* required bytes certificateId = 4;
* @return {!(string|Uint8Array)}
*/
proto.pb.Signature.prototype.getCertificateid = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* required bytes certificateId = 4;
* This is a type-conversion wrapper around `getCertificateid()`
* @return {string}
*/
proto.pb.Signature.prototype.getCertificateid_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getCertificateid()));
};
/**
* required bytes certificateId = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getCertificateid()`
* @return {!Uint8Array}
*/
proto.pb.Signature.prototype.getCertificateid_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getCertificateid()));
};
/** @param {!(string|Uint8Array)} value */
proto.pb.Signature.prototype.setCertificateid = function(value) {
jspb.Message.setField(this, 4, value);
};
proto.pb.Signature.prototype.clearCertificateid = function() {
jspb.Message.setField(this, 4, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Signature.prototype.hasCertificateid = function() {
return jspb.Message.getField(this, 4) != null;
};
goog.object.extend(exports, proto.pb);