Files
protobuf/gen/web/pet/v1/pet_pb.js
2022-05-31 09:30:19 +02:00

1585 lines
46 KiB
JavaScript

// source: pet/v1/pet.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @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 */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var payment_v1_payment_pb = require('../../payment/v1/payment_pb.js');
goog.object.extend(proto, payment_v1_payment_pb);
var google_type_datetime_pb = require('../../google/type/datetime_pb.js');
goog.object.extend(proto, google_type_datetime_pb);
goog.exportSymbol('proto.pet.v1.DeletePetRequest', null, global);
goog.exportSymbol('proto.pet.v1.DeletePetResponse', null, global);
goog.exportSymbol('proto.pet.v1.GetPetRequest', null, global);
goog.exportSymbol('proto.pet.v1.GetPetResponse', null, global);
goog.exportSymbol('proto.pet.v1.Pet', null, global);
goog.exportSymbol('proto.pet.v1.PetType', null, global);
goog.exportSymbol('proto.pet.v1.PurchasePetRequest', null, global);
goog.exportSymbol('proto.pet.v1.PurchasePetResponse', null, global);
goog.exportSymbol('proto.pet.v1.PutPetRequest', null, global);
goog.exportSymbol('proto.pet.v1.PutPetResponse', 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.pet.v1.Pet = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.Pet, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.Pet.displayName = 'proto.pet.v1.Pet';
}
/**
* 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.pet.v1.GetPetRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.GetPetRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.GetPetRequest.displayName = 'proto.pet.v1.GetPetRequest';
}
/**
* 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.pet.v1.GetPetResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.GetPetResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.GetPetResponse.displayName = 'proto.pet.v1.GetPetResponse';
}
/**
* 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.pet.v1.PutPetRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.PutPetRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.PutPetRequest.displayName = 'proto.pet.v1.PutPetRequest';
}
/**
* 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.pet.v1.PutPetResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.PutPetResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.PutPetResponse.displayName = 'proto.pet.v1.PutPetResponse';
}
/**
* 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.pet.v1.DeletePetRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.DeletePetRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.DeletePetRequest.displayName = 'proto.pet.v1.DeletePetRequest';
}
/**
* 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.pet.v1.DeletePetResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.DeletePetResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.DeletePetResponse.displayName = 'proto.pet.v1.DeletePetResponse';
}
/**
* 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.pet.v1.PurchasePetRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.PurchasePetRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.PurchasePetRequest.displayName = 'proto.pet.v1.PurchasePetRequest';
}
/**
* 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.pet.v1.PurchasePetResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pet.v1.PurchasePetResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pet.v1.PurchasePetResponse.displayName = 'proto.pet.v1.PurchasePetResponse';
}
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.pet.v1.Pet.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.Pet.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.pet.v1.Pet} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.Pet.toObject = function(includeInstance, msg) {
var f, obj = {
petType: jspb.Message.getFieldWithDefault(msg, 1, 0),
petId: jspb.Message.getFieldWithDefault(msg, 2, ""),
name: jspb.Message.getFieldWithDefault(msg, 3, ""),
createdAt: (f = msg.getCreatedAt()) && google_type_datetime_pb.DateTime.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.pet.v1.Pet}
*/
proto.pet.v1.Pet.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.Pet;
return proto.pet.v1.Pet.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.Pet} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.Pet}
*/
proto.pet.v1.Pet.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.pet.v1.PetType} */ (reader.readEnum());
msg.setPetType(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPetId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 4:
var value = new google_type_datetime_pb.DateTime;
reader.readMessage(value,google_type_datetime_pb.DateTime.deserializeBinaryFromReader);
msg.setCreatedAt(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.Pet.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.Pet.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.Pet} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.Pet.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPetType();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getPetId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getCreatedAt();
if (f != null) {
writer.writeMessage(
4,
f,
google_type_datetime_pb.DateTime.serializeBinaryToWriter
);
}
};
/**
* optional PetType pet_type = 1;
* @return {!proto.pet.v1.PetType}
*/
proto.pet.v1.Pet.prototype.getPetType = function() {
return /** @type {!proto.pet.v1.PetType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.pet.v1.PetType} value
* @return {!proto.pet.v1.Pet} returns this
*/
proto.pet.v1.Pet.prototype.setPetType = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional string pet_id = 2;
* @return {string}
*/
proto.pet.v1.Pet.prototype.getPetId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.pet.v1.Pet} returns this
*/
proto.pet.v1.Pet.prototype.setPetId = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string name = 3;
* @return {string}
*/
proto.pet.v1.Pet.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.pet.v1.Pet} returns this
*/
proto.pet.v1.Pet.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional google.type.DateTime created_at = 4;
* @return {?proto.google.type.DateTime}
*/
proto.pet.v1.Pet.prototype.getCreatedAt = function() {
return /** @type{?proto.google.type.DateTime} */ (
jspb.Message.getWrapperField(this, google_type_datetime_pb.DateTime, 4));
};
/**
* @param {?proto.google.type.DateTime|undefined} value
* @return {!proto.pet.v1.Pet} returns this
*/
proto.pet.v1.Pet.prototype.setCreatedAt = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.pet.v1.Pet} returns this
*/
proto.pet.v1.Pet.prototype.clearCreatedAt = function() {
return this.setCreatedAt(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.pet.v1.Pet.prototype.hasCreatedAt = function() {
return jspb.Message.getField(this, 4) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pet.v1.GetPetRequest.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.GetPetRequest.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.pet.v1.GetPetRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.GetPetRequest.toObject = function(includeInstance, msg) {
var f, obj = {
petId: 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 {!proto.pet.v1.GetPetRequest}
*/
proto.pet.v1.GetPetRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.GetPetRequest;
return proto.pet.v1.GetPetRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.GetPetRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.GetPetRequest}
*/
proto.pet.v1.GetPetRequest.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.setPetId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.GetPetRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.GetPetRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.GetPetRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.GetPetRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPetId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string pet_id = 1;
* @return {string}
*/
proto.pet.v1.GetPetRequest.prototype.getPetId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pet.v1.GetPetRequest} returns this
*/
proto.pet.v1.GetPetRequest.prototype.setPetId = function(value) {
return jspb.Message.setProto3StringField(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.pet.v1.GetPetResponse.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.GetPetResponse.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.pet.v1.GetPetResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.GetPetResponse.toObject = function(includeInstance, msg) {
var f, obj = {
pet: (f = msg.getPet()) && proto.pet.v1.Pet.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.pet.v1.GetPetResponse}
*/
proto.pet.v1.GetPetResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.GetPetResponse;
return proto.pet.v1.GetPetResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.GetPetResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.GetPetResponse}
*/
proto.pet.v1.GetPetResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.pet.v1.Pet;
reader.readMessage(value,proto.pet.v1.Pet.deserializeBinaryFromReader);
msg.setPet(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.GetPetResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.GetPetResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.GetPetResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.GetPetResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPet();
if (f != null) {
writer.writeMessage(
1,
f,
proto.pet.v1.Pet.serializeBinaryToWriter
);
}
};
/**
* optional Pet pet = 1;
* @return {?proto.pet.v1.Pet}
*/
proto.pet.v1.GetPetResponse.prototype.getPet = function() {
return /** @type{?proto.pet.v1.Pet} */ (
jspb.Message.getWrapperField(this, proto.pet.v1.Pet, 1));
};
/**
* @param {?proto.pet.v1.Pet|undefined} value
* @return {!proto.pet.v1.GetPetResponse} returns this
*/
proto.pet.v1.GetPetResponse.prototype.setPet = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.pet.v1.GetPetResponse} returns this
*/
proto.pet.v1.GetPetResponse.prototype.clearPet = function() {
return this.setPet(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.pet.v1.GetPetResponse.prototype.hasPet = function() {
return jspb.Message.getField(this, 1) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pet.v1.PutPetRequest.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.PutPetRequest.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.pet.v1.PutPetRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PutPetRequest.toObject = function(includeInstance, msg) {
var f, obj = {
petType: jspb.Message.getFieldWithDefault(msg, 1, 0),
name: 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.pet.v1.PutPetRequest}
*/
proto.pet.v1.PutPetRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.PutPetRequest;
return proto.pet.v1.PutPetRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.PutPetRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.PutPetRequest}
*/
proto.pet.v1.PutPetRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.pet.v1.PetType} */ (reader.readEnum());
msg.setPetType(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.PutPetRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.PutPetRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.PutPetRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PutPetRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPetType();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional PetType pet_type = 1;
* @return {!proto.pet.v1.PetType}
*/
proto.pet.v1.PutPetRequest.prototype.getPetType = function() {
return /** @type {!proto.pet.v1.PetType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.pet.v1.PetType} value
* @return {!proto.pet.v1.PutPetRequest} returns this
*/
proto.pet.v1.PutPetRequest.prototype.setPetType = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional string name = 2;
* @return {string}
*/
proto.pet.v1.PutPetRequest.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.pet.v1.PutPetRequest} returns this
*/
proto.pet.v1.PutPetRequest.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(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.pet.v1.PutPetResponse.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.PutPetResponse.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.pet.v1.PutPetResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PutPetResponse.toObject = function(includeInstance, msg) {
var f, obj = {
pet: (f = msg.getPet()) && proto.pet.v1.Pet.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.pet.v1.PutPetResponse}
*/
proto.pet.v1.PutPetResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.PutPetResponse;
return proto.pet.v1.PutPetResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.PutPetResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.PutPetResponse}
*/
proto.pet.v1.PutPetResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.pet.v1.Pet;
reader.readMessage(value,proto.pet.v1.Pet.deserializeBinaryFromReader);
msg.setPet(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.PutPetResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.PutPetResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.PutPetResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PutPetResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPet();
if (f != null) {
writer.writeMessage(
1,
f,
proto.pet.v1.Pet.serializeBinaryToWriter
);
}
};
/**
* optional Pet pet = 1;
* @return {?proto.pet.v1.Pet}
*/
proto.pet.v1.PutPetResponse.prototype.getPet = function() {
return /** @type{?proto.pet.v1.Pet} */ (
jspb.Message.getWrapperField(this, proto.pet.v1.Pet, 1));
};
/**
* @param {?proto.pet.v1.Pet|undefined} value
* @return {!proto.pet.v1.PutPetResponse} returns this
*/
proto.pet.v1.PutPetResponse.prototype.setPet = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.pet.v1.PutPetResponse} returns this
*/
proto.pet.v1.PutPetResponse.prototype.clearPet = function() {
return this.setPet(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.pet.v1.PutPetResponse.prototype.hasPet = function() {
return jspb.Message.getField(this, 1) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pet.v1.DeletePetRequest.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.DeletePetRequest.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.pet.v1.DeletePetRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.DeletePetRequest.toObject = function(includeInstance, msg) {
var f, obj = {
petId: 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 {!proto.pet.v1.DeletePetRequest}
*/
proto.pet.v1.DeletePetRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.DeletePetRequest;
return proto.pet.v1.DeletePetRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.DeletePetRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.DeletePetRequest}
*/
proto.pet.v1.DeletePetRequest.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.setPetId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.DeletePetRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.DeletePetRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.DeletePetRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.DeletePetRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPetId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string pet_id = 1;
* @return {string}
*/
proto.pet.v1.DeletePetRequest.prototype.getPetId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pet.v1.DeletePetRequest} returns this
*/
proto.pet.v1.DeletePetRequest.prototype.setPetId = function(value) {
return jspb.Message.setProto3StringField(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.pet.v1.DeletePetResponse.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.DeletePetResponse.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.pet.v1.DeletePetResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.DeletePetResponse.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.pet.v1.DeletePetResponse}
*/
proto.pet.v1.DeletePetResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.DeletePetResponse;
return proto.pet.v1.DeletePetResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.DeletePetResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.DeletePetResponse}
*/
proto.pet.v1.DeletePetResponse.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.pet.v1.DeletePetResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.DeletePetResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.DeletePetResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.DeletePetResponse.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.pet.v1.PurchasePetRequest.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.PurchasePetRequest.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.pet.v1.PurchasePetRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PurchasePetRequest.toObject = function(includeInstance, msg) {
var f, obj = {
petId: jspb.Message.getFieldWithDefault(msg, 1, ""),
order: (f = msg.getOrder()) && payment_v1_payment_pb.Order.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.pet.v1.PurchasePetRequest}
*/
proto.pet.v1.PurchasePetRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.PurchasePetRequest;
return proto.pet.v1.PurchasePetRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.PurchasePetRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.PurchasePetRequest}
*/
proto.pet.v1.PurchasePetRequest.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.setPetId(value);
break;
case 2:
var value = new payment_v1_payment_pb.Order;
reader.readMessage(value,payment_v1_payment_pb.Order.deserializeBinaryFromReader);
msg.setOrder(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pet.v1.PurchasePetRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.PurchasePetRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.PurchasePetRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PurchasePetRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPetId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getOrder();
if (f != null) {
writer.writeMessage(
2,
f,
payment_v1_payment_pb.Order.serializeBinaryToWriter
);
}
};
/**
* optional string pet_id = 1;
* @return {string}
*/
proto.pet.v1.PurchasePetRequest.prototype.getPetId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pet.v1.PurchasePetRequest} returns this
*/
proto.pet.v1.PurchasePetRequest.prototype.setPetId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional payment.v1.Order order = 2;
* @return {?proto.payment.v1.Order}
*/
proto.pet.v1.PurchasePetRequest.prototype.getOrder = function() {
return /** @type{?proto.payment.v1.Order} */ (
jspb.Message.getWrapperField(this, payment_v1_payment_pb.Order, 2));
};
/**
* @param {?proto.payment.v1.Order|undefined} value
* @return {!proto.pet.v1.PurchasePetRequest} returns this
*/
proto.pet.v1.PurchasePetRequest.prototype.setOrder = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.pet.v1.PurchasePetRequest} returns this
*/
proto.pet.v1.PurchasePetRequest.prototype.clearOrder = function() {
return this.setOrder(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.pet.v1.PurchasePetRequest.prototype.hasOrder = function() {
return jspb.Message.getField(this, 2) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pet.v1.PurchasePetResponse.prototype.toObject = function(opt_includeInstance) {
return proto.pet.v1.PurchasePetResponse.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.pet.v1.PurchasePetResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PurchasePetResponse.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.pet.v1.PurchasePetResponse}
*/
proto.pet.v1.PurchasePetResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pet.v1.PurchasePetResponse;
return proto.pet.v1.PurchasePetResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pet.v1.PurchasePetResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pet.v1.PurchasePetResponse}
*/
proto.pet.v1.PurchasePetResponse.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.pet.v1.PurchasePetResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pet.v1.PurchasePetResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pet.v1.PurchasePetResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pet.v1.PurchasePetResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
/**
* @enum {number}
*/
proto.pet.v1.PetType = {
PET_TYPE_UNSPECIFIED: 0,
PET_TYPE_CAT: 1,
PET_TYPE_DOG: 2,
PET_TYPE_SNAKE: 3,
PET_TYPE_HAMSTER: 4
};
goog.object.extend(exports, proto.pet.v1);