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

@ -3,6 +3,7 @@
'use strict';
var grpc = require('@grpc/grpc-js');
var api_application_pb = require('../api/application_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_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -2,6 +2,7 @@
// file: api/application.proto
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

@ -9,6 +9,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
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');
goog.exportSymbol('proto.api.Application', null, global);

View File

@ -4,6 +4,7 @@
var grpc = require('@grpc/grpc-js');
var api_device_pb = require('../api/device_pb.js');
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');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -3,6 +3,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";
@ -882,10 +883,10 @@ export namespace DeviceQueueItem {
}
export class EnqueueDeviceQueueItemRequest extends jspb.Message {
hasItem(): boolean;
clearItem(): void;
getItem(): DeviceQueueItem | undefined;
setItem(value?: DeviceQueueItem): void;
hasQueueItem(): boolean;
clearQueueItem(): void;
getQueueItem(): DeviceQueueItem | undefined;
setQueueItem(value?: DeviceQueueItem): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): EnqueueDeviceQueueItemRequest.AsObject;
@ -899,7 +900,7 @@ export class EnqueueDeviceQueueItemRequest extends jspb.Message {
export namespace EnqueueDeviceQueueItemRequest {
export type AsObject = {
item?: DeviceQueueItem.AsObject,
queueItem?: DeviceQueueItem.AsObject,
}
}

View File

@ -10,6 +10,7 @@ var goog = jspb;
var global = Function('return this')();
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');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
@ -6832,7 +6833,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) {
@ -6872,7 +6873,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();
@ -6912,7 +6913,7 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.serializeBinary = function() {
*/
proto.api.EnqueueDeviceQueueItemRequest.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getItem();
f = this.getQueueItem();
if (f != null) {
writer.writeMessage(
1,
@ -6933,23 +6934,23 @@ proto.api.EnqueueDeviceQueueItemRequest.prototype.cloneMessage = function() {
/**
* 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));
};
/** @param {proto.api.DeviceQueueItem|undefined} value */
proto.api.EnqueueDeviceQueueItemRequest.prototype.setItem = function(value) {
proto.api.EnqueueDeviceQueueItemRequest.prototype.setQueueItem = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.api.EnqueueDeviceQueueItemRequest.prototype.clearItem = function() {
this.setItem(undefined);
proto.api.EnqueueDeviceQueueItemRequest.prototype.clearQueueItem = function() {
this.setQueueItem(undefined);
};
@ -6957,7 +6958,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

@ -3,6 +3,7 @@
'use strict';
var grpc = require('@grpc/grpc-js');
var api_device_profile_pb = require('../api/device_profile_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_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var common_common_pb = require('../common/common_pb.js');

View File

@ -2,6 +2,7 @@
// file: api/device_profile.proto
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

@ -9,6 +9,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
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');
var common_common_pb = require('../common/common_pb.js');

View File

@ -3,6 +3,7 @@
'use strict';
var grpc = require('@grpc/grpc-js');
var api_device_profile_template_pb = require('../api/device_profile_template_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_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var common_common_pb = require('../common/common_pb.js');

View File

@ -2,6 +2,7 @@
// file: api/device_profile_template.proto
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

@ -9,6 +9,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
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');
var common_common_pb = require('../common/common_pb.js');

View File

@ -3,6 +3,7 @@
'use strict';
var grpc = require('@grpc/grpc-js');
var api_gateway_pb = require('../api/gateway_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_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var common_common_pb = require('../common/common_pb.js');

View File

@ -2,6 +2,7 @@
// file: api/gateway.proto
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

@ -9,6 +9,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
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');
var common_common_pb = require('../common/common_pb.js');

View File

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

View File

@ -3036,7 +3036,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) {
@ -3076,7 +3076,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();
@ -3116,7 +3116,7 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.serializeBinary = func
*/
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getMulticastGroupQueueItem();
f = this.getQueueItem();
if (f != null) {
writer.writeMessage(
1,
@ -3137,23 +3137,23 @@ proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.cloneMessage = functio
/**
* 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));
};
/** @param {proto.api.MulticastGroupQueueItem|undefined} value */
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.setMulticastGroupQueueItem = function(value) {
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.setQueueItem = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.clearMulticastGroupQueueItem = function() {
this.setMulticastGroupQueueItem(undefined);
proto.api.EnqueueMulticastGroupQueueItemRequest.prototype.clearQueueItem = function() {
this.setQueueItem(undefined);
};
@ -3161,7 +3161,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

@ -3,6 +3,7 @@
'use strict';
var grpc = require('@grpc/grpc-js');
var api_tenant_pb = require('../api/tenant_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_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -2,6 +2,7 @@
// file: api/tenant.proto
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

@ -9,6 +9,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
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');
goog.exportSymbol('proto.api.AddTenantUserRequest', null, global);

View File

@ -3,6 +3,7 @@
'use strict';
var grpc = require('@grpc/grpc-js');
var api_user_pb = require('../api/user_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_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');

View File

@ -2,6 +2,7 @@
// file: api/user.proto
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

@ -9,6 +9,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
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');
goog.exportSymbol('proto.api.CreateUserRequest', null, global);