Annotate gRPC methods for REST interface gen.

The option(google.api.http) annotations can be used by for example
https://github.com/grpc-ecosystem/grpc-gateway to generate a gRPC to
REST proxy.
This commit is contained in:
Orne Brocaar
2022-07-13 12:18:46 +01:00
parent e1da9f75ae
commit 36ec11d175
72 changed files with 3902 additions and 2485 deletions

View File

@ -16,6 +16,8 @@ const grpc = {};
grpc.web = require('grpc-web');
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js')

View File

@ -1,5 +1,6 @@
import * as jspb from 'google-protobuf'
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';

View File

@ -15,6 +15,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -18,6 +18,8 @@ grpc.web = require('grpc-web');
var common_common_pb = require('../common/common_pb.js')
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js')

View File

@ -1,6 +1,7 @@
import * as jspb from 'google-protobuf'
import * as common_common_pb from '../common/common_pb';
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_struct_pb from 'google-protobuf/google/protobuf/struct_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
@ -827,10 +828,10 @@ export namespace DeviceQueueItem {
}
export class EnqueueDeviceQueueItemRequest extends jspb.Message {
getItem(): DeviceQueueItem | undefined;
setItem(value?: DeviceQueueItem): EnqueueDeviceQueueItemRequest;
hasItem(): boolean;
clearItem(): EnqueueDeviceQueueItemRequest;
getQueueItem(): DeviceQueueItem | undefined;
setQueueItem(value?: DeviceQueueItem): EnqueueDeviceQueueItemRequest;
hasQueueItem(): boolean;
clearQueueItem(): EnqueueDeviceQueueItemRequest;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): EnqueueDeviceQueueItemRequest.AsObject;
@ -842,7 +843,7 @@ export class EnqueueDeviceQueueItemRequest extends jspb.Message {
export namespace EnqueueDeviceQueueItemRequest {
export type AsObject = {
item?: DeviceQueueItem.AsObject,
queueItem?: DeviceQueueItem.AsObject,
}
}

View File

@ -17,6 +17,8 @@ var global = Function('return this')();
var common_common_pb = require('../common/common_pb.js');
goog.object.extend(proto, common_common_pb);
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
@ -7040,7 +7042,7 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.toObject = function(opt_includ
*/
proto.api.EnqueueDeviceQueueItemRequest.toObject = function(includeInstance, msg) {
var f, obj = {
item: (f = msg.getItem()) && proto.api.DeviceQueueItem.toObject(includeInstance, f)
queueItem: (f = msg.getQueueItem()) && proto.api.DeviceQueueItem.toObject(includeInstance, f)
};
if (includeInstance) {
@ -7080,7 +7082,7 @@ proto.api.EnqueueDeviceQueueItemRequest.deserializeBinaryFromReader = function(m
case 1:
var value = new proto.api.DeviceQueueItem;
reader.readMessage(value,proto.api.DeviceQueueItem.deserializeBinaryFromReader);
msg.setItem(value);
msg.setQueueItem(value);
break;
default:
reader.skipField();
@ -7111,7 +7113,7 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.serializeBinary = function() {
*/
proto.api.EnqueueDeviceQueueItemRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getItem();
f = message.getQueueItem();
if (f != null) {
writer.writeMessage(
1,
@ -7123,10 +7125,10 @@ proto.api.EnqueueDeviceQueueItemRequest.serializeBinaryToWriter = function(messa
/**
* optional DeviceQueueItem item = 1;
* optional DeviceQueueItem queue_item = 1;
* @return {?proto.api.DeviceQueueItem}
*/
proto.api.EnqueueDeviceQueueItemRequest.prototype.getItem = function() {
proto.api.EnqueueDeviceQueueItemRequest.prototype.getQueueItem = function() {
return /** @type{?proto.api.DeviceQueueItem} */ (
jspb.Message.getWrapperField(this, proto.api.DeviceQueueItem, 1));
};
@ -7136,7 +7138,7 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.getItem = function() {
* @param {?proto.api.DeviceQueueItem|undefined} value
* @return {!proto.api.EnqueueDeviceQueueItemRequest} returns this
*/
proto.api.EnqueueDeviceQueueItemRequest.prototype.setItem = function(value) {
proto.api.EnqueueDeviceQueueItemRequest.prototype.setQueueItem = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
@ -7145,8 +7147,8 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.setItem = function(value) {
* Clears the message field making it undefined.
* @return {!proto.api.EnqueueDeviceQueueItemRequest} returns this
*/
proto.api.EnqueueDeviceQueueItemRequest.prototype.clearItem = function() {
return this.setItem(undefined);
proto.api.EnqueueDeviceQueueItemRequest.prototype.clearQueueItem = function() {
return this.setQueueItem(undefined);
};
@ -7154,7 +7156,7 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.clearItem = function() {
* Returns whether this field is set.
* @return {boolean}
*/
proto.api.EnqueueDeviceQueueItemRequest.prototype.hasItem = function() {
proto.api.EnqueueDeviceQueueItemRequest.prototype.hasQueueItem = function() {
return jspb.Message.getField(this, 1) != null;
};

View File

@ -16,6 +16,8 @@ const grpc = {};
grpc.web = require('grpc-web');
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js')

View File

@ -1,5 +1,6 @@
import * as jspb from 'google-protobuf'
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as common_common_pb from '../common/common_pb';

View File

@ -15,6 +15,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -16,6 +16,8 @@ const grpc = {};
grpc.web = require('grpc-web');
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js')

View File

@ -1,5 +1,6 @@
import * as jspb from 'google-protobuf'
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as common_common_pb from '../common/common_pb';

View File

@ -15,6 +15,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -16,6 +16,8 @@ const grpc = {};
grpc.web = require('grpc-web');
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js')

View File

@ -1,5 +1,6 @@
import * as jspb from 'google-protobuf'
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as common_common_pb from '../common/common_pb';

View File

@ -15,6 +15,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -367,10 +367,10 @@ export namespace MulticastGroupQueueItem {
}
export class EnqueueMulticastGroupQueueItemRequest extends jspb.Message {
getMulticastGroupQueueItem(): MulticastGroupQueueItem | undefined;
setMulticastGroupQueueItem(value?: MulticastGroupQueueItem): EnqueueMulticastGroupQueueItemRequest;
hasMulticastGroupQueueItem(): boolean;
clearMulticastGroupQueueItem(): EnqueueMulticastGroupQueueItemRequest;
getQueueItem(): MulticastGroupQueueItem | undefined;
setQueueItem(value?: MulticastGroupQueueItem): EnqueueMulticastGroupQueueItemRequest;
hasQueueItem(): boolean;
clearQueueItem(): EnqueueMulticastGroupQueueItemRequest;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): EnqueueMulticastGroupQueueItemRequest.AsObject;
@ -382,7 +382,7 @@ export class EnqueueMulticastGroupQueueItemRequest extends jspb.Message {
export namespace EnqueueMulticastGroupQueueItemRequest {
export type AsObject = {
multicastGroupQueueItem?: MulticastGroupQueueItem.AsObject,
queueItem?: MulticastGroupQueueItem.AsObject,
}
}

View File

@ -3153,7 +3153,7 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.toObject = function(op
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.toObject = function(includeInstance, msg) {
var f, obj = {
multicastGroupQueueItem: (f = msg.getMulticastGroupQueueItem()) && proto.api.MulticastGroupQueueItem.toObject(includeInstance, f)
queueItem: (f = msg.getQueueItem()) && proto.api.MulticastGroupQueueItem.toObject(includeInstance, f)
};
if (includeInstance) {
@ -3193,7 +3193,7 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.deserializeBinaryFromReader = fu
case 1:
var value = new proto.api.MulticastGroupQueueItem;
reader.readMessage(value,proto.api.MulticastGroupQueueItem.deserializeBinaryFromReader);
msg.setMulticastGroupQueueItem(value);
msg.setQueueItem(value);
break;
default:
reader.skipField();
@ -3224,7 +3224,7 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.serializeBinary = func
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getMulticastGroupQueueItem();
f = message.getQueueItem();
if (f != null) {
writer.writeMessage(
1,
@ -3236,10 +3236,10 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.serializeBinaryToWriter = functi
/**
* optional MulticastGroupQueueItem multicast_group_queue_item = 1;
* optional MulticastGroupQueueItem queue_item = 1;
* @return {?proto.api.MulticastGroupQueueItem}
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.getMulticastGroupQueueItem = function() {
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.getQueueItem = function() {
return /** @type{?proto.api.MulticastGroupQueueItem} */ (
jspb.Message.getWrapperField(this, proto.api.MulticastGroupQueueItem, 1));
};
@ -3249,7 +3249,7 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.getMulticastGroupQueue
* @param {?proto.api.MulticastGroupQueueItem|undefined} value
* @return {!proto.api.EnqueueMulticastGroupQueueItemRequest} returns this
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.setMulticastGroupQueueItem = function(value) {
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.setQueueItem = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
@ -3258,8 +3258,8 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.setMulticastGroupQueue
* Clears the message field making it undefined.
* @return {!proto.api.EnqueueMulticastGroupQueueItemRequest} returns this
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.clearMulticastGroupQueueItem = function() {
return this.setMulticastGroupQueueItem(undefined);
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.clearQueueItem = function() {
return this.setQueueItem(undefined);
};
@ -3267,7 +3267,7 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.clearMulticastGroupQue
* Returns whether this field is set.
* @return {boolean}
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.hasMulticastGroupQueueItem = function() {
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.hasQueueItem = function() {
return jspb.Message.getField(this, 1) != null;
};

View File

@ -16,6 +16,8 @@ const grpc = {};
grpc.web = require('grpc-web');
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js')

View File

@ -1,5 +1,6 @@
import * as jspb from 'google-protobuf'
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';

View File

@ -15,6 +15,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -16,6 +16,8 @@ const grpc = {};
grpc.web = require('grpc-web');
var google_api_annotations_pb = require('../google/api/annotations_pb.js')
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js')
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js')

View File

@ -1,5 +1,6 @@
import * as jspb from 'google-protobuf'
import * as google_api_annotations_pb from '../google/api/annotations_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';

View File

@ -15,6 +15,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_api_annotations_pb = require('../google/api/annotations_pb.js');
goog.object.extend(proto, google_api_annotations_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');