/** * @fileoverview gRPC-Web generated client stub for pet.v1 * @enhanceable * @public */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck const grpc = {}; grpc.web = require('grpc-web'); var payment_v1_payment_pb = require('../../payment/v1/payment_pb.js') var google_type_datetime_pb = require('../../google/type/datetime_pb.js') const proto = {}; proto.pet = {}; proto.pet.v1 = require('./pet_pb.js'); /** * @param {string} hostname * @param {?Object} credentials * @param {?grpc.web.ClientOptions} options * @constructor * @struct * @final */ proto.pet.v1.PetStoreServiceClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'text'; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname; }; /** * @param {string} hostname * @param {?Object} credentials * @param {?grpc.web.ClientOptions} options * @constructor * @struct * @final */ proto.pet.v1.PetStoreServicePromiseClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'text'; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname; }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.pet.v1.GetPetRequest, * !proto.pet.v1.GetPetResponse>} */ const methodDescriptor_PetStoreService_GetPet = new grpc.web.MethodDescriptor( '/pet.v1.PetStoreService/GetPet', grpc.web.MethodType.UNARY, proto.pet.v1.GetPetRequest, proto.pet.v1.GetPetResponse, /** * @param {!proto.pet.v1.GetPetRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.pet.v1.GetPetResponse.deserializeBinary ); /** * @param {!proto.pet.v1.GetPetRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.pet.v1.GetPetResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.pet.v1.PetStoreServiceClient.prototype.getPet = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/pet.v1.PetStoreService/GetPet', request, metadata || {}, methodDescriptor_PetStoreService_GetPet, callback); }; /** * @param {!proto.pet.v1.GetPetRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.pet.v1.PetStoreServicePromiseClient.prototype.getPet = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/pet.v1.PetStoreService/GetPet', request, metadata || {}, methodDescriptor_PetStoreService_GetPet); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.pet.v1.PutPetRequest, * !proto.pet.v1.PutPetResponse>} */ const methodDescriptor_PetStoreService_PutPet = new grpc.web.MethodDescriptor( '/pet.v1.PetStoreService/PutPet', grpc.web.MethodType.UNARY, proto.pet.v1.PutPetRequest, proto.pet.v1.PutPetResponse, /** * @param {!proto.pet.v1.PutPetRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.pet.v1.PutPetResponse.deserializeBinary ); /** * @param {!proto.pet.v1.PutPetRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.pet.v1.PutPetResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.pet.v1.PetStoreServiceClient.prototype.putPet = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/pet.v1.PetStoreService/PutPet', request, metadata || {}, methodDescriptor_PetStoreService_PutPet, callback); }; /** * @param {!proto.pet.v1.PutPetRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.pet.v1.PetStoreServicePromiseClient.prototype.putPet = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/pet.v1.PetStoreService/PutPet', request, metadata || {}, methodDescriptor_PetStoreService_PutPet); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.pet.v1.DeletePetRequest, * !proto.pet.v1.DeletePetResponse>} */ const methodDescriptor_PetStoreService_DeletePet = new grpc.web.MethodDescriptor( '/pet.v1.PetStoreService/DeletePet', grpc.web.MethodType.UNARY, proto.pet.v1.DeletePetRequest, proto.pet.v1.DeletePetResponse, /** * @param {!proto.pet.v1.DeletePetRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.pet.v1.DeletePetResponse.deserializeBinary ); /** * @param {!proto.pet.v1.DeletePetRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.pet.v1.DeletePetResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.pet.v1.PetStoreServiceClient.prototype.deletePet = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/pet.v1.PetStoreService/DeletePet', request, metadata || {}, methodDescriptor_PetStoreService_DeletePet, callback); }; /** * @param {!proto.pet.v1.DeletePetRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.pet.v1.PetStoreServicePromiseClient.prototype.deletePet = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/pet.v1.PetStoreService/DeletePet', request, metadata || {}, methodDescriptor_PetStoreService_DeletePet); }; /** * @const * @type {!grpc.web.MethodDescriptor< * !proto.pet.v1.PurchasePetRequest, * !proto.pet.v1.PurchasePetResponse>} */ const methodDescriptor_PetStoreService_PurchasePet = new grpc.web.MethodDescriptor( '/pet.v1.PetStoreService/PurchasePet', grpc.web.MethodType.UNARY, proto.pet.v1.PurchasePetRequest, proto.pet.v1.PurchasePetResponse, /** * @param {!proto.pet.v1.PurchasePetRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, proto.pet.v1.PurchasePetResponse.deserializeBinary ); /** * @param {!proto.pet.v1.PurchasePetRequest} request The * request proto * @param {?Object} metadata User defined * call metadata * @param {function(?grpc.web.RpcError, ?proto.pet.v1.PurchasePetResponse)} * callback The callback function(error, response) * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ proto.pet.v1.PetStoreServiceClient.prototype.purchasePet = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + '/pet.v1.PetStoreService/PurchasePet', request, metadata || {}, methodDescriptor_PetStoreService_PurchasePet, callback); }; /** * @param {!proto.pet.v1.PurchasePetRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata * @return {!Promise} * Promise that resolves to the response */ proto.pet.v1.PetStoreServicePromiseClient.prototype.purchasePet = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + '/pet.v1.PetStoreService/PurchasePet', request, metadata || {}, methodDescriptor_PetStoreService_PurchasePet); }; module.exports = proto.pet.v1;