Implement support for quick device measurement metrics.

This commit is contained in:
Orne Brocaar
2022-06-28 15:05:42 +01:00
parent 4fa9341139
commit a01f8565fd
73 changed files with 8695 additions and 3833 deletions

View File

@ -22,7 +22,8 @@ interface IDeviceServiceService extends grpc.ServiceDefinition<grpc.UntypedServi
deactivate: grpc.MethodDefinition<api_device_pb.DeactivateDeviceRequest, google_protobuf_empty_pb.Empty>;
getActivation: grpc.MethodDefinition<api_device_pb.GetDeviceActivationRequest, api_device_pb.GetDeviceActivationResponse>;
getRandomDevAddr: grpc.MethodDefinition<api_device_pb.GetRandomDevAddrRequest, api_device_pb.GetRandomDevAddrResponse>;
getStats: grpc.MethodDefinition<api_device_pb.GetDeviceStatsRequest, api_device_pb.GetDeviceStatsResponse>;
getMetrics: grpc.MethodDefinition<api_device_pb.GetDeviceMetricsRequest, api_device_pb.GetDeviceMetricsResponse>;
getLinkMetrics: grpc.MethodDefinition<api_device_pb.GetDeviceLinkMetricsRequest, api_device_pb.GetDeviceLinkMetricsResponse>;
enqueue: grpc.MethodDefinition<api_device_pb.EnqueueDeviceQueueItemRequest, api_device_pb.EnqueueDeviceQueueItemResponse>;
flushQueue: grpc.MethodDefinition<api_device_pb.FlushDeviceQueueRequest, google_protobuf_empty_pb.Empty>;
getQueue: grpc.MethodDefinition<api_device_pb.GetDeviceQueueItemsRequest, api_device_pb.GetDeviceQueueItemsResponse>;
@ -45,7 +46,8 @@ export interface IDeviceServiceServer extends grpc.UntypedServiceImplementation
deactivate: grpc.handleUnaryCall<api_device_pb.DeactivateDeviceRequest, google_protobuf_empty_pb.Empty>;
getActivation: grpc.handleUnaryCall<api_device_pb.GetDeviceActivationRequest, api_device_pb.GetDeviceActivationResponse>;
getRandomDevAddr: grpc.handleUnaryCall<api_device_pb.GetRandomDevAddrRequest, api_device_pb.GetRandomDevAddrResponse>;
getStats: grpc.handleUnaryCall<api_device_pb.GetDeviceStatsRequest, api_device_pb.GetDeviceStatsResponse>;
getMetrics: grpc.handleUnaryCall<api_device_pb.GetDeviceMetricsRequest, api_device_pb.GetDeviceMetricsResponse>;
getLinkMetrics: grpc.handleUnaryCall<api_device_pb.GetDeviceLinkMetricsRequest, api_device_pb.GetDeviceLinkMetricsResponse>;
enqueue: grpc.handleUnaryCall<api_device_pb.EnqueueDeviceQueueItemRequest, api_device_pb.EnqueueDeviceQueueItemResponse>;
flushQueue: grpc.handleUnaryCall<api_device_pb.FlushDeviceQueueRequest, google_protobuf_empty_pb.Empty>;
getQueue: grpc.handleUnaryCall<api_device_pb.GetDeviceQueueItemsRequest, api_device_pb.GetDeviceQueueItemsResponse>;
@ -95,9 +97,12 @@ export class DeviceServiceClient extends grpc.Client {
getRandomDevAddr(argument: api_device_pb.GetRandomDevAddrRequest, callback: grpc.requestCallback<api_device_pb.GetRandomDevAddrResponse>): grpc.ClientUnaryCall;
getRandomDevAddr(argument: api_device_pb.GetRandomDevAddrRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetRandomDevAddrResponse>): grpc.ClientUnaryCall;
getRandomDevAddr(argument: api_device_pb.GetRandomDevAddrRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetRandomDevAddrResponse>): grpc.ClientUnaryCall;
getStats(argument: api_device_pb.GetDeviceStatsRequest, callback: grpc.requestCallback<api_device_pb.GetDeviceStatsResponse>): grpc.ClientUnaryCall;
getStats(argument: api_device_pb.GetDeviceStatsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetDeviceStatsResponse>): grpc.ClientUnaryCall;
getStats(argument: api_device_pb.GetDeviceStatsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetDeviceStatsResponse>): grpc.ClientUnaryCall;
getMetrics(argument: api_device_pb.GetDeviceMetricsRequest, callback: grpc.requestCallback<api_device_pb.GetDeviceMetricsResponse>): grpc.ClientUnaryCall;
getMetrics(argument: api_device_pb.GetDeviceMetricsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetDeviceMetricsResponse>): grpc.ClientUnaryCall;
getMetrics(argument: api_device_pb.GetDeviceMetricsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetDeviceMetricsResponse>): grpc.ClientUnaryCall;
getLinkMetrics(argument: api_device_pb.GetDeviceLinkMetricsRequest, callback: grpc.requestCallback<api_device_pb.GetDeviceLinkMetricsResponse>): grpc.ClientUnaryCall;
getLinkMetrics(argument: api_device_pb.GetDeviceLinkMetricsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetDeviceLinkMetricsResponse>): grpc.ClientUnaryCall;
getLinkMetrics(argument: api_device_pb.GetDeviceLinkMetricsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.GetDeviceLinkMetricsResponse>): grpc.ClientUnaryCall;
enqueue(argument: api_device_pb.EnqueueDeviceQueueItemRequest, callback: grpc.requestCallback<api_device_pb.EnqueueDeviceQueueItemResponse>): grpc.ClientUnaryCall;
enqueue(argument: api_device_pb.EnqueueDeviceQueueItemRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.EnqueueDeviceQueueItemResponse>): grpc.ClientUnaryCall;
enqueue(argument: api_device_pb.EnqueueDeviceQueueItemRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_device_pb.EnqueueDeviceQueueItemResponse>): grpc.ClientUnaryCall;

View File

@ -3,6 +3,7 @@
'use strict';
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_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');
@ -161,6 +162,50 @@ function deserialize_api_GetDeviceKeysResponse(buffer_arg) {
return api_device_pb.GetDeviceKeysResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceLinkMetricsRequest(arg) {
if (!(arg instanceof api_device_pb.GetDeviceLinkMetricsRequest)) {
throw new Error('Expected argument of type api.GetDeviceLinkMetricsRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetDeviceLinkMetricsRequest(buffer_arg) {
return api_device_pb.GetDeviceLinkMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceLinkMetricsResponse(arg) {
if (!(arg instanceof api_device_pb.GetDeviceLinkMetricsResponse)) {
throw new Error('Expected argument of type api.GetDeviceLinkMetricsResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetDeviceLinkMetricsResponse(buffer_arg) {
return api_device_pb.GetDeviceLinkMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceMetricsRequest(arg) {
if (!(arg instanceof api_device_pb.GetDeviceMetricsRequest)) {
throw new Error('Expected argument of type api.GetDeviceMetricsRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetDeviceMetricsRequest(buffer_arg) {
return api_device_pb.GetDeviceMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceMetricsResponse(arg) {
if (!(arg instanceof api_device_pb.GetDeviceMetricsResponse)) {
throw new Error('Expected argument of type api.GetDeviceMetricsResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetDeviceMetricsResponse(buffer_arg) {
return api_device_pb.GetDeviceMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceQueueItemsRequest(arg) {
if (!(arg instanceof api_device_pb.GetDeviceQueueItemsRequest)) {
throw new Error('Expected argument of type api.GetDeviceQueueItemsRequest');
@ -205,28 +250,6 @@ function deserialize_api_GetDeviceResponse(buffer_arg) {
return api_device_pb.GetDeviceResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceStatsRequest(arg) {
if (!(arg instanceof api_device_pb.GetDeviceStatsRequest)) {
throw new Error('Expected argument of type api.GetDeviceStatsRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetDeviceStatsRequest(buffer_arg) {
return api_device_pb.GetDeviceStatsRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetDeviceStatsResponse(arg) {
if (!(arg instanceof api_device_pb.GetDeviceStatsResponse)) {
throw new Error('Expected argument of type api.GetDeviceStatsResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetDeviceStatsResponse(buffer_arg) {
return api_device_pb.GetDeviceStatsResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetRandomDevAddrRequest(arg) {
if (!(arg instanceof api_device_pb.GetRandomDevAddrRequest)) {
throw new Error('Expected argument of type api.GetRandomDevAddrRequest');
@ -475,17 +498,31 @@ getRandomDevAddr: {
responseSerialize: serialize_api_GetRandomDevAddrResponse,
responseDeserialize: deserialize_api_GetRandomDevAddrResponse,
},
// GetStats returns the device stats.
getStats: {
path: '/api.DeviceService/GetStats',
// GetMetrics returns the device metrics.
// Note that this requires a device-profile with codec and measurements configured.
getMetrics: {
path: '/api.DeviceService/GetMetrics',
requestStream: false,
responseStream: false,
requestType: api_device_pb.GetDeviceStatsRequest,
responseType: api_device_pb.GetDeviceStatsResponse,
requestSerialize: serialize_api_GetDeviceStatsRequest,
requestDeserialize: deserialize_api_GetDeviceStatsRequest,
responseSerialize: serialize_api_GetDeviceStatsResponse,
responseDeserialize: deserialize_api_GetDeviceStatsResponse,
requestType: api_device_pb.GetDeviceMetricsRequest,
responseType: api_device_pb.GetDeviceMetricsResponse,
requestSerialize: serialize_api_GetDeviceMetricsRequest,
requestDeserialize: deserialize_api_GetDeviceMetricsRequest,
responseSerialize: serialize_api_GetDeviceMetricsResponse,
responseDeserialize: deserialize_api_GetDeviceMetricsResponse,
},
// GetLinkMetrics returns the device link metrics.
// This includes uplinks, downlinks, RSSI, SNR, etc...
getLinkMetrics: {
path: '/api.DeviceService/GetLinkMetrics',
requestStream: false,
responseStream: false,
requestType: api_device_pb.GetDeviceLinkMetricsRequest,
responseType: api_device_pb.GetDeviceLinkMetricsResponse,
requestSerialize: serialize_api_GetDeviceLinkMetricsRequest,
requestDeserialize: deserialize_api_GetDeviceLinkMetricsRequest,
responseSerialize: serialize_api_GetDeviceLinkMetricsResponse,
responseDeserialize: deserialize_api_GetDeviceLinkMetricsResponse,
},
// Enqueue adds the given item to the downlink queue.
enqueue: {

View File

@ -2,6 +2,7 @@
// file: api/device.proto
import * as jspb from "google-protobuf";
import * as common_common_pb from "../common/common_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";
@ -658,7 +659,7 @@ export namespace GetRandomDevAddrResponse {
}
}
export class GetDeviceStatsRequest extends jspb.Message {
export class GetDeviceMetricsRequest extends jspb.Message {
getDevEui(): string;
setDevEui(value: string): void;
@ -672,86 +673,159 @@ export class GetDeviceStatsRequest extends jspb.Message {
getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined;
setEnd(value?: google_protobuf_timestamp_pb.Timestamp): void;
getAggregation(): common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap];
setAggregation(value: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetDeviceStatsRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetDeviceStatsRequest): GetDeviceStatsRequest.AsObject;
toObject(includeInstance?: boolean): GetDeviceMetricsRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetDeviceMetricsRequest): GetDeviceMetricsRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetDeviceStatsRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetDeviceStatsRequest;
static deserializeBinaryFromReader(message: GetDeviceStatsRequest, reader: jspb.BinaryReader): GetDeviceStatsRequest;
static serializeBinaryToWriter(message: GetDeviceMetricsRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetDeviceMetricsRequest;
static deserializeBinaryFromReader(message: GetDeviceMetricsRequest, reader: jspb.BinaryReader): GetDeviceMetricsRequest;
}
export namespace GetDeviceStatsRequest {
export namespace GetDeviceMetricsRequest {
export type AsObject = {
devEui: string,
start?: google_protobuf_timestamp_pb.Timestamp.AsObject,
end?: google_protobuf_timestamp_pb.Timestamp.AsObject,
aggregation: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap],
}
}
export class GetDeviceStatsResponse extends jspb.Message {
clearResultList(): void;
getResultList(): Array<DeviceStats>;
setResultList(value: Array<DeviceStats>): void;
addResult(value?: DeviceStats, index?: number): DeviceStats;
export class GetDeviceMetricsResponse extends jspb.Message {
getMetricsMap(): jspb.Map<string, common_common_pb.Metric>;
clearMetricsMap(): void;
getStatesMap(): jspb.Map<string, DeviceState>;
clearStatesMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetDeviceStatsResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetDeviceStatsResponse): GetDeviceStatsResponse.AsObject;
toObject(includeInstance?: boolean): GetDeviceMetricsResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetDeviceMetricsResponse): GetDeviceMetricsResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetDeviceStatsResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetDeviceStatsResponse;
static deserializeBinaryFromReader(message: GetDeviceStatsResponse, reader: jspb.BinaryReader): GetDeviceStatsResponse;
static serializeBinaryToWriter(message: GetDeviceMetricsResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetDeviceMetricsResponse;
static deserializeBinaryFromReader(message: GetDeviceMetricsResponse, reader: jspb.BinaryReader): GetDeviceMetricsResponse;
}
export namespace GetDeviceStatsResponse {
export namespace GetDeviceMetricsResponse {
export type AsObject = {
resultList: Array<DeviceStats.AsObject>,
metricsMap: Array<[string, common_common_pb.Metric.AsObject]>,
statesMap: Array<[string, DeviceState.AsObject]>,
}
}
export class DeviceStats extends jspb.Message {
hasTime(): boolean;
clearTime(): void;
getTime(): google_protobuf_timestamp_pb.Timestamp | undefined;
setTime(value?: google_protobuf_timestamp_pb.Timestamp): void;
export class DeviceState extends jspb.Message {
getName(): string;
setName(value: string): void;
getRxPackets(): number;
setRxPackets(value: number): void;
getValue(): string;
setValue(value: string): void;
getGwRssi(): number;
setGwRssi(value: number): void;
getGwSnr(): number;
setGwSnr(value: number): void;
getRxPacketsPerFrequencyMap(): jspb.Map<number, number>;
clearRxPacketsPerFrequencyMap(): void;
getRxPacketsPerDrMap(): jspb.Map<number, number>;
clearRxPacketsPerDrMap(): void;
getErrorsMap(): jspb.Map<string, number>;
clearErrorsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceStats.AsObject;
static toObject(includeInstance: boolean, msg: DeviceStats): DeviceStats.AsObject;
toObject(includeInstance?: boolean): DeviceState.AsObject;
static toObject(includeInstance: boolean, msg: DeviceState): DeviceState.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DeviceStats, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DeviceStats;
static deserializeBinaryFromReader(message: DeviceStats, reader: jspb.BinaryReader): DeviceStats;
static serializeBinaryToWriter(message: DeviceState, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DeviceState;
static deserializeBinaryFromReader(message: DeviceState, reader: jspb.BinaryReader): DeviceState;
}
export namespace DeviceStats {
export namespace DeviceState {
export type AsObject = {
time?: google_protobuf_timestamp_pb.Timestamp.AsObject,
rxPackets: number,
gwRssi: number,
gwSnr: number,
rxPacketsPerFrequencyMap: Array<[number, number]>,
rxPacketsPerDrMap: Array<[number, number]>,
errorsMap: Array<[string, number]>,
name: string,
value: string,
}
}
export class GetDeviceLinkMetricsRequest extends jspb.Message {
getDevEui(): string;
setDevEui(value: string): void;
hasStart(): boolean;
clearStart(): void;
getStart(): google_protobuf_timestamp_pb.Timestamp | undefined;
setStart(value?: google_protobuf_timestamp_pb.Timestamp): void;
hasEnd(): boolean;
clearEnd(): void;
getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined;
setEnd(value?: google_protobuf_timestamp_pb.Timestamp): void;
getAggregation(): common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap];
setAggregation(value: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetDeviceLinkMetricsRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetDeviceLinkMetricsRequest): GetDeviceLinkMetricsRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetDeviceLinkMetricsRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetDeviceLinkMetricsRequest;
static deserializeBinaryFromReader(message: GetDeviceLinkMetricsRequest, reader: jspb.BinaryReader): GetDeviceLinkMetricsRequest;
}
export namespace GetDeviceLinkMetricsRequest {
export type AsObject = {
devEui: string,
start?: google_protobuf_timestamp_pb.Timestamp.AsObject,
end?: google_protobuf_timestamp_pb.Timestamp.AsObject,
aggregation: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap],
}
}
export class GetDeviceLinkMetricsResponse extends jspb.Message {
hasRxPackets(): boolean;
clearRxPackets(): void;
getRxPackets(): common_common_pb.Metric | undefined;
setRxPackets(value?: common_common_pb.Metric): void;
hasGwRssi(): boolean;
clearGwRssi(): void;
getGwRssi(): common_common_pb.Metric | undefined;
setGwRssi(value?: common_common_pb.Metric): void;
hasGwSnr(): boolean;
clearGwSnr(): void;
getGwSnr(): common_common_pb.Metric | undefined;
setGwSnr(value?: common_common_pb.Metric): void;
hasRxPacketsPerFreq(): boolean;
clearRxPacketsPerFreq(): void;
getRxPacketsPerFreq(): common_common_pb.Metric | undefined;
setRxPacketsPerFreq(value?: common_common_pb.Metric): void;
hasRxPacketsPerDr(): boolean;
clearRxPacketsPerDr(): void;
getRxPacketsPerDr(): common_common_pb.Metric | undefined;
setRxPacketsPerDr(value?: common_common_pb.Metric): void;
hasErrors(): boolean;
clearErrors(): void;
getErrors(): common_common_pb.Metric | undefined;
setErrors(value?: common_common_pb.Metric): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetDeviceLinkMetricsResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetDeviceLinkMetricsResponse): GetDeviceLinkMetricsResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetDeviceLinkMetricsResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetDeviceLinkMetricsResponse;
static deserializeBinaryFromReader(message: GetDeviceLinkMetricsResponse, reader: jspb.BinaryReader): GetDeviceLinkMetricsResponse;
}
export namespace GetDeviceLinkMetricsResponse {
export type AsObject = {
rxPackets?: common_common_pb.Metric.AsObject,
gwRssi?: common_common_pb.Metric.AsObject,
gwSnr?: common_common_pb.Metric.AsObject,
rxPacketsPerFreq?: common_common_pb.Metric.AsObject,
rxPacketsPerDr?: common_common_pb.Metric.AsObject,
errors?: common_common_pb.Metric.AsObject,
}
}

1039
api/js/api/device_pb.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -84,6 +84,8 @@ export class DeviceProfile extends jspb.Message {
getTagsMap(): jspb.Map<string, string>;
clearTagsMap(): void;
getMeasurementsMap(): jspb.Map<string, Measurement>;
clearMeasurementsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceProfile.AsObject;
static toObject(includeInstance: boolean, msg: DeviceProfile): DeviceProfile.AsObject;
@ -122,6 +124,31 @@ export namespace DeviceProfile {
abpRx2Dr: number,
abpRx2Freq: number,
tagsMap: Array<[string, string]>,
measurementsMap: Array<[string, Measurement.AsObject]>,
}
}
export class Measurement extends jspb.Message {
getName(): string;
setName(value: string): void;
getKind(): MeasurementKindMap[keyof MeasurementKindMap];
setKind(value: MeasurementKindMap[keyof MeasurementKindMap]): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Measurement.AsObject;
static toObject(includeInstance: boolean, msg: Measurement): Measurement.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Measurement, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Measurement;
static deserializeBinaryFromReader(message: Measurement, reader: jspb.BinaryReader): Measurement;
}
export namespace Measurement {
export type AsObject = {
name: string,
kind: MeasurementKindMap[keyof MeasurementKindMap],
}
}
@ -439,3 +466,13 @@ export interface CodecRuntimeMap {
export const CodecRuntime: CodecRuntimeMap;
export interface MeasurementKindMap {
UNKNOWN: 0;
COUNTER: 1;
ABSOLUTE: 2;
GAUGE: 3;
STRING: 4;
}
export const MeasurementKind: MeasurementKindMap;

View File

@ -24,6 +24,8 @@ goog.exportSymbol('proto.api.GetDeviceProfileResponse', null, global);
goog.exportSymbol('proto.api.ListDeviceProfileAdrAlgorithmsResponse', null, global);
goog.exportSymbol('proto.api.ListDeviceProfilesRequest', null, global);
goog.exportSymbol('proto.api.ListDeviceProfilesResponse', null, global);
goog.exportSymbol('proto.api.Measurement', null, global);
goog.exportSymbol('proto.api.MeasurementKind', null, global);
goog.exportSymbol('proto.api.UpdateDeviceProfileRequest', null, global);
/**
@ -96,7 +98,8 @@ proto.api.DeviceProfile.toObject = function(includeInstance, msg) {
abpRx1DrOffset: msg.getAbpRx1DrOffset(),
abpRx2Dr: msg.getAbpRx2Dr(),
abpRx2Freq: msg.getAbpRx2Freq(),
tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : []
tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [],
measurementsMap: (f = msg.getMeasurementsMap(true)) ? f.toArray() : []
};
if (includeInstance) {
@ -239,6 +242,12 @@ proto.api.DeviceProfile.deserializeBinaryFromReader = function(msg, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString);
});
break;
case 27:
var value = msg.getMeasurementsMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.Measurement.deserializeBinaryFromReader);
});
break;
default:
reader.skipField();
break;
@ -456,6 +465,10 @@ proto.api.DeviceProfile.prototype.serializeBinaryToWriter = function (writer) {
if (f && f.getLength() > 0) {
f.serializeBinary(25, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
f = this.getMeasurementsMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(27, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.Measurement.serializeBinaryToWriter);
}
};
@ -864,6 +877,205 @@ proto.api.DeviceProfile.prototype.getTagsMap = function(opt_noLazyCreate) {
};
/**
* map<string, Measurement> measurements = 27;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,!proto.api.Measurement>}
*/
proto.api.DeviceProfile.prototype.getMeasurementsMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,!proto.api.Measurement>} */ (
jspb.Message.getMapField(this, 27, opt_noLazyCreate,
proto.api.Measurement));
};
/**
* 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.api.Measurement = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.api.Measurement, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.api.Measurement.displayName = 'proto.api.Measurement';
}
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.api.Measurement.prototype.toObject = function(opt_includeInstance) {
return proto.api.Measurement.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.api.Measurement} msg The msg instance to transform.
* @return {!Object}
*/
proto.api.Measurement.toObject = function(includeInstance, msg) {
var f, obj = {
name: msg.getName(),
kind: msg.getKind()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.api.Measurement}
*/
proto.api.Measurement.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.api.Measurement;
return proto.api.Measurement.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.api.Measurement} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.api.Measurement}
*/
proto.api.Measurement.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 3:
var value = /** @type {!proto.api.MeasurementKind} */ (reader.readEnum());
msg.setKind(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.api.Measurement} message
* @param {!jspb.BinaryWriter} writer
*/
proto.api.Measurement.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.api.Measurement.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.api.Measurement.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = this.getKind();
if (f !== 0.0) {
writer.writeEnum(
3,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.api.Measurement} The clone.
*/
proto.api.Measurement.prototype.cloneMessage = function() {
return /** @type {!proto.api.Measurement} */ (jspb.Message.cloneMessage(this));
};
/**
* optional string name = 2;
* @return {string}
*/
proto.api.Measurement.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, ""));
};
/** @param {string} value */
proto.api.Measurement.prototype.setName = function(value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional MeasurementKind kind = 3;
* @return {!proto.api.MeasurementKind}
*/
proto.api.Measurement.prototype.getKind = function() {
return /** @type {!proto.api.MeasurementKind} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {!proto.api.MeasurementKind} value */
proto.api.Measurement.prototype.setKind = function(value) {
jspb.Message.setField(this, 3, value);
};
/**
* Generated by JsPbCodeGenerator.
@ -3244,4 +3456,15 @@ proto.api.CodecRuntime = {
JS: 2
};
/**
* @enum {number}
*/
proto.api.MeasurementKind = {
UNKNOWN: 0,
COUNTER: 1,
ABSOLUTE: 2,
GAUGE: 3,
STRING: 4
};
goog.object.extend(exports, proto.api);

View File

@ -88,6 +88,8 @@ export class DeviceProfileTemplate extends jspb.Message {
getTagsMap(): jspb.Map<string, string>;
clearTagsMap(): void;
getMeasurementsMap(): jspb.Map<string, api_device_profile_pb.Measurement>;
clearMeasurementsMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DeviceProfileTemplate.AsObject;
static toObject(includeInstance: boolean, msg: DeviceProfileTemplate): DeviceProfileTemplate.AsObject;
@ -127,6 +129,7 @@ export namespace DeviceProfileTemplate {
abpRx2Dr: number,
abpRx2Freq: number,
tagsMap: Array<[string, string]>,
measurementsMap: Array<[string, api_device_profile_pb.Measurement.AsObject]>,
}
}

View File

@ -94,7 +94,8 @@ proto.api.DeviceProfileTemplate.toObject = function(includeInstance, msg) {
abpRx1DrOffset: msg.getAbpRx1DrOffset(),
abpRx2Dr: msg.getAbpRx2Dr(),
abpRx2Freq: msg.getAbpRx2Freq(),
tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : []
tagsMap: (f = msg.getTagsMap(true)) ? f.toArray() : [],
measurementsMap: (f = msg.getMeasurementsMap(true)) ? f.toArray() : []
};
if (includeInstance) {
@ -241,6 +242,12 @@ proto.api.DeviceProfileTemplate.deserializeBinaryFromReader = function(msg, read
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString);
});
break;
case 28:
var value = msg.getMeasurementsMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.Measurement.deserializeBinaryFromReader);
});
break;
default:
reader.skipField();
break;
@ -465,6 +472,10 @@ proto.api.DeviceProfileTemplate.prototype.serializeBinaryToWriter = function (wr
if (f && f.getLength() > 0) {
f.serializeBinary(27, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
f = this.getMeasurementsMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(28, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.Measurement.serializeBinaryToWriter);
}
};
@ -888,6 +899,19 @@ proto.api.DeviceProfileTemplate.prototype.getTagsMap = function(opt_noLazyCreate
};
/**
* map<string, Measurement> measurements = 28;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,!proto.api.Measurement>}
*/
proto.api.DeviceProfileTemplate.prototype.getMeasurementsMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,!proto.api.Measurement>} */ (
jspb.Message.getMapField(this, 28, opt_noLazyCreate,
proto.api.Measurement));
};
/**
* Generated by JsPbCodeGenerator.

View File

@ -14,7 +14,7 @@ interface IGatewayServiceService extends grpc.ServiceDefinition<grpc.UntypedServ
delete: grpc.MethodDefinition<api_gateway_pb.DeleteGatewayRequest, google_protobuf_empty_pb.Empty>;
list: grpc.MethodDefinition<api_gateway_pb.ListGatewaysRequest, api_gateway_pb.ListGatewaysResponse>;
generateClientCertificate: grpc.MethodDefinition<api_gateway_pb.GenerateGatewayClientCertificateRequest, api_gateway_pb.GenerateGatewayClientCertificateResponse>;
getStats: grpc.MethodDefinition<api_gateway_pb.GetGatewayStatsRequest, api_gateway_pb.GetGatewayStatsResponse>;
getMetrics: grpc.MethodDefinition<api_gateway_pb.GetGatewayMetricsRequest, api_gateway_pb.GetGatewayMetricsResponse>;
}
export const GatewayServiceService: IGatewayServiceService;
@ -26,7 +26,7 @@ export interface IGatewayServiceServer extends grpc.UntypedServiceImplementation
delete: grpc.handleUnaryCall<api_gateway_pb.DeleteGatewayRequest, google_protobuf_empty_pb.Empty>;
list: grpc.handleUnaryCall<api_gateway_pb.ListGatewaysRequest, api_gateway_pb.ListGatewaysResponse>;
generateClientCertificate: grpc.handleUnaryCall<api_gateway_pb.GenerateGatewayClientCertificateRequest, api_gateway_pb.GenerateGatewayClientCertificateResponse>;
getStats: grpc.handleUnaryCall<api_gateway_pb.GetGatewayStatsRequest, api_gateway_pb.GetGatewayStatsResponse>;
getMetrics: grpc.handleUnaryCall<api_gateway_pb.GetGatewayMetricsRequest, api_gateway_pb.GetGatewayMetricsResponse>;
}
export class GatewayServiceClient extends grpc.Client {
@ -49,7 +49,7 @@ export class GatewayServiceClient extends grpc.Client {
generateClientCertificate(argument: api_gateway_pb.GenerateGatewayClientCertificateRequest, callback: grpc.requestCallback<api_gateway_pb.GenerateGatewayClientCertificateResponse>): grpc.ClientUnaryCall;
generateClientCertificate(argument: api_gateway_pb.GenerateGatewayClientCertificateRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_gateway_pb.GenerateGatewayClientCertificateResponse>): grpc.ClientUnaryCall;
generateClientCertificate(argument: api_gateway_pb.GenerateGatewayClientCertificateRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_gateway_pb.GenerateGatewayClientCertificateResponse>): grpc.ClientUnaryCall;
getStats(argument: api_gateway_pb.GetGatewayStatsRequest, callback: grpc.requestCallback<api_gateway_pb.GetGatewayStatsResponse>): grpc.ClientUnaryCall;
getStats(argument: api_gateway_pb.GetGatewayStatsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_gateway_pb.GetGatewayStatsResponse>): grpc.ClientUnaryCall;
getStats(argument: api_gateway_pb.GetGatewayStatsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_gateway_pb.GetGatewayStatsResponse>): grpc.ClientUnaryCall;
getMetrics(argument: api_gateway_pb.GetGatewayMetricsRequest, callback: grpc.requestCallback<api_gateway_pb.GetGatewayMetricsResponse>): grpc.ClientUnaryCall;
getMetrics(argument: api_gateway_pb.GetGatewayMetricsRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback<api_gateway_pb.GetGatewayMetricsResponse>): grpc.ClientUnaryCall;
getMetrics(argument: api_gateway_pb.GetGatewayMetricsRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback<api_gateway_pb.GetGatewayMetricsResponse>): grpc.ClientUnaryCall;
}

View File

@ -51,6 +51,28 @@ function deserialize_api_GenerateGatewayClientCertificateResponse(buffer_arg) {
return api_gateway_pb.GenerateGatewayClientCertificateResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetGatewayMetricsRequest(arg) {
if (!(arg instanceof api_gateway_pb.GetGatewayMetricsRequest)) {
throw new Error('Expected argument of type api.GetGatewayMetricsRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetGatewayMetricsRequest(buffer_arg) {
return api_gateway_pb.GetGatewayMetricsRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetGatewayMetricsResponse(arg) {
if (!(arg instanceof api_gateway_pb.GetGatewayMetricsResponse)) {
throw new Error('Expected argument of type api.GetGatewayMetricsResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetGatewayMetricsResponse(buffer_arg) {
return api_gateway_pb.GetGatewayMetricsResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetGatewayRequest(arg) {
if (!(arg instanceof api_gateway_pb.GetGatewayRequest)) {
throw new Error('Expected argument of type api.GetGatewayRequest');
@ -73,28 +95,6 @@ function deserialize_api_GetGatewayResponse(buffer_arg) {
return api_gateway_pb.GetGatewayResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetGatewayStatsRequest(arg) {
if (!(arg instanceof api_gateway_pb.GetGatewayStatsRequest)) {
throw new Error('Expected argument of type api.GetGatewayStatsRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetGatewayStatsRequest(buffer_arg) {
return api_gateway_pb.GetGatewayStatsRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_GetGatewayStatsResponse(arg) {
if (!(arg instanceof api_gateway_pb.GetGatewayStatsResponse)) {
throw new Error('Expected argument of type api.GetGatewayStatsResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_api_GetGatewayStatsResponse(buffer_arg) {
return api_gateway_pb.GetGatewayStatsResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_api_ListGatewaysRequest(arg) {
if (!(arg instanceof api_gateway_pb.ListGatewaysRequest)) {
throw new Error('Expected argument of type api.ListGatewaysRequest');
@ -214,17 +214,17 @@ generateClientCertificate: {
responseSerialize: serialize_api_GenerateGatewayClientCertificateResponse,
responseDeserialize: deserialize_api_GenerateGatewayClientCertificateResponse,
},
// GetStats returns the gateway stats.
getStats: {
path: '/api.GatewayService/GetStats',
// GetMetrics returns the gateway metrics.
getMetrics: {
path: '/api.GatewayService/GetMetrics',
requestStream: false,
responseStream: false,
requestType: api_gateway_pb.GetGatewayStatsRequest,
responseType: api_gateway_pb.GetGatewayStatsResponse,
requestSerialize: serialize_api_GetGatewayStatsRequest,
requestDeserialize: deserialize_api_GetGatewayStatsRequest,
responseSerialize: serialize_api_GetGatewayStatsResponse,
responseDeserialize: deserialize_api_GetGatewayStatsResponse,
requestType: api_gateway_pb.GetGatewayMetricsRequest,
responseType: api_gateway_pb.GetGatewayMetricsResponse,
requestSerialize: serialize_api_GetGatewayMetricsRequest,
requestDeserialize: deserialize_api_GetGatewayMetricsRequest,
responseSerialize: serialize_api_GetGatewayMetricsResponse,
responseDeserialize: deserialize_api_GetGatewayMetricsResponse,
},
};

View File

@ -345,7 +345,7 @@ export namespace GenerateGatewayClientCertificateResponse {
}
}
export class GetGatewayStatsRequest extends jspb.Message {
export class GetGatewayMetricsRequest extends jspb.Message {
getGatewayId(): string;
setGatewayId(value: string): void;
@ -359,88 +359,83 @@ export class GetGatewayStatsRequest extends jspb.Message {
getEnd(): google_protobuf_timestamp_pb.Timestamp | undefined;
setEnd(value?: google_protobuf_timestamp_pb.Timestamp): void;
getAggregation(): common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap];
setAggregation(value: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap]): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetGatewayStatsRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetGatewayStatsRequest): GetGatewayStatsRequest.AsObject;
toObject(includeInstance?: boolean): GetGatewayMetricsRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetGatewayMetricsRequest): GetGatewayMetricsRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetGatewayStatsRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetGatewayStatsRequest;
static deserializeBinaryFromReader(message: GetGatewayStatsRequest, reader: jspb.BinaryReader): GetGatewayStatsRequest;
static serializeBinaryToWriter(message: GetGatewayMetricsRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetGatewayMetricsRequest;
static deserializeBinaryFromReader(message: GetGatewayMetricsRequest, reader: jspb.BinaryReader): GetGatewayMetricsRequest;
}
export namespace GetGatewayStatsRequest {
export namespace GetGatewayMetricsRequest {
export type AsObject = {
gatewayId: string,
start?: google_protobuf_timestamp_pb.Timestamp.AsObject,
end?: google_protobuf_timestamp_pb.Timestamp.AsObject,
aggregation: common_common_pb.AggregationMap[keyof common_common_pb.AggregationMap],
}
}
export class GetGatewayStatsResponse extends jspb.Message {
clearResultList(): void;
getResultList(): Array<GatewayStats>;
setResultList(value: Array<GatewayStats>): void;
addResult(value?: GatewayStats, index?: number): GatewayStats;
export class GetGatewayMetricsResponse extends jspb.Message {
hasRxPackets(): boolean;
clearRxPackets(): void;
getRxPackets(): common_common_pb.Metric | undefined;
setRxPackets(value?: common_common_pb.Metric): void;
hasTxPackets(): boolean;
clearTxPackets(): void;
getTxPackets(): common_common_pb.Metric | undefined;
setTxPackets(value?: common_common_pb.Metric): void;
hasTxPacketsPerFreq(): boolean;
clearTxPacketsPerFreq(): void;
getTxPacketsPerFreq(): common_common_pb.Metric | undefined;
setTxPacketsPerFreq(value?: common_common_pb.Metric): void;
hasRxPacketsPerFreq(): boolean;
clearRxPacketsPerFreq(): void;
getRxPacketsPerFreq(): common_common_pb.Metric | undefined;
setRxPacketsPerFreq(value?: common_common_pb.Metric): void;
hasTxPacketsPerDr(): boolean;
clearTxPacketsPerDr(): void;
getTxPacketsPerDr(): common_common_pb.Metric | undefined;
setTxPacketsPerDr(value?: common_common_pb.Metric): void;
hasRxPacketsPerDr(): boolean;
clearRxPacketsPerDr(): void;
getRxPacketsPerDr(): common_common_pb.Metric | undefined;
setRxPacketsPerDr(value?: common_common_pb.Metric): void;
hasTxPacketsPerStatus(): boolean;
clearTxPacketsPerStatus(): void;
getTxPacketsPerStatus(): common_common_pb.Metric | undefined;
setTxPacketsPerStatus(value?: common_common_pb.Metric): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetGatewayStatsResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetGatewayStatsResponse): GetGatewayStatsResponse.AsObject;
toObject(includeInstance?: boolean): GetGatewayMetricsResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetGatewayMetricsResponse): GetGatewayMetricsResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GetGatewayStatsResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetGatewayStatsResponse;
static deserializeBinaryFromReader(message: GetGatewayStatsResponse, reader: jspb.BinaryReader): GetGatewayStatsResponse;
static serializeBinaryToWriter(message: GetGatewayMetricsResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GetGatewayMetricsResponse;
static deserializeBinaryFromReader(message: GetGatewayMetricsResponse, reader: jspb.BinaryReader): GetGatewayMetricsResponse;
}
export namespace GetGatewayStatsResponse {
export namespace GetGatewayMetricsResponse {
export type AsObject = {
resultList: Array<GatewayStats.AsObject>,
}
}
export class GatewayStats extends jspb.Message {
hasTime(): boolean;
clearTime(): void;
getTime(): google_protobuf_timestamp_pb.Timestamp | undefined;
setTime(value?: google_protobuf_timestamp_pb.Timestamp): void;
getRxPackets(): number;
setRxPackets(value: number): void;
getTxPackets(): number;
setTxPackets(value: number): void;
getTxPacketsPerFrequencyMap(): jspb.Map<number, number>;
clearTxPacketsPerFrequencyMap(): void;
getRxPacketsPerFrequencyMap(): jspb.Map<number, number>;
clearRxPacketsPerFrequencyMap(): void;
getTxPacketsPerDrMap(): jspb.Map<number, number>;
clearTxPacketsPerDrMap(): void;
getRxPacketsPerDrMap(): jspb.Map<number, number>;
clearRxPacketsPerDrMap(): void;
getTxPacketsPerStatusMap(): jspb.Map<string, number>;
clearTxPacketsPerStatusMap(): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GatewayStats.AsObject;
static toObject(includeInstance: boolean, msg: GatewayStats): GatewayStats.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: GatewayStats, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): GatewayStats;
static deserializeBinaryFromReader(message: GatewayStats, reader: jspb.BinaryReader): GatewayStats;
}
export namespace GatewayStats {
export type AsObject = {
time?: google_protobuf_timestamp_pb.Timestamp.AsObject,
rxPackets: number,
txPackets: number,
txPacketsPerFrequencyMap: Array<[number, number]>,
rxPacketsPerFrequencyMap: Array<[number, number]>,
txPacketsPerDrMap: Array<[number, number]>,
rxPacketsPerDrMap: Array<[number, number]>,
txPacketsPerStatusMap: Array<[string, number]>,
rxPackets?: common_common_pb.Metric.AsObject,
txPackets?: common_common_pb.Metric.AsObject,
txPacketsPerFreq?: common_common_pb.Metric.AsObject,
rxPacketsPerFreq?: common_common_pb.Metric.AsObject,
txPacketsPerDr?: common_common_pb.Metric.AsObject,
rxPacketsPerDr?: common_common_pb.Metric.AsObject,
txPacketsPerStatus?: common_common_pb.Metric.AsObject,
}
}

View File

@ -16,13 +16,12 @@ goog.exportSymbol('proto.api.CreateGatewayRequest', null, global);
goog.exportSymbol('proto.api.DeleteGatewayRequest', null, global);
goog.exportSymbol('proto.api.Gateway', null, global);
goog.exportSymbol('proto.api.GatewayListItem', null, global);
goog.exportSymbol('proto.api.GatewayStats', null, global);
goog.exportSymbol('proto.api.GenerateGatewayClientCertificateRequest', null, global);
goog.exportSymbol('proto.api.GenerateGatewayClientCertificateResponse', null, global);
goog.exportSymbol('proto.api.GetGatewayMetricsRequest', null, global);
goog.exportSymbol('proto.api.GetGatewayMetricsResponse', null, global);
goog.exportSymbol('proto.api.GetGatewayRequest', null, global);
goog.exportSymbol('proto.api.GetGatewayResponse', null, global);
goog.exportSymbol('proto.api.GetGatewayStatsRequest', null, global);
goog.exportSymbol('proto.api.GetGatewayStatsResponse', null, global);
goog.exportSymbol('proto.api.ListGatewaysRequest', null, global);
goog.exportSymbol('proto.api.ListGatewaysResponse', null, global);
goog.exportSymbol('proto.api.UpdateGatewayRequest', null, global);
@ -2648,12 +2647,12 @@ proto.api.GenerateGatewayClientCertificateResponse.prototype.hasExpiresAt = func
* @extends {jspb.Message}
* @constructor
*/
proto.api.GetGatewayStatsRequest = function(opt_data) {
proto.api.GetGatewayMetricsRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.api.GetGatewayStatsRequest, jspb.Message);
goog.inherits(proto.api.GetGatewayMetricsRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.api.GetGatewayStatsRequest.displayName = 'proto.api.GetGatewayStatsRequest';
proto.api.GetGatewayMetricsRequest.displayName = 'proto.api.GetGatewayMetricsRequest';
}
@ -2668,8 +2667,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.api.GetGatewayStatsRequest.prototype.toObject = function(opt_includeInstance) {
return proto.api.GetGatewayStatsRequest.toObject(opt_includeInstance, this);
proto.api.GetGatewayMetricsRequest.prototype.toObject = function(opt_includeInstance) {
return proto.api.GetGatewayMetricsRequest.toObject(opt_includeInstance, this);
};
@ -2678,14 +2677,15 @@ proto.api.GetGatewayStatsRequest.prototype.toObject = function(opt_includeInstan
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.api.GetGatewayStatsRequest} msg The msg instance to transform.
* @param {!proto.api.GetGatewayMetricsRequest} msg The msg instance to transform.
* @return {!Object}
*/
proto.api.GetGatewayStatsRequest.toObject = function(includeInstance, msg) {
proto.api.GetGatewayMetricsRequest.toObject = function(includeInstance, msg) {
var f, obj = {
gatewayId: msg.getGatewayId(),
start: (f = msg.getStart()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
end: (f = msg.getEnd()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
aggregation: msg.getAggregation()
};
if (includeInstance) {
@ -2699,23 +2699,23 @@ proto.api.GetGatewayStatsRequest.toObject = function(includeInstance, msg) {
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.api.GetGatewayStatsRequest}
* @return {!proto.api.GetGatewayMetricsRequest}
*/
proto.api.GetGatewayStatsRequest.deserializeBinary = function(bytes) {
proto.api.GetGatewayMetricsRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.api.GetGatewayStatsRequest;
return proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader(msg, reader);
var msg = new proto.api.GetGatewayMetricsRequest;
return proto.api.GetGatewayMetricsRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.api.GetGatewayStatsRequest} msg The message object to deserialize into.
* @param {!proto.api.GetGatewayMetricsRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.api.GetGatewayStatsRequest}
* @return {!proto.api.GetGatewayMetricsRequest}
*/
proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, reader) {
proto.api.GetGatewayMetricsRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
@ -2736,6 +2736,10 @@ proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, rea
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setEnd(value);
break;
case 4:
var value = /** @type {!proto.common.Aggregation} */ (reader.readEnum());
msg.setAggregation(value);
break;
default:
reader.skipField();
break;
@ -2748,10 +2752,10 @@ proto.api.GetGatewayStatsRequest.deserializeBinaryFromReader = function(msg, rea
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.api.GetGatewayStatsRequest} message
* @param {!proto.api.GetGatewayMetricsRequest} message
* @param {!jspb.BinaryWriter} writer
*/
proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, writer) {
proto.api.GetGatewayMetricsRequest.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
@ -2760,7 +2764,7 @@ proto.api.GetGatewayStatsRequest.serializeBinaryToWriter = function(message, wri
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.api.GetGatewayStatsRequest.prototype.serializeBinary = function() {
proto.api.GetGatewayMetricsRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
@ -2772,7 +2776,7 @@ proto.api.GetGatewayStatsRequest.prototype.serializeBinary = function() {
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.api.GetGatewayStatsRequest.prototype.serializeBinaryToWriter = function (writer) {
proto.api.GetGatewayMetricsRequest.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getGatewayId();
if (f.length > 0) {
@ -2797,15 +2801,22 @@ proto.api.GetGatewayStatsRequest.prototype.serializeBinaryToWriter = function (w
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = this.getAggregation();
if (f !== 0.0) {
writer.writeEnum(
4,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.api.GetGatewayStatsRequest} The clone.
* @return {!proto.api.GetGatewayMetricsRequest} The clone.
*/
proto.api.GetGatewayStatsRequest.prototype.cloneMessage = function() {
return /** @type {!proto.api.GetGatewayStatsRequest} */ (jspb.Message.cloneMessage(this));
proto.api.GetGatewayMetricsRequest.prototype.cloneMessage = function() {
return /** @type {!proto.api.GetGatewayMetricsRequest} */ (jspb.Message.cloneMessage(this));
};
@ -2813,13 +2824,13 @@ proto.api.GetGatewayStatsRequest.prototype.cloneMessage = function() {
* optional string gateway_id = 1;
* @return {string}
*/
proto.api.GetGatewayStatsRequest.prototype.getGatewayId = function() {
proto.api.GetGatewayMetricsRequest.prototype.getGatewayId = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
};
/** @param {string} value */
proto.api.GetGatewayStatsRequest.prototype.setGatewayId = function(value) {
proto.api.GetGatewayMetricsRequest.prototype.setGatewayId = function(value) {
jspb.Message.setField(this, 1, value);
};
@ -2828,19 +2839,19 @@ proto.api.GetGatewayStatsRequest.prototype.setGatewayId = function(value) {
* optional google.protobuf.Timestamp start = 2;
* @return {proto.google.protobuf.Timestamp}
*/
proto.api.GetGatewayStatsRequest.prototype.getStart = function() {
proto.api.GetGatewayMetricsRequest.prototype.getStart = function() {
return /** @type{proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
};
/** @param {proto.google.protobuf.Timestamp|undefined} value */
proto.api.GetGatewayStatsRequest.prototype.setStart = function(value) {
proto.api.GetGatewayMetricsRequest.prototype.setStart = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.api.GetGatewayStatsRequest.prototype.clearStart = function() {
proto.api.GetGatewayMetricsRequest.prototype.clearStart = function() {
this.setStart(undefined);
};
@ -2849,7 +2860,7 @@ proto.api.GetGatewayStatsRequest.prototype.clearStart = function() {
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GetGatewayStatsRequest.prototype.hasStart = function() {
proto.api.GetGatewayMetricsRequest.prototype.hasStart = function() {
return jspb.Message.getField(this, 2) != null;
};
@ -2858,19 +2869,19 @@ proto.api.GetGatewayStatsRequest.prototype.hasStart = function() {
* optional google.protobuf.Timestamp end = 3;
* @return {proto.google.protobuf.Timestamp}
*/
proto.api.GetGatewayStatsRequest.prototype.getEnd = function() {
proto.api.GetGatewayMetricsRequest.prototype.getEnd = function() {
return /** @type{proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3));
};
/** @param {proto.google.protobuf.Timestamp|undefined} value */
proto.api.GetGatewayStatsRequest.prototype.setEnd = function(value) {
proto.api.GetGatewayMetricsRequest.prototype.setEnd = function(value) {
jspb.Message.setWrapperField(this, 3, value);
};
proto.api.GetGatewayStatsRequest.prototype.clearEnd = function() {
proto.api.GetGatewayMetricsRequest.prototype.clearEnd = function() {
this.setEnd(undefined);
};
@ -2879,186 +2890,23 @@ proto.api.GetGatewayStatsRequest.prototype.clearEnd = function() {
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GetGatewayStatsRequest.prototype.hasEnd = function() {
proto.api.GetGatewayMetricsRequest.prototype.hasEnd = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* 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
* optional common.Aggregation aggregation = 4;
* @return {!proto.common.Aggregation}
*/
proto.api.GetGatewayStatsResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.api.GetGatewayStatsResponse.repeatedFields_, null);
};
goog.inherits(proto.api.GetGatewayStatsResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.api.GetGatewayStatsResponse.displayName = 'proto.api.GetGatewayStatsResponse';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.api.GetGatewayStatsResponse.repeatedFields_ = [1];
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.api.GetGatewayStatsResponse.prototype.toObject = function(opt_includeInstance) {
return proto.api.GetGatewayStatsResponse.toObject(opt_includeInstance, this);
proto.api.GetGatewayMetricsRequest.prototype.getAggregation = function() {
return /** @type {!proto.common.Aggregation} */ (jspb.Message.getFieldProto3(this, 4, 0));
};
/**
* 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.api.GetGatewayStatsResponse} msg The msg instance to transform.
* @return {!Object}
*/
proto.api.GetGatewayStatsResponse.toObject = function(includeInstance, msg) {
var f, obj = {
resultList: jspb.Message.toObjectList(msg.getResultList(),
proto.api.GatewayStats.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.api.GetGatewayStatsResponse}
*/
proto.api.GetGatewayStatsResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.api.GetGatewayStatsResponse;
return proto.api.GetGatewayStatsResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.api.GetGatewayStatsResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.api.GetGatewayStatsResponse}
*/
proto.api.GetGatewayStatsResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.api.GatewayStats;
reader.readMessage(value,proto.api.GatewayStats.deserializeBinaryFromReader);
msg.getResultList().push(value);
msg.setResultList(msg.getResultList());
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.api.GetGatewayStatsResponse} message
* @param {!jspb.BinaryWriter} writer
*/
proto.api.GetGatewayStatsResponse.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.api.GetGatewayStatsResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.api.GetGatewayStatsResponse.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getResultList();
if (f.length > 0) {
writer.writeRepeatedMessage(
1,
f,
proto.api.GatewayStats.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.api.GetGatewayStatsResponse} The clone.
*/
proto.api.GetGatewayStatsResponse.prototype.cloneMessage = function() {
return /** @type {!proto.api.GetGatewayStatsResponse} */ (jspb.Message.cloneMessage(this));
};
/**
* repeated GatewayStats result = 1;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.api.GatewayStats>}
*/
proto.api.GetGatewayStatsResponse.prototype.getResultList = function() {
return /** @type{!Array.<!proto.api.GatewayStats>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.api.GatewayStats, 1));
};
/** @param {Array.<!proto.api.GatewayStats>} value */
proto.api.GetGatewayStatsResponse.prototype.setResultList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 1, value);
};
proto.api.GetGatewayStatsResponse.prototype.clearResultList = function() {
this.setResultList([]);
/** @param {!proto.common.Aggregation} value */
proto.api.GetGatewayMetricsRequest.prototype.setAggregation = function(value) {
jspb.Message.setField(this, 4, value);
};
@ -3073,12 +2921,12 @@ proto.api.GetGatewayStatsResponse.prototype.clearResultList = function() {
* @extends {jspb.Message}
* @constructor
*/
proto.api.GatewayStats = function(opt_data) {
proto.api.GetGatewayMetricsResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.api.GatewayStats, jspb.Message);
goog.inherits(proto.api.GetGatewayMetricsResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.api.GatewayStats.displayName = 'proto.api.GatewayStats';
proto.api.GetGatewayMetricsResponse.displayName = 'proto.api.GetGatewayMetricsResponse';
}
@ -3093,8 +2941,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.api.GatewayStats.prototype.toObject = function(opt_includeInstance) {
return proto.api.GatewayStats.toObject(opt_includeInstance, this);
proto.api.GetGatewayMetricsResponse.prototype.toObject = function(opt_includeInstance) {
return proto.api.GetGatewayMetricsResponse.toObject(opt_includeInstance, this);
};
@ -3103,19 +2951,18 @@ proto.api.GatewayStats.prototype.toObject = function(opt_includeInstance) {
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.api.GatewayStats} msg The msg instance to transform.
* @param {!proto.api.GetGatewayMetricsResponse} msg The msg instance to transform.
* @return {!Object}
*/
proto.api.GatewayStats.toObject = function(includeInstance, msg) {
proto.api.GetGatewayMetricsResponse.toObject = function(includeInstance, msg) {
var f, obj = {
time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
rxPackets: msg.getRxPackets(),
txPackets: msg.getTxPackets(),
txPacketsPerFrequencyMap: (f = msg.getTxPacketsPerFrequencyMap(true)) ? f.toArray() : [],
rxPacketsPerFrequencyMap: (f = msg.getRxPacketsPerFrequencyMap(true)) ? f.toArray() : [],
txPacketsPerDrMap: (f = msg.getTxPacketsPerDrMap(true)) ? f.toArray() : [],
rxPacketsPerDrMap: (f = msg.getRxPacketsPerDrMap(true)) ? f.toArray() : [],
txPacketsPerStatusMap: (f = msg.getTxPacketsPerStatusMap(true)) ? f.toArray() : []
rxPackets: (f = msg.getRxPackets()) && common_common_pb.Metric.toObject(includeInstance, f),
txPackets: (f = msg.getTxPackets()) && common_common_pb.Metric.toObject(includeInstance, f),
txPacketsPerFreq: (f = msg.getTxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f),
rxPacketsPerFreq: (f = msg.getRxPacketsPerFreq()) && common_common_pb.Metric.toObject(includeInstance, f),
txPacketsPerDr: (f = msg.getTxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f),
rxPacketsPerDr: (f = msg.getRxPacketsPerDr()) && common_common_pb.Metric.toObject(includeInstance, f),
txPacketsPerStatus: (f = msg.getTxPacketsPerStatus()) && common_common_pb.Metric.toObject(includeInstance, f)
};
if (includeInstance) {
@ -3129,23 +2976,23 @@ proto.api.GatewayStats.toObject = function(includeInstance, msg) {
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.api.GatewayStats}
* @return {!proto.api.GetGatewayMetricsResponse}
*/
proto.api.GatewayStats.deserializeBinary = function(bytes) {
proto.api.GetGatewayMetricsResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.api.GatewayStats;
return proto.api.GatewayStats.deserializeBinaryFromReader(msg, reader);
var msg = new proto.api.GetGatewayMetricsResponse;
return proto.api.GetGatewayMetricsResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.api.GatewayStats} msg The message object to deserialize into.
* @param {!proto.api.GetGatewayMetricsResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.api.GatewayStats}
* @return {!proto.api.GetGatewayMetricsResponse}
*/
proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) {
proto.api.GetGatewayMetricsResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
@ -3153,47 +3000,39 @@ proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) {
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTime(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint32());
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setRxPackets(value);
break;
case 3:
var value = /** @type {number} */ (reader.readUint32());
case 2:
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setTxPackets(value);
break;
case 3:
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setTxPacketsPerFreq(value);
break;
case 4:
var value = msg.getTxPacketsPerFrequencyMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32);
});
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setRxPacketsPerFreq(value);
break;
case 5:
var value = msg.getRxPacketsPerFrequencyMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32);
});
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setTxPacketsPerDr(value);
break;
case 6:
var value = msg.getTxPacketsPerDrMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32);
});
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setRxPacketsPerDr(value);
break;
case 7:
var value = msg.getRxPacketsPerDrMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readUint32);
});
break;
case 8:
var value = msg.getTxPacketsPerStatusMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint32);
});
var value = new common_common_pb.Metric;
reader.readMessage(value,common_common_pb.Metric.deserializeBinaryFromReader);
msg.setTxPacketsPerStatus(value);
break;
default:
reader.skipField();
@ -3207,10 +3046,10 @@ proto.api.GatewayStats.deserializeBinaryFromReader = function(msg, reader) {
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.api.GatewayStats} message
* @param {!proto.api.GetGatewayMetricsResponse} message
* @param {!jspb.BinaryWriter} writer
*/
proto.api.GatewayStats.serializeBinaryToWriter = function(message, writer) {
proto.api.GetGatewayMetricsResponse.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
@ -3219,7 +3058,7 @@ proto.api.GatewayStats.serializeBinaryToWriter = function(message, writer) {
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.api.GatewayStats.prototype.serializeBinary = function() {
proto.api.GetGatewayMetricsResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
@ -3231,80 +3070,94 @@ proto.api.GatewayStats.prototype.serializeBinary = function() {
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.api.GatewayStats.prototype.serializeBinaryToWriter = function (writer) {
proto.api.GetGatewayMetricsResponse.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getTime();
f = this.getRxPackets();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = this.getRxPackets();
if (f !== 0) {
writer.writeUint32(
2,
f
common_common_pb.Metric.serializeBinaryToWriter
);
}
f = this.getTxPackets();
if (f !== 0) {
writer.writeUint32(
3,
f
if (f != null) {
writer.writeMessage(
2,
f,
common_common_pb.Metric.serializeBinaryToWriter
);
}
f = this.getTxPacketsPerFrequencyMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32);
f = this.getTxPacketsPerFreq();
if (f != null) {
writer.writeMessage(
3,
f,
common_common_pb.Metric.serializeBinaryToWriter
);
}
f = this.getRxPacketsPerFrequencyMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32);
f = this.getRxPacketsPerFreq();
if (f != null) {
writer.writeMessage(
4,
f,
common_common_pb.Metric.serializeBinaryToWriter
);
}
f = this.getTxPacketsPerDrMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32);
f = this.getTxPacketsPerDr();
if (f != null) {
writer.writeMessage(
5,
f,
common_common_pb.Metric.serializeBinaryToWriter
);
}
f = this.getRxPacketsPerDrMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeUint32);
f = this.getRxPacketsPerDr();
if (f != null) {
writer.writeMessage(
6,
f,
common_common_pb.Metric.serializeBinaryToWriter
);
}
f = this.getTxPacketsPerStatusMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(8, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint32);
f = this.getTxPacketsPerStatus();
if (f != null) {
writer.writeMessage(
7,
f,
common_common_pb.Metric.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.api.GatewayStats} The clone.
* @return {!proto.api.GetGatewayMetricsResponse} The clone.
*/
proto.api.GatewayStats.prototype.cloneMessage = function() {
return /** @type {!proto.api.GatewayStats} */ (jspb.Message.cloneMessage(this));
proto.api.GetGatewayMetricsResponse.prototype.cloneMessage = function() {
return /** @type {!proto.api.GetGatewayMetricsResponse} */ (jspb.Message.cloneMessage(this));
};
/**
* optional google.protobuf.Timestamp time = 1;
* @return {proto.google.protobuf.Timestamp}
* optional common.Metric rx_packets = 1;
* @return {proto.common.Metric}
*/
proto.api.GatewayStats.prototype.getTime = function() {
return /** @type{proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1));
proto.api.GetGatewayMetricsResponse.prototype.getRxPackets = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 1));
};
/** @param {proto.google.protobuf.Timestamp|undefined} value */
proto.api.GatewayStats.prototype.setTime = function(value) {
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setRxPackets = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.api.GatewayStats.prototype.clearTime = function() {
this.setTime(undefined);
proto.api.GetGatewayMetricsResponse.prototype.clearRxPackets = function() {
this.setRxPackets(undefined);
};
@ -3312,103 +3165,188 @@ proto.api.GatewayStats.prototype.clearTime = function() {
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GatewayStats.prototype.hasTime = function() {
proto.api.GetGatewayMetricsResponse.prototype.hasRxPackets = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional uint32 rx_packets = 2;
* @return {number}
* optional common.Metric tx_packets = 2;
* @return {proto.common.Metric}
*/
proto.api.GatewayStats.prototype.getRxPackets = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
proto.api.GetGatewayMetricsResponse.prototype.getTxPackets = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 2));
};
/** @param {number} value */
proto.api.GatewayStats.prototype.setRxPackets = function(value) {
jspb.Message.setField(this, 2, value);
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setTxPackets = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.api.GetGatewayMetricsResponse.prototype.clearTxPackets = function() {
this.setTxPackets(undefined);
};
/**
* optional uint32 tx_packets = 3;
* @return {number}
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GatewayStats.prototype.getTxPackets = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.api.GatewayStats.prototype.setTxPackets = function(value) {
jspb.Message.setField(this, 3, value);
proto.api.GetGatewayMetricsResponse.prototype.hasTxPackets = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* map<uint32, uint32> tx_packets_per_frequency = 4;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<number,number>}
* optional common.Metric tx_packets_per_freq = 3;
* @return {proto.common.Metric}
*/
proto.api.GatewayStats.prototype.getTxPacketsPerFrequencyMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<number,number>} */ (
jspb.Message.getMapField(this, 4, opt_noLazyCreate,
null));
proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerFreq = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 3));
};
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerFreq = function(value) {
jspb.Message.setWrapperField(this, 3, value);
};
proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerFreq = function() {
this.setTxPacketsPerFreq(undefined);
};
/**
* map<uint32, uint32> rx_packets_per_frequency = 5;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<number,number>}
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GatewayStats.prototype.getRxPacketsPerFrequencyMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<number,number>} */ (
jspb.Message.getMapField(this, 5, opt_noLazyCreate,
null));
proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerFreq = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* map<uint32, uint32> tx_packets_per_dr = 6;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<number,number>}
* optional common.Metric rx_packets_per_freq = 4;
* @return {proto.common.Metric}
*/
proto.api.GatewayStats.prototype.getTxPacketsPerDrMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<number,number>} */ (
jspb.Message.getMapField(this, 6, opt_noLazyCreate,
null));
proto.api.GetGatewayMetricsResponse.prototype.getRxPacketsPerFreq = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 4));
};
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setRxPacketsPerFreq = function(value) {
jspb.Message.setWrapperField(this, 4, value);
};
proto.api.GetGatewayMetricsResponse.prototype.clearRxPacketsPerFreq = function() {
this.setRxPacketsPerFreq(undefined);
};
/**
* map<uint32, uint32> rx_packets_per_dr = 7;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<number,number>}
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GatewayStats.prototype.getRxPacketsPerDrMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<number,number>} */ (
jspb.Message.getMapField(this, 7, opt_noLazyCreate,
null));
proto.api.GetGatewayMetricsResponse.prototype.hasRxPacketsPerFreq = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* map<string, uint32> tx_packets_per_status = 8;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,number>}
* optional common.Metric tx_packets_per_dr = 5;
* @return {proto.common.Metric}
*/
proto.api.GatewayStats.prototype.getTxPacketsPerStatusMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,number>} */ (
jspb.Message.getMapField(this, 8, opt_noLazyCreate,
null));
proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerDr = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 5));
};
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerDr = function(value) {
jspb.Message.setWrapperField(this, 5, value);
};
proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerDr = function() {
this.setTxPacketsPerDr(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerDr = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* optional common.Metric rx_packets_per_dr = 6;
* @return {proto.common.Metric}
*/
proto.api.GetGatewayMetricsResponse.prototype.getRxPacketsPerDr = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 6));
};
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setRxPacketsPerDr = function(value) {
jspb.Message.setWrapperField(this, 6, value);
};
proto.api.GetGatewayMetricsResponse.prototype.clearRxPacketsPerDr = function() {
this.setRxPacketsPerDr(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GetGatewayMetricsResponse.prototype.hasRxPacketsPerDr = function() {
return jspb.Message.getField(this, 6) != null;
};
/**
* optional common.Metric tx_packets_per_status = 7;
* @return {proto.common.Metric}
*/
proto.api.GetGatewayMetricsResponse.prototype.getTxPacketsPerStatus = function() {
return /** @type{proto.common.Metric} */ (
jspb.Message.getWrapperField(this, common_common_pb.Metric, 7));
};
/** @param {proto.common.Metric|undefined} value */
proto.api.GetGatewayMetricsResponse.prototype.setTxPacketsPerStatus = function(value) {
jspb.Message.setWrapperField(this, 7, value);
};
proto.api.GetGatewayMetricsResponse.prototype.clearTxPacketsPerStatus = function() {
this.setTxPacketsPerStatus(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.api.GetGatewayMetricsResponse.prototype.hasTxPacketsPerStatus = function() {
return jspb.Message.getField(this, 7) != null;
};

View File

@ -2,6 +2,7 @@
// file: common/common.proto
import * as jspb from "google-protobuf";
import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb";
export class Location extends jspb.Message {
getLatitude(): number;
@ -65,6 +66,64 @@ export namespace KeyEnvelope {
}
}
export class Metric extends jspb.Message {
getName(): string;
setName(value: string): void;
clearTimestampsList(): void;
getTimestampsList(): Array<google_protobuf_timestamp_pb.Timestamp>;
setTimestampsList(value: Array<google_protobuf_timestamp_pb.Timestamp>): void;
addTimestamps(value?: google_protobuf_timestamp_pb.Timestamp, index?: number): google_protobuf_timestamp_pb.Timestamp;
clearDatasetsList(): void;
getDatasetsList(): Array<MetricDataset>;
setDatasetsList(value: Array<MetricDataset>): void;
addDatasets(value?: MetricDataset, index?: number): MetricDataset;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Metric.AsObject;
static toObject(includeInstance: boolean, msg: Metric): Metric.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Metric, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Metric;
static deserializeBinaryFromReader(message: Metric, reader: jspb.BinaryReader): Metric;
}
export namespace Metric {
export type AsObject = {
name: string,
timestampsList: Array<google_protobuf_timestamp_pb.Timestamp.AsObject>,
datasetsList: Array<MetricDataset.AsObject>,
}
}
export class MetricDataset extends jspb.Message {
getLabel(): string;
setLabel(value: string): void;
clearDataList(): void;
getDataList(): Array<number>;
setDataList(value: Array<number>): void;
addData(value: number, index?: number): number;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): MetricDataset.AsObject;
static toObject(includeInstance: boolean, msg: MetricDataset): MetricDataset.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: MetricDataset, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): MetricDataset;
static deserializeBinaryFromReader(message: MetricDataset, reader: jspb.BinaryReader): MetricDataset;
}
export namespace MetricDataset {
export type AsObject = {
label: string,
dataList: Array<number>,
}
}
export interface ModulationMap {
LORA: 0;
FSK: 1;
@ -139,3 +198,11 @@ export interface LocationSourceMap {
export const LocationSource: LocationSourceMap;
export interface AggregationMap {
HOUR: 0;
DAY: 1;
MONTH: 2;
}
export const Aggregation: AggregationMap;

View File

@ -9,11 +9,15 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.exportSymbol('proto.common.Aggregation', null, global);
goog.exportSymbol('proto.common.KeyEnvelope', null, global);
goog.exportSymbol('proto.common.Location', null, global);
goog.exportSymbol('proto.common.LocationSource', null, global);
goog.exportSymbol('proto.common.MType', null, global);
goog.exportSymbol('proto.common.MacVersion', null, global);
goog.exportSymbol('proto.common.Metric', null, global);
goog.exportSymbol('proto.common.MetricDataset', null, global);
goog.exportSymbol('proto.common.Modulation', null, global);
goog.exportSymbol('proto.common.RegParamsRevision', null, global);
goog.exportSymbol('proto.common.Region', null, global);
@ -494,6 +498,450 @@ proto.common.KeyEnvelope.prototype.setAesKey = function(value) {
};
/**
* 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.common.Metric = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.common.Metric.repeatedFields_, null);
};
goog.inherits(proto.common.Metric, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.common.Metric.displayName = 'proto.common.Metric';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.common.Metric.repeatedFields_ = [2,3];
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.common.Metric.prototype.toObject = function(opt_includeInstance) {
return proto.common.Metric.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.common.Metric} msg The msg instance to transform.
* @return {!Object}
*/
proto.common.Metric.toObject = function(includeInstance, msg) {
var f, obj = {
name: msg.getName(),
timestampsList: jspb.Message.toObjectList(msg.getTimestampsList(),
google_protobuf_timestamp_pb.Timestamp.toObject, includeInstance),
datasetsList: jspb.Message.toObjectList(msg.getDatasetsList(),
proto.common.MetricDataset.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.common.Metric}
*/
proto.common.Metric.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.common.Metric;
return proto.common.Metric.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.common.Metric} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.common.Metric}
*/
proto.common.Metric.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.setName(value);
break;
case 2:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.getTimestampsList().push(value);
msg.setTimestampsList(msg.getTimestampsList());
break;
case 3:
var value = new proto.common.MetricDataset;
reader.readMessage(value,proto.common.MetricDataset.deserializeBinaryFromReader);
msg.getDatasetsList().push(value);
msg.setDatasetsList(msg.getDatasetsList());
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.common.Metric} message
* @param {!jspb.BinaryWriter} writer
*/
proto.common.Metric.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.common.Metric.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.common.Metric.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = this.getTimestampsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = this.getDatasetsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
proto.common.MetricDataset.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.common.Metric} The clone.
*/
proto.common.Metric.prototype.cloneMessage = function() {
return /** @type {!proto.common.Metric} */ (jspb.Message.cloneMessage(this));
};
/**
* optional string name = 1;
* @return {string}
*/
proto.common.Metric.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
};
/** @param {string} value */
proto.common.Metric.prototype.setName = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* repeated google.protobuf.Timestamp timestamps = 2;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.google.protobuf.Timestamp>}
*/
proto.common.Metric.prototype.getTimestampsList = function() {
return /** @type{!Array.<!proto.google.protobuf.Timestamp>} */ (
jspb.Message.getRepeatedWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
};
/** @param {Array.<!proto.google.protobuf.Timestamp>} value */
proto.common.Metric.prototype.setTimestampsList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 2, value);
};
proto.common.Metric.prototype.clearTimestampsList = function() {
this.setTimestampsList([]);
};
/**
* repeated MetricDataset datasets = 3;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.common.MetricDataset>}
*/
proto.common.Metric.prototype.getDatasetsList = function() {
return /** @type{!Array.<!proto.common.MetricDataset>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.common.MetricDataset, 3));
};
/** @param {Array.<!proto.common.MetricDataset>} value */
proto.common.Metric.prototype.setDatasetsList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 3, value);
};
proto.common.Metric.prototype.clearDatasetsList = function() {
this.setDatasetsList([]);
};
/**
* 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.common.MetricDataset = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.common.MetricDataset.repeatedFields_, null);
};
goog.inherits(proto.common.MetricDataset, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.common.MetricDataset.displayName = 'proto.common.MetricDataset';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.common.MetricDataset.repeatedFields_ = [2];
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.common.MetricDataset.prototype.toObject = function(opt_includeInstance) {
return proto.common.MetricDataset.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.common.MetricDataset} msg The msg instance to transform.
* @return {!Object}
*/
proto.common.MetricDataset.toObject = function(includeInstance, msg) {
var f, obj = {
label: msg.getLabel(),
dataList: jspb.Message.getRepeatedFloatingPointField(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.common.MetricDataset}
*/
proto.common.MetricDataset.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.common.MetricDataset;
return proto.common.MetricDataset.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.common.MetricDataset} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.common.MetricDataset}
*/
proto.common.MetricDataset.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.setLabel(value);
break;
case 2:
var value = /** @type {!Array.<number>} */ (reader.readPackedFloat());
msg.setDataList(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.common.MetricDataset} message
* @param {!jspb.BinaryWriter} writer
*/
proto.common.MetricDataset.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.common.MetricDataset.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.common.MetricDataset.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getLabel();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = this.getDataList();
if (f.length > 0) {
writer.writePackedFloat(
2,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.common.MetricDataset} The clone.
*/
proto.common.MetricDataset.prototype.cloneMessage = function() {
return /** @type {!proto.common.MetricDataset} */ (jspb.Message.cloneMessage(this));
};
/**
* optional string label = 1;
* @return {string}
*/
proto.common.MetricDataset.prototype.getLabel = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
};
/** @param {string} value */
proto.common.MetricDataset.prototype.setLabel = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* repeated float data = 2;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<number>}
*/
proto.common.MetricDataset.prototype.getDataList = function() {
return /** @type {!Array.<number>} */ (jspb.Message.getRepeatedFloatingPointField(this, 2));
};
/** @param {Array.<number>} value */
proto.common.MetricDataset.prototype.setDataList = function(value) {
jspb.Message.setField(this, 2, value || []);
};
proto.common.MetricDataset.prototype.clearDataList = function() {
jspb.Message.setField(this, 2, []);
};
/**
* @enum {number}
*/
@ -574,4 +1022,13 @@ proto.common.LocationSource = {
GEO_RESOLVER_WIFI: 6
};
/**
* @enum {number}
*/
proto.common.Aggregation = {
HOUR: 0,
DAY: 1,
MONTH: 2
};
goog.object.extend(exports, proto.common);