From 8336e4072ebc34727bfab7c2d0655a0d4eb1225a Mon Sep 17 00:00:00 2001 From: Pedro Sanders Date: Sat, 18 Jun 2022 11:55:23 -0400 Subject: [PATCH] wip --- mods/limiter/.npmignore | 7 + mods/limiter/Dockerfile | 25 + mods/limiter/package.json | 3 +- mods/limiter/src/index.ts | 18 + mods/limiter/src/service/healthcheck.ts | 3 + mods/limiter/src/service/limiter.ts | 93 + .../src/service/protos/common_grpc_pb.js | 1 - .../limiter/src/service/protos/common_pb.d.ts | 54 - mods/limiter/src/service/protos/common_pb.js | 335 - .../protos/google/api/annotations_grpc_pb.js | 1 - .../protos/google/api/annotations_pb.d.ts | 11 - .../protos/google/api/annotations_pb.js | 48 - .../google/api/field_behavior_grpc_pb.js | 1 - .../protos/google/api/field_behavior_pb.d.ts | 21 - .../protos/google/api/field_behavior_pb.js | 61 - .../service/protos/google/api/http_grpc_pb.js | 1 - .../service/protos/google/api/http_pb.d.ts | 135 - .../src/service/protos/google/api/http_pb.js | 1006 --- .../protos/google/api/httpbody_grpc_pb.js | 1 - .../protos/google/api/httpbody_pb.d.ts | 38 - .../service/protos/google/api/httpbody_pb.js | 286 - .../src/service/protos/limiter_grpc_pb.d.ts | 42 - .../src/service/protos/limiter_grpc_pb.js | 51 - .../src/service/protos/limiter_pb.d.ts | 47 - mods/limiter/src/service/protos/limiter_pb.js | 322 - .../options/annotations_grpc_pb.js | 1 - .../options/annotations_pb.d.ts | 19 - .../options/annotations_pb.js | 152 - .../options/openapiv2_grpc_pb.js | 1 - .../options/openapiv2_pb.d.ts | 685 --- .../options/openapiv2_pb.js | 5367 ----------------- mods/limiter/src/service/runner.ts | 36 + mods/limiter/src/service/types.ts | 38 + mods/limiter/src/utils/utils.ts | 105 + mods/limiter/test/limiter.unit.test.ts | 101 + mods/limiter/tsconfig.json | 16 + 36 files changed, 444 insertions(+), 8688 deletions(-) create mode 100644 mods/limiter/.npmignore create mode 100644 mods/limiter/Dockerfile create mode 100644 mods/limiter/src/index.ts create mode 100644 mods/limiter/src/service/healthcheck.ts create mode 100644 mods/limiter/src/service/limiter.ts delete mode 100644 mods/limiter/src/service/protos/common_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/common_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/common_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/annotations_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/annotations_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/google/api/annotations_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/field_behavior_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/field_behavior_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/google/api/field_behavior_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/http_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/http_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/google/api/http_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/httpbody_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/google/api/httpbody_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/google/api/httpbody_pb.js delete mode 100644 mods/limiter/src/service/protos/limiter_grpc_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/limiter_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/limiter_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/limiter_pb.js delete mode 100644 mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.js delete mode 100644 mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_grpc_pb.js delete mode 100644 mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.d.ts delete mode 100644 mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.js create mode 100644 mods/limiter/src/service/runner.ts create mode 100644 mods/limiter/src/service/types.ts create mode 100644 mods/limiter/src/utils/utils.ts create mode 100644 mods/limiter/test/limiter.unit.test.ts create mode 100644 mods/limiter/tsconfig.json diff --git a/mods/limiter/.npmignore b/mods/limiter/.npmignore new file mode 100644 index 000000000..385fe1863 --- /dev/null +++ b/mods/limiter/.npmignore @@ -0,0 +1,7 @@ +node_modules +.nyc_output +coverage +src +test +*.log +*.ts \ No newline at end of file diff --git a/mods/limiter/Dockerfile b/mods/limiter/Dockerfile new file mode 100644 index 000000000..ffc37527f --- /dev/null +++ b/mods/limiter/Dockerfile @@ -0,0 +1,25 @@ +## +## Build and pack the service +## +FROM fonoster/base as builder + +COPY . /scripts +RUN ./install.sh + +## +## Runner +## +FROM fonoster/base as runner + +COPY --from=builder /scripts/fonoster-* . + +RUN apk add --no-cache --update git tini npm nodejs \ + && npm install -g fonoster-*.tgz \ + && apk del npm git + +USER fonoster + +CMD ["run_limiter"] + +HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ + CMD [ "healthcheck_limiter" ] \ No newline at end of file diff --git a/mods/limiter/package.json b/mods/limiter/package.json index 946c8ac7b..6c71b1a8c 100644 --- a/mods/limiter/package.json +++ b/mods/limiter/package.json @@ -10,7 +10,6 @@ "scripts": { "prebuild": "rimraf ./dist tsconfig.tsbuildinfo", "build": "tsc -b tsconfig.json", - "postbuild": "cp -a ./src/service/protos/ ./dist/service/protos", "start": "cross-env NODE_ENV=dev nodemon src/service/runner" }, "bin": { @@ -43,6 +42,8 @@ "url": "https://github.com/fonoster/fonoster/issues" }, "dependencies": { + "@fonoster/auth": "^0.3.9", + "@fonoster/users": "^0.3.9", "@fonoster/projects": "^0.3.9", "@fonoster/common": "^0.3.9", "@fonoster/errors": "^0.3.9", diff --git a/mods/limiter/src/index.ts b/mods/limiter/src/index.ts new file mode 100644 index 000000000..7e8d82c3c --- /dev/null +++ b/mods/limiter/src/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2021 by Fonoster Inc (https://fonoster.com) + * http://github.com/fonoster/fonoster + * + * This file is part of Fonoster + * + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/mods/limiter/src/service/healthcheck.ts b/mods/limiter/src/service/healthcheck.ts new file mode 100644 index 000000000..c024ae500 --- /dev/null +++ b/mods/limiter/src/service/healthcheck.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +//import {healthcheck} from "@fonoster/common"; +//healthcheck(); diff --git a/mods/limiter/src/service/limiter.ts b/mods/limiter/src/service/limiter.ts new file mode 100644 index 000000000..a40a363db --- /dev/null +++ b/mods/limiter/src/service/limiter.ts @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com) + * http://github.com/fonoster/fonoster + * + * This file is part of Fonoster + * + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* eslint-disable require-jsdoc */ +import grpc from "@grpc/grpc-js"; +import { + CheckAuthorizedRequest, + CheckAuthorizedResponse +} from "@fonoster/auth/dist/service/protos/auth_pb"; +import { + ILimiterServer, + ILimiterService, + LimiterService +} from "@fonoster/auth/dist/service/protos/auth_grpc_pb"; +import {getAccessKeyId, getRedisConnection, routr} from "@fonoster/core"; +import { + getLimiters, + getLimitForPath, + getResourceCount, + getUserByAccessKeyId +} from "../utils/utils"; +import {Limiter} from "./types"; +import {ErrorCodes, FonosterError} from "@fonoster/errors"; +import {UserStatus} from "@fonoster/users/dist/service/types"; + +const redis = getRedisConnection(); +const limiters: Limiter[] = getLimiters(); + +class LimiterServer implements ILimiterServer { + [name: string]: grpc.UntypedHandleCall; + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + async checkAuthorized( + call: grpc.ServerUnaryCall, + callback: grpc.sendUnaryData + ) { + const accessKeyId = getAccessKeyId(call); + const user = await getUserByAccessKeyId(redis)(accessKeyId); + const limit = getLimitForPath(limiters)( + user.getLimiter(), + call.request.getPath() + ); + + const resourceCount = await getResourceCount(redis, routr)( + accessKeyId, + limit?.resource + ); + + if (limit) { + const userStatus = user.getStatus() + ? user.getStatus() + : UserStatus.ACTIVE; + + if (limit.allowedForStatus.toLowerCase() != userStatus.toLowerCase()) { + return callback( + new FonosterError( + `Permission denied due to account status (${user.getStatus()})`, + ErrorCodes.PERMISSION_DENIED + ) + ); + } + + if (resourceCount >= limit.limit) { + return callback( + new FonosterError( + `Permission denied. Your account only allows for ${limit.limit} ${limit.resource}s.`, + ErrorCodes.PERMISSION_DENIED + ) + ); + } + } + + const response = new CheckAuthorizedResponse(); + response.setAuthorized(true); + callback(null, response); + } +} + +export {LimiterServer as default, ILimiterService, LimiterService}; diff --git a/mods/limiter/src/service/protos/common_grpc_pb.js b/mods/limiter/src/service/protos/common_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/common_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/common_pb.d.ts b/mods/limiter/src/service/protos/common_pb.d.ts deleted file mode 100644 index f8b5fb810..000000000 --- a/mods/limiter/src/service/protos/common_pb.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -// package: fonoster.common.v1beta1 -// file: common.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as protoc_gen_openapiv2_options_annotations_pb from "./protoc-gen-openapiv2/options/annotations_pb"; - -export class Empty extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Empty.AsObject; - static toObject(includeInstance: boolean, msg: Empty): Empty.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Empty, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Empty; - static deserializeBinaryFromReader(message: Empty, reader: jspb.BinaryReader): Empty; -} - -export namespace Empty { - export type AsObject = { - } -} - -export class ErrorResponse extends jspb.Message { - getStatus(): number; - setStatus(value: number): ErrorResponse; - getMessage(): string; - setMessage(value: string): ErrorResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ErrorResponse.AsObject; - static toObject(includeInstance: boolean, msg: ErrorResponse): ErrorResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ErrorResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ErrorResponse; - static deserializeBinaryFromReader(message: ErrorResponse, reader: jspb.BinaryReader): ErrorResponse; -} - -export namespace ErrorResponse { - export type AsObject = { - status: number, - message: string, - } -} - -export enum View { - BASIC = 0, - STANDARD = 1, - FULL = 2, -} diff --git a/mods/limiter/src/service/protos/common_pb.js b/mods/limiter/src/service/protos/common_pb.js deleted file mode 100644 index b7f99c7ea..000000000 --- a/mods/limiter/src/service/protos/common_pb.js +++ /dev/null @@ -1,335 +0,0 @@ -// source: common.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var protoc$gen$openapiv2_options_annotations_pb = require('./protoc-gen-openapiv2/options/annotations_pb.js'); -goog.object.extend(proto, protoc$gen$openapiv2_options_annotations_pb); -goog.exportSymbol('proto.fonoster.common.v1beta1.Empty', null, global); -goog.exportSymbol('proto.fonoster.common.v1beta1.ErrorResponse', null, global); -goog.exportSymbol('proto.fonoster.common.v1beta1.View', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.fonoster.common.v1beta1.Empty = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.fonoster.common.v1beta1.Empty, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.fonoster.common.v1beta1.Empty.displayName = 'proto.fonoster.common.v1beta1.Empty'; -} -/** - * 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.fonoster.common.v1beta1.ErrorResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.fonoster.common.v1beta1.ErrorResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.fonoster.common.v1beta1.ErrorResponse.displayName = 'proto.fonoster.common.v1beta1.ErrorResponse'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.fonoster.common.v1beta1.Empty.prototype.toObject = function(opt_includeInstance) { - return proto.fonoster.common.v1beta1.Empty.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.fonoster.common.v1beta1.Empty} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.common.v1beta1.Empty.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.fonoster.common.v1beta1.Empty} - */ -proto.fonoster.common.v1beta1.Empty.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.fonoster.common.v1beta1.Empty; - return proto.fonoster.common.v1beta1.Empty.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.fonoster.common.v1beta1.Empty} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.fonoster.common.v1beta1.Empty} - */ -proto.fonoster.common.v1beta1.Empty.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.fonoster.common.v1beta1.Empty.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.fonoster.common.v1beta1.Empty.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.fonoster.common.v1beta1.Empty} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.common.v1beta1.Empty.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.fonoster.common.v1beta1.ErrorResponse.prototype.toObject = function(opt_includeInstance) { - return proto.fonoster.common.v1beta1.ErrorResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.fonoster.common.v1beta1.ErrorResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.common.v1beta1.ErrorResponse.toObject = function(includeInstance, msg) { - var f, obj = { - status: jspb.Message.getFieldWithDefault(msg, 1, 0), - message: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.fonoster.common.v1beta1.ErrorResponse} - */ -proto.fonoster.common.v1beta1.ErrorResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.fonoster.common.v1beta1.ErrorResponse; - return proto.fonoster.common.v1beta1.ErrorResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.fonoster.common.v1beta1.ErrorResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.fonoster.common.v1beta1.ErrorResponse} - */ -proto.fonoster.common.v1beta1.ErrorResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readInt32()); - msg.setStatus(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.fonoster.common.v1beta1.ErrorResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.fonoster.common.v1beta1.ErrorResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.fonoster.common.v1beta1.ErrorResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.common.v1beta1.ErrorResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStatus(); - if (f !== 0) { - writer.writeInt32( - 1, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional int32 status = 1; - * @return {number} - */ -proto.fonoster.common.v1beta1.ErrorResponse.prototype.getStatus = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.fonoster.common.v1beta1.ErrorResponse} returns this - */ -proto.fonoster.common.v1beta1.ErrorResponse.prototype.setStatus = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string message = 2; - * @return {string} - */ -proto.fonoster.common.v1beta1.ErrorResponse.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.fonoster.common.v1beta1.ErrorResponse} returns this - */ -proto.fonoster.common.v1beta1.ErrorResponse.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * @enum {number} - */ -proto.fonoster.common.v1beta1.View = { - BASIC: 0, - STANDARD: 1, - FULL: 2 -}; - -goog.object.extend(exports, proto.fonoster.common.v1beta1); diff --git a/mods/limiter/src/service/protos/google/api/annotations_grpc_pb.js b/mods/limiter/src/service/protos/google/api/annotations_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/google/api/annotations_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/google/api/annotations_pb.d.ts b/mods/limiter/src/service/protos/google/api/annotations_pb.d.ts deleted file mode 100644 index 06072f3bd..000000000 --- a/mods/limiter/src/service/protos/google/api/annotations_pb.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// package: google.api -// file: google/api/annotations.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as google_api_http_pb from "../../google/api/http_pb"; -import * as google_protobuf_descriptor_pb from "google-protobuf/google/protobuf/descriptor_pb"; - -export const http: jspb.ExtensionFieldInfo; diff --git a/mods/limiter/src/service/protos/google/api/annotations_pb.js b/mods/limiter/src/service/protos/google/api/annotations_pb.js deleted file mode 100644 index 99e4c1824..000000000 --- a/mods/limiter/src/service/protos/google/api/annotations_pb.js +++ /dev/null @@ -1,48 +0,0 @@ -// source: google/api/annotations.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var google_api_http_pb = require('../../google/api/http_pb.js'); -goog.object.extend(proto, google_api_http_pb); -var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); -goog.object.extend(proto, google_protobuf_descriptor_pb); -goog.exportSymbol('proto.google.api.http', null, global); - -/** - * A tuple of {field number, class constructor} for the extension - * field named `http`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.google.api.http = new jspb.ExtensionFieldInfo( - 72295728, - {http: 0}, - google_api_http_pb.HttpRule, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - google_api_http_pb.HttpRule.toObject), - 0); - -google_protobuf_descriptor_pb.MethodOptions.extensionsBinary[72295728] = new jspb.ExtensionFieldBinaryInfo( - proto.google.api.http, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - google_api_http_pb.HttpRule.serializeBinaryToWriter, - google_api_http_pb.HttpRule.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.MethodOptions.extensions[72295728] = proto.google.api.http; - -goog.object.extend(exports, proto.google.api); diff --git a/mods/limiter/src/service/protos/google/api/field_behavior_grpc_pb.js b/mods/limiter/src/service/protos/google/api/field_behavior_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/google/api/field_behavior_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/google/api/field_behavior_pb.d.ts b/mods/limiter/src/service/protos/google/api/field_behavior_pb.d.ts deleted file mode 100644 index 9b853705f..000000000 --- a/mods/limiter/src/service/protos/google/api/field_behavior_pb.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// package: google.api -// file: google/api/field_behavior.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as google_protobuf_descriptor_pb from "google-protobuf/google/protobuf/descriptor_pb"; - -export const fieldBehavior: jspb.ExtensionFieldInfo; - -export enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, -} diff --git a/mods/limiter/src/service/protos/google/api/field_behavior_pb.js b/mods/limiter/src/service/protos/google/api/field_behavior_pb.js deleted file mode 100644 index 44160cc41..000000000 --- a/mods/limiter/src/service/protos/google/api/field_behavior_pb.js +++ /dev/null @@ -1,61 +0,0 @@ -// source: google/api/field_behavior.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); -goog.object.extend(proto, google_protobuf_descriptor_pb); -goog.exportSymbol('proto.google.api.FieldBehavior', null, global); -goog.exportSymbol('proto.google.api.fieldBehaviorList', null, global); -/** - * @enum {number} - */ -proto.google.api.FieldBehavior = { - FIELD_BEHAVIOR_UNSPECIFIED: 0, - OPTIONAL: 1, - REQUIRED: 2, - OUTPUT_ONLY: 3, - INPUT_ONLY: 4, - IMMUTABLE: 5, - UNORDERED_LIST: 6, - NON_EMPTY_DEFAULT: 7 -}; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `fieldBehaviorList`. - * @type {!jspb.ExtensionFieldInfo>} - */ -proto.google.api.fieldBehaviorList = new jspb.ExtensionFieldInfo( - 1052, - {fieldBehaviorList: 0}, - null, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - null), - 1); - -google_protobuf_descriptor_pb.FieldOptions.extensionsBinary[1052] = new jspb.ExtensionFieldBinaryInfo( - proto.google.api.fieldBehaviorList, - jspb.BinaryReader.prototype.readPackedEnum, - jspb.BinaryWriter.prototype.writePackedEnum, - undefined, - undefined, - true); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.FieldOptions.extensions[1052] = proto.google.api.fieldBehaviorList; - -goog.object.extend(exports, proto.google.api); diff --git a/mods/limiter/src/service/protos/google/api/http_grpc_pb.js b/mods/limiter/src/service/protos/google/api/http_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/google/api/http_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/google/api/http_pb.d.ts b/mods/limiter/src/service/protos/google/api/http_pb.d.ts deleted file mode 100644 index 02c3b1ece..000000000 --- a/mods/limiter/src/service/protos/google/api/http_pb.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -// package: google.api -// file: google/api/http.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; - -export class Http extends jspb.Message { - clearRulesList(): void; - getRulesList(): Array; - setRulesList(value: Array): Http; - addRules(value?: HttpRule, index?: number): HttpRule; - getFullyDecodeReservedExpansion(): boolean; - setFullyDecodeReservedExpansion(value: boolean): Http; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Http.AsObject; - static toObject(includeInstance: boolean, msg: Http): Http.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Http, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Http; - static deserializeBinaryFromReader(message: Http, reader: jspb.BinaryReader): Http; -} - -export namespace Http { - export type AsObject = { - rulesList: Array, - fullyDecodeReservedExpansion: boolean, - } -} - -export class HttpRule extends jspb.Message { - getSelector(): string; - setSelector(value: string): HttpRule; - - hasGet(): boolean; - clearGet(): void; - getGet(): string; - setGet(value: string): HttpRule; - - hasPut(): boolean; - clearPut(): void; - getPut(): string; - setPut(value: string): HttpRule; - - hasPost(): boolean; - clearPost(): void; - getPost(): string; - setPost(value: string): HttpRule; - - hasDelete(): boolean; - clearDelete(): void; - getDelete(): string; - setDelete(value: string): HttpRule; - - hasPatch(): boolean; - clearPatch(): void; - getPatch(): string; - setPatch(value: string): HttpRule; - - hasCustom(): boolean; - clearCustom(): void; - getCustom(): CustomHttpPattern | undefined; - setCustom(value?: CustomHttpPattern): HttpRule; - getBody(): string; - setBody(value: string): HttpRule; - getResponseBody(): string; - setResponseBody(value: string): HttpRule; - clearAdditionalBindingsList(): void; - getAdditionalBindingsList(): Array; - setAdditionalBindingsList(value: Array): HttpRule; - addAdditionalBindings(value?: HttpRule, index?: number): HttpRule; - - getPatternCase(): HttpRule.PatternCase; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HttpRule.AsObject; - static toObject(includeInstance: boolean, msg: HttpRule): HttpRule.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: HttpRule, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HttpRule; - static deserializeBinaryFromReader(message: HttpRule, reader: jspb.BinaryReader): HttpRule; -} - -export namespace HttpRule { - export type AsObject = { - selector: string, - get: string, - put: string, - post: string, - pb_delete: string, - patch: string, - custom?: CustomHttpPattern.AsObject, - body: string, - responseBody: string, - additionalBindingsList: Array, - } - - export enum PatternCase { - PATTERN_NOT_SET = 0, - GET = 2, - PUT = 3, - POST = 4, - DELETE = 5, - PATCH = 6, - CUSTOM = 8, - } - -} - -export class CustomHttpPattern extends jspb.Message { - getKind(): string; - setKind(value: string): CustomHttpPattern; - getPath(): string; - setPath(value: string): CustomHttpPattern; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CustomHttpPattern.AsObject; - static toObject(includeInstance: boolean, msg: CustomHttpPattern): CustomHttpPattern.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: CustomHttpPattern, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CustomHttpPattern; - static deserializeBinaryFromReader(message: CustomHttpPattern, reader: jspb.BinaryReader): CustomHttpPattern; -} - -export namespace CustomHttpPattern { - export type AsObject = { - kind: string, - path: string, - } -} diff --git a/mods/limiter/src/service/protos/google/api/http_pb.js b/mods/limiter/src/service/protos/google/api/http_pb.js deleted file mode 100644 index 0359c5eec..000000000 --- a/mods/limiter/src/service/protos/google/api/http_pb.js +++ /dev/null @@ -1,1006 +0,0 @@ -// source: google/api/http.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.google.api.CustomHttpPattern', null, global); -goog.exportSymbol('proto.google.api.Http', null, global); -goog.exportSymbol('proto.google.api.HttpRule', null, global); -goog.exportSymbol('proto.google.api.HttpRule.PatternCase', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.google.api.Http = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.Http.repeatedFields_, null); -}; -goog.inherits(proto.google.api.Http, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.google.api.Http.displayName = 'proto.google.api.Http'; -} -/** - * 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.google.api.HttpRule = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.HttpRule.repeatedFields_, proto.google.api.HttpRule.oneofGroups_); -}; -goog.inherits(proto.google.api.HttpRule, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.google.api.HttpRule.displayName = 'proto.google.api.HttpRule'; -} -/** - * 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.google.api.CustomHttpPattern = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.google.api.CustomHttpPattern, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.google.api.CustomHttpPattern.displayName = 'proto.google.api.CustomHttpPattern'; -} - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.google.api.Http.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.google.api.Http.prototype.toObject = function(opt_includeInstance) { - return proto.google.api.Http.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.google.api.Http} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.Http.toObject = function(includeInstance, msg) { - var f, obj = { - rulesList: jspb.Message.toObjectList(msg.getRulesList(), - proto.google.api.HttpRule.toObject, includeInstance), - fullyDecodeReservedExpansion: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.google.api.Http} - */ -proto.google.api.Http.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.google.api.Http; - return proto.google.api.Http.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.google.api.Http} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.google.api.Http} - */ -proto.google.api.Http.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.google.api.HttpRule; - reader.readMessage(value,proto.google.api.HttpRule.deserializeBinaryFromReader); - msg.addRules(value); - break; - case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setFullyDecodeReservedExpansion(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.google.api.Http.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.google.api.Http.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.google.api.Http} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.Http.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRulesList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.google.api.HttpRule.serializeBinaryToWriter - ); - } - f = message.getFullyDecodeReservedExpansion(); - if (f) { - writer.writeBool( - 2, - f - ); - } -}; - - -/** - * repeated HttpRule rules = 1; - * @return {!Array} - */ -proto.google.api.Http.prototype.getRulesList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.google.api.HttpRule, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.google.api.Http} returns this -*/ -proto.google.api.Http.prototype.setRulesList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.google.api.HttpRule=} opt_value - * @param {number=} opt_index - * @return {!proto.google.api.HttpRule} - */ -proto.google.api.Http.prototype.addRules = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.google.api.HttpRule, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.google.api.Http} returns this - */ -proto.google.api.Http.prototype.clearRulesList = function() { - return this.setRulesList([]); -}; - - -/** - * optional bool fully_decode_reserved_expansion = 2; - * @return {boolean} - */ -proto.google.api.Http.prototype.getFullyDecodeReservedExpansion = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.google.api.Http} returns this - */ -proto.google.api.Http.prototype.setFullyDecodeReservedExpansion = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.google.api.HttpRule.repeatedFields_ = [11]; - -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.google.api.HttpRule.oneofGroups_ = [[2,3,4,5,6,8]]; - -/** - * @enum {number} - */ -proto.google.api.HttpRule.PatternCase = { - PATTERN_NOT_SET: 0, - GET: 2, - PUT: 3, - POST: 4, - DELETE: 5, - PATCH: 6, - CUSTOM: 8 -}; - -/** - * @return {proto.google.api.HttpRule.PatternCase} - */ -proto.google.api.HttpRule.prototype.getPatternCase = function() { - return /** @type {proto.google.api.HttpRule.PatternCase} */(jspb.Message.computeOneofCase(this, proto.google.api.HttpRule.oneofGroups_[0])); -}; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.google.api.HttpRule.prototype.toObject = function(opt_includeInstance) { - return proto.google.api.HttpRule.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.google.api.HttpRule} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.HttpRule.toObject = function(includeInstance, msg) { - var f, obj = { - selector: jspb.Message.getFieldWithDefault(msg, 1, ""), - get: jspb.Message.getFieldWithDefault(msg, 2, ""), - put: jspb.Message.getFieldWithDefault(msg, 3, ""), - post: jspb.Message.getFieldWithDefault(msg, 4, ""), - pb_delete: jspb.Message.getFieldWithDefault(msg, 5, ""), - patch: jspb.Message.getFieldWithDefault(msg, 6, ""), - custom: (f = msg.getCustom()) && proto.google.api.CustomHttpPattern.toObject(includeInstance, f), - body: jspb.Message.getFieldWithDefault(msg, 7, ""), - responseBody: jspb.Message.getFieldWithDefault(msg, 12, ""), - additionalBindingsList: jspb.Message.toObjectList(msg.getAdditionalBindingsList(), - proto.google.api.HttpRule.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.google.api.HttpRule} - */ -proto.google.api.HttpRule.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.google.api.HttpRule; - return proto.google.api.HttpRule.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.google.api.HttpRule} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.google.api.HttpRule} - */ -proto.google.api.HttpRule.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.setSelector(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setGet(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setPut(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setPost(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setDelete(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setPatch(value); - break; - case 8: - var value = new proto.google.api.CustomHttpPattern; - reader.readMessage(value,proto.google.api.CustomHttpPattern.deserializeBinaryFromReader); - msg.setCustom(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setBody(value); - break; - case 12: - var value = /** @type {string} */ (reader.readString()); - msg.setResponseBody(value); - break; - case 11: - var value = new proto.google.api.HttpRule; - reader.readMessage(value,proto.google.api.HttpRule.deserializeBinaryFromReader); - msg.addAdditionalBindings(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.google.api.HttpRule.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.google.api.HttpRule.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.google.api.HttpRule} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.HttpRule.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSelector(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( - 2, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeString( - 3, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeString( - 4, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeString( - 5, - f - ); - } - f = /** @type {string} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeString( - 6, - f - ); - } - f = message.getCustom(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.google.api.CustomHttpPattern.serializeBinaryToWriter - ); - } - f = message.getBody(); - if (f.length > 0) { - writer.writeString( - 7, - f - ); - } - f = message.getResponseBody(); - if (f.length > 0) { - writer.writeString( - 12, - f - ); - } - f = message.getAdditionalBindingsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 11, - f, - proto.google.api.HttpRule.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string selector = 1; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getSelector = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setSelector = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string get = 2; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getGet = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setGet = function(value) { - return jspb.Message.setOneofField(this, 2, proto.google.api.HttpRule.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearGet = function() { - return jspb.Message.setOneofField(this, 2, proto.google.api.HttpRule.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.google.api.HttpRule.prototype.hasGet = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional string put = 3; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getPut = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setPut = function(value) { - return jspb.Message.setOneofField(this, 3, proto.google.api.HttpRule.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearPut = function() { - return jspb.Message.setOneofField(this, 3, proto.google.api.HttpRule.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.google.api.HttpRule.prototype.hasPut = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional string post = 4; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getPost = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setPost = function(value) { - return jspb.Message.setOneofField(this, 4, proto.google.api.HttpRule.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearPost = function() { - return jspb.Message.setOneofField(this, 4, proto.google.api.HttpRule.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.google.api.HttpRule.prototype.hasPost = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional string delete = 5; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getDelete = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setDelete = function(value) { - return jspb.Message.setOneofField(this, 5, proto.google.api.HttpRule.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearDelete = function() { - return jspb.Message.setOneofField(this, 5, proto.google.api.HttpRule.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.google.api.HttpRule.prototype.hasDelete = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional string patch = 6; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getPatch = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setPatch = function(value) { - return jspb.Message.setOneofField(this, 6, proto.google.api.HttpRule.oneofGroups_[0], value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearPatch = function() { - return jspb.Message.setOneofField(this, 6, proto.google.api.HttpRule.oneofGroups_[0], undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.google.api.HttpRule.prototype.hasPatch = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional CustomHttpPattern custom = 8; - * @return {?proto.google.api.CustomHttpPattern} - */ -proto.google.api.HttpRule.prototype.getCustom = function() { - return /** @type{?proto.google.api.CustomHttpPattern} */ ( - jspb.Message.getWrapperField(this, proto.google.api.CustomHttpPattern, 8)); -}; - - -/** - * @param {?proto.google.api.CustomHttpPattern|undefined} value - * @return {!proto.google.api.HttpRule} returns this -*/ -proto.google.api.HttpRule.prototype.setCustom = function(value) { - return jspb.Message.setOneofWrapperField(this, 8, proto.google.api.HttpRule.oneofGroups_[0], value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearCustom = function() { - return this.setCustom(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.google.api.HttpRule.prototype.hasCustom = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * optional string body = 7; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getBody = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setBody = function(value) { - return jspb.Message.setProto3StringField(this, 7, value); -}; - - -/** - * optional string response_body = 12; - * @return {string} - */ -proto.google.api.HttpRule.prototype.getResponseBody = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.setResponseBody = function(value) { - return jspb.Message.setProto3StringField(this, 12, value); -}; - - -/** - * repeated HttpRule additional_bindings = 11; - * @return {!Array} - */ -proto.google.api.HttpRule.prototype.getAdditionalBindingsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.google.api.HttpRule, 11)); -}; - - -/** - * @param {!Array} value - * @return {!proto.google.api.HttpRule} returns this -*/ -proto.google.api.HttpRule.prototype.setAdditionalBindingsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 11, value); -}; - - -/** - * @param {!proto.google.api.HttpRule=} opt_value - * @param {number=} opt_index - * @return {!proto.google.api.HttpRule} - */ -proto.google.api.HttpRule.prototype.addAdditionalBindings = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 11, opt_value, proto.google.api.HttpRule, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.google.api.HttpRule} returns this - */ -proto.google.api.HttpRule.prototype.clearAdditionalBindingsList = function() { - return this.setAdditionalBindingsList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.google.api.CustomHttpPattern.prototype.toObject = function(opt_includeInstance) { - return proto.google.api.CustomHttpPattern.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.google.api.CustomHttpPattern} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.CustomHttpPattern.toObject = function(includeInstance, msg) { - var f, obj = { - kind: jspb.Message.getFieldWithDefault(msg, 1, ""), - path: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.google.api.CustomHttpPattern} - */ -proto.google.api.CustomHttpPattern.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.google.api.CustomHttpPattern; - return proto.google.api.CustomHttpPattern.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.google.api.CustomHttpPattern} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.google.api.CustomHttpPattern} - */ -proto.google.api.CustomHttpPattern.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.setKind(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPath(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.google.api.CustomHttpPattern.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.google.api.CustomHttpPattern.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.google.api.CustomHttpPattern} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.CustomHttpPattern.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKind(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPath(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string kind = 1; - * @return {string} - */ -proto.google.api.CustomHttpPattern.prototype.getKind = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.CustomHttpPattern} returns this - */ -proto.google.api.CustomHttpPattern.prototype.setKind = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string path = 2; - * @return {string} - */ -proto.google.api.CustomHttpPattern.prototype.getPath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.CustomHttpPattern} returns this - */ -proto.google.api.CustomHttpPattern.prototype.setPath = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -goog.object.extend(exports, proto.google.api); diff --git a/mods/limiter/src/service/protos/google/api/httpbody_grpc_pb.js b/mods/limiter/src/service/protos/google/api/httpbody_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/google/api/httpbody_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/google/api/httpbody_pb.d.ts b/mods/limiter/src/service/protos/google/api/httpbody_pb.d.ts deleted file mode 100644 index 98d973068..000000000 --- a/mods/limiter/src/service/protos/google/api/httpbody_pb.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// package: google.api -// file: google/api/httpbody.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb"; - -export class HttpBody extends jspb.Message { - getContentType(): string; - setContentType(value: string): HttpBody; - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): HttpBody; - clearExtensionsList(): void; - getExtensionsList(): Array; - setExtensionsList(value: Array): HttpBody; - addExtensions(value?: google_protobuf_any_pb.Any, index?: number): google_protobuf_any_pb.Any; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): HttpBody.AsObject; - static toObject(includeInstance: boolean, msg: HttpBody): HttpBody.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: HttpBody, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): HttpBody; - static deserializeBinaryFromReader(message: HttpBody, reader: jspb.BinaryReader): HttpBody; -} - -export namespace HttpBody { - export type AsObject = { - contentType: string, - data: Uint8Array | string, - extensionsList: Array, - } -} diff --git a/mods/limiter/src/service/protos/google/api/httpbody_pb.js b/mods/limiter/src/service/protos/google/api/httpbody_pb.js deleted file mode 100644 index 5539f5936..000000000 --- a/mods/limiter/src/service/protos/google/api/httpbody_pb.js +++ /dev/null @@ -1,286 +0,0 @@ -// source: google/api/httpbody.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); -goog.object.extend(proto, google_protobuf_any_pb); -goog.exportSymbol('proto.google.api.HttpBody', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.google.api.HttpBody = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.HttpBody.repeatedFields_, null); -}; -goog.inherits(proto.google.api.HttpBody, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.google.api.HttpBody.displayName = 'proto.google.api.HttpBody'; -} - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.google.api.HttpBody.repeatedFields_ = [3]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.google.api.HttpBody.prototype.toObject = function(opt_includeInstance) { - return proto.google.api.HttpBody.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.google.api.HttpBody} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.HttpBody.toObject = function(includeInstance, msg) { - var f, obj = { - contentType: jspb.Message.getFieldWithDefault(msg, 1, ""), - data: msg.getData_asB64(), - extensionsList: jspb.Message.toObjectList(msg.getExtensionsList(), - google_protobuf_any_pb.Any.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.google.api.HttpBody} - */ -proto.google.api.HttpBody.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.google.api.HttpBody; - return proto.google.api.HttpBody.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.google.api.HttpBody} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.google.api.HttpBody} - */ -proto.google.api.HttpBody.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.setContentType(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - case 3: - var value = new google_protobuf_any_pb.Any; - reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); - msg.addExtensions(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.google.api.HttpBody.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.google.api.HttpBody.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.google.api.HttpBody} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.google.api.HttpBody.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getContentType(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } - f = message.getExtensionsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 3, - f, - google_protobuf_any_pb.Any.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string content_type = 1; - * @return {string} - */ -proto.google.api.HttpBody.prototype.getContentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.google.api.HttpBody} returns this - */ -proto.google.api.HttpBody.prototype.setContentType = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional bytes data = 2; - * @return {!(string|Uint8Array)} - */ -proto.google.api.HttpBody.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes data = 2; - * This is a type-conversion wrapper around `getData()` - * @return {string} - */ -proto.google.api.HttpBody.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - - -/** - * optional bytes data = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} - */ -proto.google.api.HttpBody.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.google.api.HttpBody} returns this - */ -proto.google.api.HttpBody.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - -/** - * repeated google.protobuf.Any extensions = 3; - * @return {!Array} - */ -proto.google.api.HttpBody.prototype.getExtensionsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.google.api.HttpBody} returns this -*/ -proto.google.api.HttpBody.prototype.setExtensionsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 3, value); -}; - - -/** - * @param {!proto.google.protobuf.Any=} opt_value - * @param {number=} opt_index - * @return {!proto.google.protobuf.Any} - */ -proto.google.api.HttpBody.prototype.addExtensions = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Any, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.google.api.HttpBody} returns this - */ -proto.google.api.HttpBody.prototype.clearExtensionsList = function() { - return this.setExtensionsList([]); -}; - - -goog.object.extend(exports, proto.google.api); diff --git a/mods/limiter/src/service/protos/limiter_grpc_pb.d.ts b/mods/limiter/src/service/protos/limiter_grpc_pb.d.ts deleted file mode 100644 index 74878b400..000000000 --- a/mods/limiter/src/service/protos/limiter_grpc_pb.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -// package: fonoster.limiter.v1beta1 -// file: limiter.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as grpc from "@grpc/grpc-js"; -import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call"; -import * as limiter_pb from "./limiter_pb"; - -interface ILimiterService extends grpc.ServiceDefinition { - checkAuthorized: ILimiterService_ICheckAuthorized; -} - -interface ILimiterService_ICheckAuthorized extends grpc.MethodDefinition { - path: "/fonoster.limiter.v1beta1.Limiter/CheckAuthorized"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} - -export const LimiterService: ILimiterService; - -export interface ILimiterServer extends grpc.UntypedServiceImplementation { - checkAuthorized: grpc.handleUnaryCall; -} - -export interface ILimiterClient { - checkAuthorized(request: limiter_pb.CheckAuthorizedRequest, callback: (error: grpc.ServiceError | null, response: limiter_pb.CheckAuthorizedResponse) => void): grpc.ClientUnaryCall; - checkAuthorized(request: limiter_pb.CheckAuthorizedRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: limiter_pb.CheckAuthorizedResponse) => void): grpc.ClientUnaryCall; - checkAuthorized(request: limiter_pb.CheckAuthorizedRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: limiter_pb.CheckAuthorizedResponse) => void): grpc.ClientUnaryCall; -} - -export class LimiterClient extends grpc.Client implements ILimiterClient { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); - public checkAuthorized(request: limiter_pb.CheckAuthorizedRequest, callback: (error: grpc.ServiceError | null, response: limiter_pb.CheckAuthorizedResponse) => void): grpc.ClientUnaryCall; - public checkAuthorized(request: limiter_pb.CheckAuthorizedRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: limiter_pb.CheckAuthorizedResponse) => void): grpc.ClientUnaryCall; - public checkAuthorized(request: limiter_pb.CheckAuthorizedRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: limiter_pb.CheckAuthorizedResponse) => void): grpc.ClientUnaryCall; -} diff --git a/mods/limiter/src/service/protos/limiter_grpc_pb.js b/mods/limiter/src/service/protos/limiter_grpc_pb.js deleted file mode 100644 index 3f62db9f9..000000000 --- a/mods/limiter/src/service/protos/limiter_grpc_pb.js +++ /dev/null @@ -1,51 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -// Original file comments: -// * -// MIT License -// Copyright (c) 2022 Fonoster Inc -// -// The Limiter proto is a simpler Resource Limiter that can be used to limit the number -// of resources that an User can have. -'use strict'; -var grpc = require('@grpc/grpc-js'); -var limiter_pb = require('./limiter_pb.js'); - -function serialize_fonoster_limiter_v1beta1_CheckAuthorizedRequest(arg) { - if (!(arg instanceof limiter_pb.CheckAuthorizedRequest)) { - throw new Error('Expected argument of type fonoster.limiter.v1beta1.CheckAuthorizedRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_fonoster_limiter_v1beta1_CheckAuthorizedRequest(buffer_arg) { - return limiter_pb.CheckAuthorizedRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_fonoster_limiter_v1beta1_CheckAuthorizedResponse(arg) { - if (!(arg instanceof limiter_pb.CheckAuthorizedResponse)) { - throw new Error('Expected argument of type fonoster.limiter.v1beta1.CheckAuthorizedResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_fonoster_limiter_v1beta1_CheckAuthorizedResponse(buffer_arg) { - return limiter_pb.CheckAuthorizedResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -var LimiterService = exports.LimiterService = { - checkAuthorized: { - path: '/fonoster.limiter.v1beta1.Limiter/CheckAuthorized', - requestStream: false, - responseStream: false, - requestType: limiter_pb.CheckAuthorizedRequest, - responseType: limiter_pb.CheckAuthorizedResponse, - requestSerialize: serialize_fonoster_limiter_v1beta1_CheckAuthorizedRequest, - requestDeserialize: deserialize_fonoster_limiter_v1beta1_CheckAuthorizedRequest, - responseSerialize: serialize_fonoster_limiter_v1beta1_CheckAuthorizedResponse, - responseDeserialize: deserialize_fonoster_limiter_v1beta1_CheckAuthorizedResponse, - }, -}; - -exports.LimiterClient = grpc.makeGenericClientConstructor(LimiterService); diff --git a/mods/limiter/src/service/protos/limiter_pb.d.ts b/mods/limiter/src/service/protos/limiter_pb.d.ts deleted file mode 100644 index 71655470b..000000000 --- a/mods/limiter/src/service/protos/limiter_pb.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// package: fonoster.limiter.v1beta1 -// file: limiter.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; - -export class CheckAuthorizedRequest extends jspb.Message { - getEndpoint(): string; - setEndpoint(value: string): CheckAuthorizedRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CheckAuthorizedRequest.AsObject; - static toObject(includeInstance: boolean, msg: CheckAuthorizedRequest): CheckAuthorizedRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: CheckAuthorizedRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CheckAuthorizedRequest; - static deserializeBinaryFromReader(message: CheckAuthorizedRequest, reader: jspb.BinaryReader): CheckAuthorizedRequest; -} - -export namespace CheckAuthorizedRequest { - export type AsObject = { - endpoint: string, - } -} - -export class CheckAuthorizedResponse extends jspb.Message { - getAuthorized(): boolean; - setAuthorized(value: boolean): CheckAuthorizedResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CheckAuthorizedResponse.AsObject; - static toObject(includeInstance: boolean, msg: CheckAuthorizedResponse): CheckAuthorizedResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: CheckAuthorizedResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CheckAuthorizedResponse; - static deserializeBinaryFromReader(message: CheckAuthorizedResponse, reader: jspb.BinaryReader): CheckAuthorizedResponse; -} - -export namespace CheckAuthorizedResponse { - export type AsObject = { - authorized: boolean, - } -} diff --git a/mods/limiter/src/service/protos/limiter_pb.js b/mods/limiter/src/service/protos/limiter_pb.js deleted file mode 100644 index 45723573e..000000000 --- a/mods/limiter/src/service/protos/limiter_pb.js +++ /dev/null @@ -1,322 +0,0 @@ -// source: limiter.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest', null, global); -goog.exportSymbol('proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.displayName = 'proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest'; -} -/** - * 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.fonoster.limiter.v1beta1.CheckAuthorizedResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.displayName = 'proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.prototype.toObject = function(opt_includeInstance) { - return proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.toObject = function(includeInstance, msg) { - var f, obj = { - endpoint: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest; - return proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.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.setEndpoint(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getEndpoint(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string endpoint = 1; - * @return {string} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.prototype.getEndpoint = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest} returns this - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedRequest.prototype.setEndpoint = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.prototype.toObject = function(opt_includeInstance) { - return proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.toObject = function(includeInstance, msg) { - var f, obj = { - authorized: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse; - return proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setAuthorized(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAuthorized(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool authorized = 1; - * @return {boolean} - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.prototype.getAuthorized = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse} returns this - */ -proto.fonoster.limiter.v1beta1.CheckAuthorizedResponse.prototype.setAuthorized = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - -goog.object.extend(exports, proto.fonoster.limiter.v1beta1); diff --git a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_grpc_pb.js b/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.d.ts b/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.d.ts deleted file mode 100644 index 8e3a35012..000000000 --- a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// package: grpc.gateway.protoc_gen_openapiv2.options -// file: protoc-gen-openapiv2/options/annotations.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as google_protobuf_descriptor_pb from "google-protobuf/google/protobuf/descriptor_pb"; -import * as protoc_gen_openapiv2_options_openapiv2_pb from "../../protoc-gen-openapiv2/options/openapiv2_pb"; - -export const openapiv2Swagger: jspb.ExtensionFieldInfo; - -export const openapiv2Operation: jspb.ExtensionFieldInfo; - -export const openapiv2Schema: jspb.ExtensionFieldInfo; - -export const openapiv2Tag: jspb.ExtensionFieldInfo; - -export const openapiv2Field: jspb.ExtensionFieldInfo; diff --git a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.js b/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.js deleted file mode 100644 index e92ccec18..000000000 --- a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/annotations_pb.js +++ /dev/null @@ -1,152 +0,0 @@ -// source: protoc-gen-openapiv2/options/annotations.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); -goog.object.extend(proto, google_protobuf_descriptor_pb); -var protoc$gen$openapiv2_options_openapiv2_pb = require('../../protoc-gen-openapiv2/options/openapiv2_pb.js'); -goog.object.extend(proto, protoc$gen$openapiv2_options_openapiv2_pb); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Field', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Operation', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Schema', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Swagger', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Tag', null, global); - -/** - * A tuple of {field number, class constructor} for the extension - * field named `openapiv2Swagger`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Swagger = new jspb.ExtensionFieldInfo( - 1042, - {openapiv2Swagger: 0}, - protoc$gen$openapiv2_options_openapiv2_pb.Swagger, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - protoc$gen$openapiv2_options_openapiv2_pb.Swagger.toObject), - 0); - -google_protobuf_descriptor_pb.FileOptions.extensionsBinary[1042] = new jspb.ExtensionFieldBinaryInfo( - proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Swagger, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - protoc$gen$openapiv2_options_openapiv2_pb.Swagger.serializeBinaryToWriter, - protoc$gen$openapiv2_options_openapiv2_pb.Swagger.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.FileOptions.extensions[1042] = proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Swagger; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `openapiv2Operation`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Operation = new jspb.ExtensionFieldInfo( - 1042, - {openapiv2Operation: 0}, - protoc$gen$openapiv2_options_openapiv2_pb.Operation, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - protoc$gen$openapiv2_options_openapiv2_pb.Operation.toObject), - 0); - -google_protobuf_descriptor_pb.MethodOptions.extensionsBinary[1042] = new jspb.ExtensionFieldBinaryInfo( - proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Operation, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - protoc$gen$openapiv2_options_openapiv2_pb.Operation.serializeBinaryToWriter, - protoc$gen$openapiv2_options_openapiv2_pb.Operation.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.MethodOptions.extensions[1042] = proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Operation; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `openapiv2Schema`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Schema = new jspb.ExtensionFieldInfo( - 1042, - {openapiv2Schema: 0}, - protoc$gen$openapiv2_options_openapiv2_pb.Schema, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - protoc$gen$openapiv2_options_openapiv2_pb.Schema.toObject), - 0); - -google_protobuf_descriptor_pb.MessageOptions.extensionsBinary[1042] = new jspb.ExtensionFieldBinaryInfo( - proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Schema, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - protoc$gen$openapiv2_options_openapiv2_pb.Schema.serializeBinaryToWriter, - protoc$gen$openapiv2_options_openapiv2_pb.Schema.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.MessageOptions.extensions[1042] = proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Schema; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `openapiv2Tag`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Tag = new jspb.ExtensionFieldInfo( - 1042, - {openapiv2Tag: 0}, - protoc$gen$openapiv2_options_openapiv2_pb.Tag, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - protoc$gen$openapiv2_options_openapiv2_pb.Tag.toObject), - 0); - -google_protobuf_descriptor_pb.ServiceOptions.extensionsBinary[1042] = new jspb.ExtensionFieldBinaryInfo( - proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Tag, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - protoc$gen$openapiv2_options_openapiv2_pb.Tag.serializeBinaryToWriter, - protoc$gen$openapiv2_options_openapiv2_pb.Tag.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.ServiceOptions.extensions[1042] = proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Tag; - - -/** - * A tuple of {field number, class constructor} for the extension - * field named `openapiv2Field`. - * @type {!jspb.ExtensionFieldInfo} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Field = new jspb.ExtensionFieldInfo( - 1042, - {openapiv2Field: 0}, - protoc$gen$openapiv2_options_openapiv2_pb.JSONSchema, - /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( - protoc$gen$openapiv2_options_openapiv2_pb.JSONSchema.toObject), - 0); - -google_protobuf_descriptor_pb.FieldOptions.extensionsBinary[1042] = new jspb.ExtensionFieldBinaryInfo( - proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Field, - jspb.BinaryReader.prototype.readMessage, - jspb.BinaryWriter.prototype.writeMessage, - protoc$gen$openapiv2_options_openapiv2_pb.JSONSchema.serializeBinaryToWriter, - protoc$gen$openapiv2_options_openapiv2_pb.JSONSchema.deserializeBinaryFromReader, - false); -// This registers the extension field with the extended class, so that -// toObject() will function correctly. -google_protobuf_descriptor_pb.FieldOptions.extensions[1042] = proto.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Field; - -goog.object.extend(exports, proto.grpc.gateway.protoc_gen_openapiv2.options); diff --git a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_grpc_pb.js b/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_grpc_pb.js deleted file mode 100644 index 97b3a2461..000000000 --- a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_grpc_pb.js +++ /dev/null @@ -1 +0,0 @@ -// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.d.ts b/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.d.ts deleted file mode 100644 index 3c3972ea9..000000000 --- a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.d.ts +++ /dev/null @@ -1,685 +0,0 @@ -// package: grpc.gateway.protoc_gen_openapiv2.options -// file: protoc-gen-openapiv2/options/openapiv2.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; - -export class Swagger extends jspb.Message { - getSwagger(): string; - setSwagger(value: string): Swagger; - - hasInfo(): boolean; - clearInfo(): void; - getInfo(): Info | undefined; - setInfo(value?: Info): Swagger; - getHost(): string; - setHost(value: string): Swagger; - getBasePath(): string; - setBasePath(value: string): Swagger; - clearSchemesList(): void; - getSchemesList(): Array; - setSchemesList(value: Array): Swagger; - addSchemes(value: Scheme, index?: number): Scheme; - clearConsumesList(): void; - getConsumesList(): Array; - setConsumesList(value: Array): Swagger; - addConsumes(value: string, index?: number): string; - clearProducesList(): void; - getProducesList(): Array; - setProducesList(value: Array): Swagger; - addProduces(value: string, index?: number): string; - - getResponsesMap(): jspb.Map; - clearResponsesMap(): void; - - hasSecurityDefinitions(): boolean; - clearSecurityDefinitions(): void; - getSecurityDefinitions(): SecurityDefinitions | undefined; - setSecurityDefinitions(value?: SecurityDefinitions): Swagger; - clearSecurityList(): void; - getSecurityList(): Array; - setSecurityList(value: Array): Swagger; - addSecurity(value?: SecurityRequirement, index?: number): SecurityRequirement; - - hasExternalDocs(): boolean; - clearExternalDocs(): void; - getExternalDocs(): ExternalDocumentation | undefined; - setExternalDocs(value?: ExternalDocumentation): Swagger; - - getExtensionsMap(): jspb.Map; - clearExtensionsMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Swagger.AsObject; - static toObject(includeInstance: boolean, msg: Swagger): Swagger.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Swagger, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Swagger; - static deserializeBinaryFromReader(message: Swagger, reader: jspb.BinaryReader): Swagger; -} - -export namespace Swagger { - export type AsObject = { - swagger: string, - info?: Info.AsObject, - host: string, - basePath: string, - schemesList: Array, - consumesList: Array, - producesList: Array, - - responsesMap: Array<[string, Response.AsObject]>, - securityDefinitions?: SecurityDefinitions.AsObject, - securityList: Array, - externalDocs?: ExternalDocumentation.AsObject, - - extensionsMap: Array<[string, google_protobuf_struct_pb.Value.AsObject]>, - } -} - -export class Operation extends jspb.Message { - clearTagsList(): void; - getTagsList(): Array; - setTagsList(value: Array): Operation; - addTags(value: string, index?: number): string; - getSummary(): string; - setSummary(value: string): Operation; - getDescription(): string; - setDescription(value: string): Operation; - - hasExternalDocs(): boolean; - clearExternalDocs(): void; - getExternalDocs(): ExternalDocumentation | undefined; - setExternalDocs(value?: ExternalDocumentation): Operation; - getOperationId(): string; - setOperationId(value: string): Operation; - clearConsumesList(): void; - getConsumesList(): Array; - setConsumesList(value: Array): Operation; - addConsumes(value: string, index?: number): string; - clearProducesList(): void; - getProducesList(): Array; - setProducesList(value: Array): Operation; - addProduces(value: string, index?: number): string; - - getResponsesMap(): jspb.Map; - clearResponsesMap(): void; - clearSchemesList(): void; - getSchemesList(): Array; - setSchemesList(value: Array): Operation; - addSchemes(value: Scheme, index?: number): Scheme; - getDeprecated(): boolean; - setDeprecated(value: boolean): Operation; - clearSecurityList(): void; - getSecurityList(): Array; - setSecurityList(value: Array): Operation; - addSecurity(value?: SecurityRequirement, index?: number): SecurityRequirement; - - getExtensionsMap(): jspb.Map; - clearExtensionsMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Operation.AsObject; - static toObject(includeInstance: boolean, msg: Operation): Operation.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Operation, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Operation; - static deserializeBinaryFromReader(message: Operation, reader: jspb.BinaryReader): Operation; -} - -export namespace Operation { - export type AsObject = { - tagsList: Array, - summary: string, - description: string, - externalDocs?: ExternalDocumentation.AsObject, - operationId: string, - consumesList: Array, - producesList: Array, - - responsesMap: Array<[string, Response.AsObject]>, - schemesList: Array, - deprecated: boolean, - securityList: Array, - - extensionsMap: Array<[string, google_protobuf_struct_pb.Value.AsObject]>, - } -} - -export class Header extends jspb.Message { - getDescription(): string; - setDescription(value: string): Header; - getType(): string; - setType(value: string): Header; - getFormat(): string; - setFormat(value: string): Header; - getDefault(): string; - setDefault(value: string): Header; - getPattern(): string; - setPattern(value: string): Header; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Header.AsObject; - static toObject(includeInstance: boolean, msg: Header): Header.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Header, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Header; - static deserializeBinaryFromReader(message: Header, reader: jspb.BinaryReader): Header; -} - -export namespace Header { - export type AsObject = { - description: string, - type: string, - format: string, - pb_default: string, - pattern: string, - } -} - -export class Response extends jspb.Message { - getDescription(): string; - setDescription(value: string): Response; - - hasSchema(): boolean; - clearSchema(): void; - getSchema(): Schema | undefined; - setSchema(value?: Schema): Response; - - getHeadersMap(): jspb.Map; - clearHeadersMap(): void; - - getExamplesMap(): jspb.Map; - clearExamplesMap(): void; - - getExtensionsMap(): jspb.Map; - clearExtensionsMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Response.AsObject; - static toObject(includeInstance: boolean, msg: Response): Response.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Response, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Response; - static deserializeBinaryFromReader(message: Response, reader: jspb.BinaryReader): Response; -} - -export namespace Response { - export type AsObject = { - description: string, - schema?: Schema.AsObject, - - headersMap: Array<[string, Header.AsObject]>, - - examplesMap: Array<[string, string]>, - - extensionsMap: Array<[string, google_protobuf_struct_pb.Value.AsObject]>, - } -} - -export class Info extends jspb.Message { - getTitle(): string; - setTitle(value: string): Info; - getDescription(): string; - setDescription(value: string): Info; - getTermsOfService(): string; - setTermsOfService(value: string): Info; - - hasContact(): boolean; - clearContact(): void; - getContact(): Contact | undefined; - setContact(value?: Contact): Info; - - hasLicense(): boolean; - clearLicense(): void; - getLicense(): License | undefined; - setLicense(value?: License): Info; - getVersion(): string; - setVersion(value: string): Info; - - getExtensionsMap(): jspb.Map; - clearExtensionsMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Info.AsObject; - static toObject(includeInstance: boolean, msg: Info): Info.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Info, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Info; - static deserializeBinaryFromReader(message: Info, reader: jspb.BinaryReader): Info; -} - -export namespace Info { - export type AsObject = { - title: string, - description: string, - termsOfService: string, - contact?: Contact.AsObject, - license?: License.AsObject, - version: string, - - extensionsMap: Array<[string, google_protobuf_struct_pb.Value.AsObject]>, - } -} - -export class Contact extends jspb.Message { - getName(): string; - setName(value: string): Contact; - getUrl(): string; - setUrl(value: string): Contact; - getEmail(): string; - setEmail(value: string): Contact; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Contact.AsObject; - static toObject(includeInstance: boolean, msg: Contact): Contact.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Contact, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Contact; - static deserializeBinaryFromReader(message: Contact, reader: jspb.BinaryReader): Contact; -} - -export namespace Contact { - export type AsObject = { - name: string, - url: string, - email: string, - } -} - -export class License extends jspb.Message { - getName(): string; - setName(value: string): License; - getUrl(): string; - setUrl(value: string): License; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): License.AsObject; - static toObject(includeInstance: boolean, msg: License): License.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: License, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): License; - static deserializeBinaryFromReader(message: License, reader: jspb.BinaryReader): License; -} - -export namespace License { - export type AsObject = { - name: string, - url: string, - } -} - -export class ExternalDocumentation extends jspb.Message { - getDescription(): string; - setDescription(value: string): ExternalDocumentation; - getUrl(): string; - setUrl(value: string): ExternalDocumentation; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ExternalDocumentation.AsObject; - static toObject(includeInstance: boolean, msg: ExternalDocumentation): ExternalDocumentation.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ExternalDocumentation, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ExternalDocumentation; - static deserializeBinaryFromReader(message: ExternalDocumentation, reader: jspb.BinaryReader): ExternalDocumentation; -} - -export namespace ExternalDocumentation { - export type AsObject = { - description: string, - url: string, - } -} - -export class Schema extends jspb.Message { - - hasJsonSchema(): boolean; - clearJsonSchema(): void; - getJsonSchema(): JSONSchema | undefined; - setJsonSchema(value?: JSONSchema): Schema; - getDiscriminator(): string; - setDiscriminator(value: string): Schema; - getReadOnly(): boolean; - setReadOnly(value: boolean): Schema; - - hasExternalDocs(): boolean; - clearExternalDocs(): void; - getExternalDocs(): ExternalDocumentation | undefined; - setExternalDocs(value?: ExternalDocumentation): Schema; - getExample(): string; - setExample(value: string): Schema; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Schema.AsObject; - static toObject(includeInstance: boolean, msg: Schema): Schema.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Schema, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Schema; - static deserializeBinaryFromReader(message: Schema, reader: jspb.BinaryReader): Schema; -} - -export namespace Schema { - export type AsObject = { - jsonSchema?: JSONSchema.AsObject, - discriminator: string, - readOnly: boolean, - externalDocs?: ExternalDocumentation.AsObject, - example: string, - } -} - -export class JSONSchema extends jspb.Message { - getRef(): string; - setRef(value: string): JSONSchema; - getTitle(): string; - setTitle(value: string): JSONSchema; - getDescription(): string; - setDescription(value: string): JSONSchema; - getDefault(): string; - setDefault(value: string): JSONSchema; - getReadOnly(): boolean; - setReadOnly(value: boolean): JSONSchema; - getExample(): string; - setExample(value: string): JSONSchema; - getMultipleOf(): number; - setMultipleOf(value: number): JSONSchema; - getMaximum(): number; - setMaximum(value: number): JSONSchema; - getExclusiveMaximum(): boolean; - setExclusiveMaximum(value: boolean): JSONSchema; - getMinimum(): number; - setMinimum(value: number): JSONSchema; - getExclusiveMinimum(): boolean; - setExclusiveMinimum(value: boolean): JSONSchema; - getMaxLength(): number; - setMaxLength(value: number): JSONSchema; - getMinLength(): number; - setMinLength(value: number): JSONSchema; - getPattern(): string; - setPattern(value: string): JSONSchema; - getMaxItems(): number; - setMaxItems(value: number): JSONSchema; - getMinItems(): number; - setMinItems(value: number): JSONSchema; - getUniqueItems(): boolean; - setUniqueItems(value: boolean): JSONSchema; - getMaxProperties(): number; - setMaxProperties(value: number): JSONSchema; - getMinProperties(): number; - setMinProperties(value: number): JSONSchema; - clearRequiredList(): void; - getRequiredList(): Array; - setRequiredList(value: Array): JSONSchema; - addRequired(value: string, index?: number): string; - clearArrayList(): void; - getArrayList(): Array; - setArrayList(value: Array): JSONSchema; - addArray(value: string, index?: number): string; - clearTypeList(): void; - getTypeList(): Array; - setTypeList(value: Array): JSONSchema; - addType(value: JSONSchema.JSONSchemaSimpleTypes, index?: number): JSONSchema.JSONSchemaSimpleTypes; - getFormat(): string; - setFormat(value: string): JSONSchema; - clearEnumList(): void; - getEnumList(): Array; - setEnumList(value: Array): JSONSchema; - addEnum(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): JSONSchema.AsObject; - static toObject(includeInstance: boolean, msg: JSONSchema): JSONSchema.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: JSONSchema, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): JSONSchema; - static deserializeBinaryFromReader(message: JSONSchema, reader: jspb.BinaryReader): JSONSchema; -} - -export namespace JSONSchema { - export type AsObject = { - ref: string, - title: string, - description: string, - pb_default: string, - readOnly: boolean, - example: string, - multipleOf: number, - maximum: number, - exclusiveMaximum: boolean, - minimum: number, - exclusiveMinimum: boolean, - maxLength: number, - minLength: number, - pattern: string, - maxItems: number, - minItems: number, - uniqueItems: boolean, - maxProperties: number, - minProperties: number, - requiredList: Array, - arrayList: Array, - typeList: Array, - format: string, - pb_enumList: Array, - } - - export enum JSONSchemaSimpleTypes { - UNKNOWN = 0, - ARRAY = 1, - BOOLEAN = 2, - INTEGER = 3, - NULL = 4, - NUMBER = 5, - OBJECT = 6, - STRING = 7, - } - -} - -export class Tag extends jspb.Message { - getDescription(): string; - setDescription(value: string): Tag; - - hasExternalDocs(): boolean; - clearExternalDocs(): void; - getExternalDocs(): ExternalDocumentation | undefined; - setExternalDocs(value?: ExternalDocumentation): Tag; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Tag.AsObject; - static toObject(includeInstance: boolean, msg: Tag): Tag.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Tag, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Tag; - static deserializeBinaryFromReader(message: Tag, reader: jspb.BinaryReader): Tag; -} - -export namespace Tag { - export type AsObject = { - description: string, - externalDocs?: ExternalDocumentation.AsObject, - } -} - -export class SecurityDefinitions extends jspb.Message { - - getSecurityMap(): jspb.Map; - clearSecurityMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecurityDefinitions.AsObject; - static toObject(includeInstance: boolean, msg: SecurityDefinitions): SecurityDefinitions.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecurityDefinitions, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecurityDefinitions; - static deserializeBinaryFromReader(message: SecurityDefinitions, reader: jspb.BinaryReader): SecurityDefinitions; -} - -export namespace SecurityDefinitions { - export type AsObject = { - - securityMap: Array<[string, SecurityScheme.AsObject]>, - } -} - -export class SecurityScheme extends jspb.Message { - getType(): SecurityScheme.Type; - setType(value: SecurityScheme.Type): SecurityScheme; - getDescription(): string; - setDescription(value: string): SecurityScheme; - getName(): string; - setName(value: string): SecurityScheme; - getIn(): SecurityScheme.In; - setIn(value: SecurityScheme.In): SecurityScheme; - getFlow(): SecurityScheme.Flow; - setFlow(value: SecurityScheme.Flow): SecurityScheme; - getAuthorizationUrl(): string; - setAuthorizationUrl(value: string): SecurityScheme; - getTokenUrl(): string; - setTokenUrl(value: string): SecurityScheme; - - hasScopes(): boolean; - clearScopes(): void; - getScopes(): Scopes | undefined; - setScopes(value?: Scopes): SecurityScheme; - - getExtensionsMap(): jspb.Map; - clearExtensionsMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecurityScheme.AsObject; - static toObject(includeInstance: boolean, msg: SecurityScheme): SecurityScheme.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecurityScheme, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecurityScheme; - static deserializeBinaryFromReader(message: SecurityScheme, reader: jspb.BinaryReader): SecurityScheme; -} - -export namespace SecurityScheme { - export type AsObject = { - type: SecurityScheme.Type, - description: string, - name: string, - pb_in: SecurityScheme.In, - flow: SecurityScheme.Flow, - authorizationUrl: string, - tokenUrl: string, - scopes?: Scopes.AsObject, - - extensionsMap: Array<[string, google_protobuf_struct_pb.Value.AsObject]>, - } - - export enum Type { - TYPE_INVALID = 0, - TYPE_BASIC = 1, - TYPE_API_KEY = 2, - TYPE_OAUTH2 = 3, - } - - export enum In { - IN_INVALID = 0, - IN_QUERY = 1, - IN_HEADER = 2, - } - - export enum Flow { - FLOW_INVALID = 0, - FLOW_IMPLICIT = 1, - FLOW_PASSWORD = 2, - FLOW_APPLICATION = 3, - FLOW_ACCESS_CODE = 4, - } - -} - -export class SecurityRequirement extends jspb.Message { - - getSecurityRequirementMap(): jspb.Map; - clearSecurityRequirementMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecurityRequirement.AsObject; - static toObject(includeInstance: boolean, msg: SecurityRequirement): SecurityRequirement.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecurityRequirement, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecurityRequirement; - static deserializeBinaryFromReader(message: SecurityRequirement, reader: jspb.BinaryReader): SecurityRequirement; -} - -export namespace SecurityRequirement { - export type AsObject = { - - securityRequirementMap: Array<[string, SecurityRequirement.SecurityRequirementValue.AsObject]>, - } - - - export class SecurityRequirementValue extends jspb.Message { - clearScopeList(): void; - getScopeList(): Array; - setScopeList(value: Array): SecurityRequirementValue; - addScope(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecurityRequirementValue.AsObject; - static toObject(includeInstance: boolean, msg: SecurityRequirementValue): SecurityRequirementValue.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecurityRequirementValue, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecurityRequirementValue; - static deserializeBinaryFromReader(message: SecurityRequirementValue, reader: jspb.BinaryReader): SecurityRequirementValue; - } - - export namespace SecurityRequirementValue { - export type AsObject = { - scopeList: Array, - } - } - -} - -export class Scopes extends jspb.Message { - - getScopeMap(): jspb.Map; - clearScopeMap(): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Scopes.AsObject; - static toObject(includeInstance: boolean, msg: Scopes): Scopes.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Scopes, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Scopes; - static deserializeBinaryFromReader(message: Scopes, reader: jspb.BinaryReader): Scopes; -} - -export namespace Scopes { - export type AsObject = { - - scopeMap: Array<[string, string]>, - } -} - -export enum Scheme { - UNKNOWN = 0, - HTTP = 1, - HTTPS = 2, - WS = 3, - WSS = 4, -} diff --git a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.js b/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.js deleted file mode 100644 index be8a6bfd2..000000000 --- a/mods/limiter/src/service/protos/protoc-gen-openapiv2/options/openapiv2_pb.js +++ /dev/null @@ -1,5367 +0,0 @@ -// source: protoc-gen-openapiv2/options/openapiv2.proto -/** - * @fileoverview - * @enhanceable - * @suppress {missingRequire} reports error on implicit type usages. - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -goog.object.extend(proto, google_protobuf_struct_pb); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Contact', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Header', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Info', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.License', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Operation', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Response', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Schema', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Scheme', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger', null, global); -goog.exportSymbol('proto.grpc.gateway.protoc_gen_openapiv2.options.Tag', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.repeatedFields_, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Operation = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.repeatedFields_, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Operation, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Operation'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Header = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Header, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Header.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Header'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Response = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Response, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Response.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Response'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Info = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Info, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Info.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Info'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Contact = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Contact, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Contact'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.License = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.License, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.License.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.License'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Schema = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Schema, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Schema'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.repeatedFields_, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Tag = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Tag, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Tag'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.repeatedFields_, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue'; -} -/** - * 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.grpc.gateway.protoc_gen_openapiv2.options.Scopes = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.displayName = 'proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes'; -} - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.repeatedFields_ = [5,6,7,12]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.toObject = function(includeInstance, msg) { - var f, obj = { - swagger: jspb.Message.getFieldWithDefault(msg, 1, ""), - info: (f = msg.getInfo()) && proto.grpc.gateway.protoc_gen_openapiv2.options.Info.toObject(includeInstance, f), - host: jspb.Message.getFieldWithDefault(msg, 3, ""), - basePath: jspb.Message.getFieldWithDefault(msg, 4, ""), - schemesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, - consumesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - producesList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - responsesMap: (f = msg.getResponsesMap()) ? f.toObject(includeInstance, proto.grpc.gateway.protoc_gen_openapiv2.options.Response.toObject) : [], - securityDefinitions: (f = msg.getSecurityDefinitions()) && proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.toObject(includeInstance, f), - securityList: jspb.Message.toObjectList(msg.getSecurityList(), - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.toObject, includeInstance), - externalDocs: (f = msg.getExternalDocs()) && proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.toObject(includeInstance, f), - extensionsMap: (f = msg.getExtensionsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.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.setSwagger(value); - break; - case 2: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.Info; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.Info.deserializeBinaryFromReader); - msg.setInfo(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setHost(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setBasePath(value); - break; - case 5: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); - for (var i = 0; i < values.length; i++) { - msg.addSchemes(values[i]); - } - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.addConsumes(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.addProduces(value); - break; - case 10: - var value = msg.getResponsesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.Response.deserializeBinaryFromReader, "", new proto.grpc.gateway.protoc_gen_openapiv2.options.Response()); - }); - break; - case 11: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.deserializeBinaryFromReader); - msg.setSecurityDefinitions(value); - break; - case 12: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.deserializeBinaryFromReader); - msg.addSecurity(value); - break; - case 14: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.deserializeBinaryFromReader); - msg.setExternalDocs(value); - break; - case 15: - var value = msg.getExtensionsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSwagger(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getInfo(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.Info.serializeBinaryToWriter - ); - } - f = message.getHost(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getBasePath(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getSchemesList(); - if (f.length > 0) { - writer.writePackedEnum( - 5, - f - ); - } - f = message.getConsumesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 6, - f - ); - } - f = message.getProducesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 7, - f - ); - } - f = message.getResponsesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.Response.serializeBinaryToWriter); - } - f = message.getSecurityDefinitions(); - if (f != null) { - writer.writeMessage( - 11, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.serializeBinaryToWriter - ); - } - f = message.getSecurityList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 12, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.serializeBinaryToWriter - ); - } - f = message.getExternalDocs(); - if (f != null) { - writer.writeMessage( - 14, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.serializeBinaryToWriter - ); - } - f = message.getExtensionsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(15, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter); - } -}; - - -/** - * optional string swagger = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getSwagger = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setSwagger = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional Info info = 2; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.Info} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getInfo = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.Info} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.Info, 2)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.Info|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setInfo = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearInfo = function() { - return this.setInfo(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.hasInfo = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional string host = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getHost = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setHost = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string base_path = 4; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getBasePath = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setBasePath = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * repeated Scheme schemes = 5; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getSchemesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setSchemesList = function(value) { - return jspb.Message.setField(this, 5, value || []); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scheme} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.addSchemes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 5, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearSchemesList = function() { - return this.setSchemesList([]); -}; - - -/** - * repeated string consumes = 6; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getConsumesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setConsumesList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.addConsumes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearConsumesList = function() { - return this.setConsumesList([]); -}; - - -/** - * repeated string produces = 7; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getProducesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setProducesList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.addProduces = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearProducesList = function() { - return this.setProducesList([]); -}; - - -/** - * map responses = 10; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getResponsesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 10, opt_noLazyCreate, - proto.grpc.gateway.protoc_gen_openapiv2.options.Response)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearResponsesMap = function() { - this.getResponsesMap().clear(); - return this;}; - - -/** - * optional SecurityDefinitions security_definitions = 11; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getSecurityDefinitions = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions, 11)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setSecurityDefinitions = function(value) { - return jspb.Message.setWrapperField(this, 11, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearSecurityDefinitions = function() { - return this.setSecurityDefinitions(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.hasSecurityDefinitions = function() { - return jspb.Message.getField(this, 11) != null; -}; - - -/** - * repeated SecurityRequirement security = 12; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getSecurityList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement, 12)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setSecurityList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 12, value); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement=} opt_value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.addSecurity = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearSecurityList = function() { - return this.setSecurityList([]); -}; - - -/** - * optional ExternalDocumentation external_docs = 14; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getExternalDocs = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation, 14)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.setExternalDocs = function(value) { - return jspb.Message.setWrapperField(this, 14, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearExternalDocs = function() { - return this.setExternalDocs(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.hasExternalDocs = function() { - return jspb.Message.getField(this, 14) != null; -}; - - -/** - * map extensions = 15; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.getExtensionsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 15, opt_noLazyCreate, - proto.google.protobuf.Value)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Swagger.prototype.clearExtensionsMap = function() { - this.getExtensionsMap().clear(); - return this;}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.repeatedFields_ = [1,6,7,10,12]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.toObject = function(includeInstance, msg) { - var f, obj = { - tagsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, - summary: jspb.Message.getFieldWithDefault(msg, 2, ""), - description: jspb.Message.getFieldWithDefault(msg, 3, ""), - externalDocs: (f = msg.getExternalDocs()) && proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.toObject(includeInstance, f), - operationId: jspb.Message.getFieldWithDefault(msg, 5, ""), - consumesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, - producesList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, - responsesMap: (f = msg.getResponsesMap()) ? f.toObject(includeInstance, proto.grpc.gateway.protoc_gen_openapiv2.options.Response.toObject) : [], - schemesList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, - deprecated: jspb.Message.getBooleanFieldWithDefault(msg, 11, false), - securityList: jspb.Message.toObjectList(msg.getSecurityList(), - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.toObject, includeInstance), - extensionsMap: (f = msg.getExtensionsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Operation; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.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.addTags(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setSummary(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 4: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.deserializeBinaryFromReader); - msg.setExternalDocs(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setOperationId(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.addConsumes(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.addProduces(value); - break; - case 9: - var value = msg.getResponsesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.Response.deserializeBinaryFromReader, "", new proto.grpc.gateway.protoc_gen_openapiv2.options.Response()); - }); - break; - case 10: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); - for (var i = 0; i < values.length; i++) { - msg.addSchemes(values[i]); - } - break; - case 11: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDeprecated(value); - break; - case 12: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.deserializeBinaryFromReader); - msg.addSecurity(value); - break; - case 13: - var value = msg.getExtensionsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTagsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } - f = message.getSummary(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getExternalDocs(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.serializeBinaryToWriter - ); - } - f = message.getOperationId(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getConsumesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 6, - f - ); - } - f = message.getProducesList(); - if (f.length > 0) { - writer.writeRepeatedString( - 7, - f - ); - } - f = message.getResponsesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.Response.serializeBinaryToWriter); - } - f = message.getSchemesList(); - if (f.length > 0) { - writer.writePackedEnum( - 10, - f - ); - } - f = message.getDeprecated(); - if (f) { - writer.writeBool( - 11, - f - ); - } - f = message.getSecurityList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 12, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.serializeBinaryToWriter - ); - } - f = message.getExtensionsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(13, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter); - } -}; - - -/** - * repeated string tags = 1; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getTagsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setTagsList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.addTags = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearTagsList = function() { - return this.setTagsList([]); -}; - - -/** - * optional string summary = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getSummary = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setSummary = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string description = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional ExternalDocumentation external_docs = 4; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getExternalDocs = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation, 4)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setExternalDocs = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearExternalDocs = function() { - return this.setExternalDocs(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.hasExternalDocs = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional string operation_id = 5; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getOperationId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setOperationId = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * repeated string consumes = 6; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getConsumesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setConsumesList = function(value) { - return jspb.Message.setField(this, 6, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.addConsumes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 6, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearConsumesList = function() { - return this.setConsumesList([]); -}; - - -/** - * repeated string produces = 7; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getProducesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setProducesList = function(value) { - return jspb.Message.setField(this, 7, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.addProduces = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 7, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearProducesList = function() { - return this.setProducesList([]); -}; - - -/** - * map responses = 9; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getResponsesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 9, opt_noLazyCreate, - proto.grpc.gateway.protoc_gen_openapiv2.options.Response)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearResponsesMap = function() { - this.getResponsesMap().clear(); - return this;}; - - -/** - * repeated Scheme schemes = 10; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getSchemesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setSchemesList = function(value) { - return jspb.Message.setField(this, 10, value || []); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scheme} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.addSchemes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 10, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearSchemesList = function() { - return this.setSchemesList([]); -}; - - -/** - * optional bool deprecated = 11; - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getDeprecated = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setDeprecated = function(value) { - return jspb.Message.setProto3BooleanField(this, 11, value); -}; - - -/** - * repeated SecurityRequirement security = 12; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getSecurityList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement, 12)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.setSecurityList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 12, value); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement=} opt_value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.addSecurity = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearSecurityList = function() { - return this.setSecurityList([]); -}; - - -/** - * map extensions = 13; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.getExtensionsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 13, opt_noLazyCreate, - proto.google.protobuf.Value)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Operation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Operation.prototype.clearExtensionsMap = function() { - this.getExtensionsMap().clear(); - return this;}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Header.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.toObject = function(includeInstance, msg) { - var f, obj = { - description: jspb.Message.getFieldWithDefault(msg, 1, ""), - type: jspb.Message.getFieldWithDefault(msg, 2, ""), - format: jspb.Message.getFieldWithDefault(msg, 3, ""), - pb_default: jspb.Message.getFieldWithDefault(msg, 6, ""), - pattern: jspb.Message.getFieldWithDefault(msg, 13, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Header; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Header.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.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.setDescription(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setType(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setFormat(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setDefault(value); - break; - case 13: - var value = /** @type {string} */ (reader.readString()); - msg.setPattern(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Header.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getFormat(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getDefault(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getPattern(); - if (f.length > 0) { - writer.writeString( - 13, - f - ); - } -}; - - -/** - * optional string description = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string type = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.getType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.setType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string format = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.getFormat = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.setFormat = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string default = 6; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.getDefault = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.setDefault = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional string pattern = 13; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.getPattern = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 13, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Header} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Header.prototype.setPattern = function(value) { - return jspb.Message.setProto3StringField(this, 13, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Response.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.toObject = function(includeInstance, msg) { - var f, obj = { - description: jspb.Message.getFieldWithDefault(msg, 1, ""), - schema: (f = msg.getSchema()) && proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.toObject(includeInstance, f), - headersMap: (f = msg.getHeadersMap()) ? f.toObject(includeInstance, proto.grpc.gateway.protoc_gen_openapiv2.options.Header.toObject) : [], - examplesMap: (f = msg.getExamplesMap()) ? f.toObject(includeInstance, undefined) : [], - extensionsMap: (f = msg.getExtensionsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Response; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Response.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.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.setDescription(value); - break; - case 2: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.Schema; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.deserializeBinaryFromReader); - msg.setSchema(value); - break; - case 3: - var value = msg.getHeadersMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.Header.deserializeBinaryFromReader, "", new proto.grpc.gateway.protoc_gen_openapiv2.options.Header()); - }); - break; - case 4: - var value = msg.getExamplesMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 5: - var value = msg.getExtensionsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Response.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getSchema(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.serializeBinaryToWriter - ); - } - f = message.getHeadersMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.Header.serializeBinaryToWriter); - } - f = message.getExamplesMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } - f = message.getExtensionsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter); - } -}; - - -/** - * optional string description = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional Schema schema = 2; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.getSchema = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.Schema, 2)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.Schema|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.setSchema = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.clearSchema = function() { - return this.setSchema(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.hasSchema = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * map headers = 3; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.getHeadersMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 3, opt_noLazyCreate, - proto.grpc.gateway.protoc_gen_openapiv2.options.Header)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.clearHeadersMap = function() { - this.getHeadersMap().clear(); - return this;}; - - -/** - * map examples = 4; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.getExamplesMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 4, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.clearExamplesMap = function() { - this.getExamplesMap().clear(); - return this;}; - - -/** - * map extensions = 5; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.getExtensionsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - proto.google.protobuf.Value)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Response} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Response.prototype.clearExtensionsMap = function() { - this.getExtensionsMap().clear(); - return this;}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Info.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.toObject = function(includeInstance, msg) { - var f, obj = { - title: jspb.Message.getFieldWithDefault(msg, 1, ""), - description: jspb.Message.getFieldWithDefault(msg, 2, ""), - termsOfService: jspb.Message.getFieldWithDefault(msg, 3, ""), - contact: (f = msg.getContact()) && proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.toObject(includeInstance, f), - license: (f = msg.getLicense()) && proto.grpc.gateway.protoc_gen_openapiv2.options.License.toObject(includeInstance, f), - version: jspb.Message.getFieldWithDefault(msg, 6, ""), - extensionsMap: (f = msg.getExtensionsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Info; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Info.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.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.setTitle(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setTermsOfService(value); - break; - case 4: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.Contact; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.deserializeBinaryFromReader); - msg.setContact(value); - break; - case 5: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.License; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.License.deserializeBinaryFromReader); - msg.setLicense(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setVersion(value); - break; - case 7: - var value = msg.getExtensionsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Info.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTitle(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getTermsOfService(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getContact(); - if (f != null) { - writer.writeMessage( - 4, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.serializeBinaryToWriter - ); - } - f = message.getLicense(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.License.serializeBinaryToWriter - ); - } - f = message.getVersion(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getExtensionsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(7, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter); - } -}; - - -/** - * optional string title = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getTitle = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.setTitle = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string description = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string terms_of_service = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getTermsOfService = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.setTermsOfService = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional Contact contact = 4; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getContact = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.Contact, 4)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.Contact|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.setContact = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.clearContact = function() { - return this.setContact(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.hasContact = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional License license = 5; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.License} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getLicense = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.License} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.License, 5)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.License|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.setLicense = function(value) { - return jspb.Message.setWrapperField(this, 5, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.clearLicense = function() { - return this.setLicense(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.hasLicense = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional string version = 6; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getVersion = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.setVersion = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * map extensions = 7; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.getExtensionsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 7, opt_noLazyCreate, - proto.google.protobuf.Value)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Info} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Info.prototype.clearExtensionsMap = function() { - this.getExtensionsMap().clear(); - return this;}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - url: jspb.Message.getFieldWithDefault(msg, 2, ""), - email: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Contact; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.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 = /** @type {string} */ (reader.readString()); - msg.setUrl(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setEmail(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getEmail(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string url = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.setUrl = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string email = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.getEmail = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Contact} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Contact.prototype.setEmail = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.License.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - url: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.License; - return proto.grpc.gateway.protoc_gen_openapiv2.options.License.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.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 = /** @type {string} */ (reader.readString()); - msg.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.License.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string url = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.License} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.License.prototype.setUrl = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.toObject = function(includeInstance, msg) { - var f, obj = { - description: jspb.Message.getFieldWithDefault(msg, 1, ""), - url: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation; - return proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.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.setDescription(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setUrl(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getUrl(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string description = 1; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string url = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.prototype.getUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.prototype.setUrl = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.toObject = function(includeInstance, msg) { - var f, obj = { - jsonSchema: (f = msg.getJsonSchema()) && proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.toObject(includeInstance, f), - discriminator: jspb.Message.getFieldWithDefault(msg, 2, ""), - readOnly: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - externalDocs: (f = msg.getExternalDocs()) && proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.toObject(includeInstance, f), - example: jspb.Message.getFieldWithDefault(msg, 6, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Schema; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.deserializeBinaryFromReader); - msg.setJsonSchema(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDiscriminator(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setReadOnly(value); - break; - case 5: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.deserializeBinaryFromReader); - msg.setExternalDocs(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setExample(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getJsonSchema(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.serializeBinaryToWriter - ); - } - f = message.getDiscriminator(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getReadOnly(); - if (f) { - writer.writeBool( - 3, - f - ); - } - f = message.getExternalDocs(); - if (f != null) { - writer.writeMessage( - 5, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.serializeBinaryToWriter - ); - } - f = message.getExample(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } -}; - - -/** - * optional JSONSchema json_schema = 1; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.getJsonSchema = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema, 1)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.setJsonSchema = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.clearJsonSchema = function() { - return this.setJsonSchema(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.hasJsonSchema = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string discriminator = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.getDiscriminator = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.setDiscriminator = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool read_only = 3; - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.getReadOnly = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.setReadOnly = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -/** - * optional ExternalDocumentation external_docs = 5; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.getExternalDocs = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation, 5)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.setExternalDocs = function(value) { - return jspb.Message.setWrapperField(this, 5, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.clearExternalDocs = function() { - return this.setExternalDocs(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.hasExternalDocs = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * optional string example = 6; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.getExample = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Schema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Schema.prototype.setExample = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.repeatedFields_ = [26,34,35,46]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.toObject = function(includeInstance, msg) { - var f, obj = { - ref: jspb.Message.getFieldWithDefault(msg, 3, ""), - title: jspb.Message.getFieldWithDefault(msg, 5, ""), - description: jspb.Message.getFieldWithDefault(msg, 6, ""), - pb_default: jspb.Message.getFieldWithDefault(msg, 7, ""), - readOnly: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), - example: jspb.Message.getFieldWithDefault(msg, 9, ""), - multipleOf: jspb.Message.getFloatingPointFieldWithDefault(msg, 10, 0.0), - maximum: jspb.Message.getFloatingPointFieldWithDefault(msg, 11, 0.0), - exclusiveMaximum: jspb.Message.getBooleanFieldWithDefault(msg, 12, false), - minimum: jspb.Message.getFloatingPointFieldWithDefault(msg, 13, 0.0), - exclusiveMinimum: jspb.Message.getBooleanFieldWithDefault(msg, 14, false), - maxLength: jspb.Message.getFieldWithDefault(msg, 15, 0), - minLength: jspb.Message.getFieldWithDefault(msg, 16, 0), - pattern: jspb.Message.getFieldWithDefault(msg, 17, ""), - maxItems: jspb.Message.getFieldWithDefault(msg, 20, 0), - minItems: jspb.Message.getFieldWithDefault(msg, 21, 0), - uniqueItems: jspb.Message.getBooleanFieldWithDefault(msg, 22, false), - maxProperties: jspb.Message.getFieldWithDefault(msg, 24, 0), - minProperties: jspb.Message.getFieldWithDefault(msg, 25, 0), - requiredList: (f = jspb.Message.getRepeatedField(msg, 26)) == null ? undefined : f, - arrayList: (f = jspb.Message.getRepeatedField(msg, 34)) == null ? undefined : f, - typeList: (f = jspb.Message.getRepeatedField(msg, 35)) == null ? undefined : f, - format: jspb.Message.getFieldWithDefault(msg, 36, ""), - enumList: (f = jspb.Message.getRepeatedField(msg, 46)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema; - return proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setRef(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setTitle(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setDefault(value); - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setReadOnly(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setExample(value); - break; - case 10: - var value = /** @type {number} */ (reader.readDouble()); - msg.setMultipleOf(value); - break; - case 11: - var value = /** @type {number} */ (reader.readDouble()); - msg.setMaximum(value); - break; - case 12: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setExclusiveMaximum(value); - break; - case 13: - var value = /** @type {number} */ (reader.readDouble()); - msg.setMinimum(value); - break; - case 14: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setExclusiveMinimum(value); - break; - case 15: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxLength(value); - break; - case 16: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinLength(value); - break; - case 17: - var value = /** @type {string} */ (reader.readString()); - msg.setPattern(value); - break; - case 20: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxItems(value); - break; - case 21: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinItems(value); - break; - case 22: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setUniqueItems(value); - break; - case 24: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxProperties(value); - break; - case 25: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMinProperties(value); - break; - case 26: - var value = /** @type {string} */ (reader.readString()); - msg.addRequired(value); - break; - case 34: - var value = /** @type {string} */ (reader.readString()); - msg.addArray(value); - break; - case 35: - var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]); - for (var i = 0; i < values.length; i++) { - msg.addType(values[i]); - } - break; - case 36: - var value = /** @type {string} */ (reader.readString()); - msg.setFormat(value); - break; - case 46: - var value = /** @type {string} */ (reader.readString()); - msg.addEnum(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getRef(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getTitle(); - if (f.length > 0) { - writer.writeString( - 5, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getDefault(); - if (f.length > 0) { - writer.writeString( - 7, - f - ); - } - f = message.getReadOnly(); - if (f) { - writer.writeBool( - 8, - f - ); - } - f = message.getExample(); - if (f.length > 0) { - writer.writeString( - 9, - f - ); - } - f = message.getMultipleOf(); - if (f !== 0.0) { - writer.writeDouble( - 10, - f - ); - } - f = message.getMaximum(); - if (f !== 0.0) { - writer.writeDouble( - 11, - f - ); - } - f = message.getExclusiveMaximum(); - if (f) { - writer.writeBool( - 12, - f - ); - } - f = message.getMinimum(); - if (f !== 0.0) { - writer.writeDouble( - 13, - f - ); - } - f = message.getExclusiveMinimum(); - if (f) { - writer.writeBool( - 14, - f - ); - } - f = message.getMaxLength(); - if (f !== 0) { - writer.writeUint64( - 15, - f - ); - } - f = message.getMinLength(); - if (f !== 0) { - writer.writeUint64( - 16, - f - ); - } - f = message.getPattern(); - if (f.length > 0) { - writer.writeString( - 17, - f - ); - } - f = message.getMaxItems(); - if (f !== 0) { - writer.writeUint64( - 20, - f - ); - } - f = message.getMinItems(); - if (f !== 0) { - writer.writeUint64( - 21, - f - ); - } - f = message.getUniqueItems(); - if (f) { - writer.writeBool( - 22, - f - ); - } - f = message.getMaxProperties(); - if (f !== 0) { - writer.writeUint64( - 24, - f - ); - } - f = message.getMinProperties(); - if (f !== 0) { - writer.writeUint64( - 25, - f - ); - } - f = message.getRequiredList(); - if (f.length > 0) { - writer.writeRepeatedString( - 26, - f - ); - } - f = message.getArrayList(); - if (f.length > 0) { - writer.writeRepeatedString( - 34, - f - ); - } - f = message.getTypeList(); - if (f.length > 0) { - writer.writePackedEnum( - 35, - f - ); - } - f = message.getFormat(); - if (f.length > 0) { - writer.writeString( - 36, - f - ); - } - f = message.getEnumList(); - if (f.length > 0) { - writer.writeRepeatedString( - 46, - f - ); - } -}; - - -/** - * @enum {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes = { - UNKNOWN: 0, - ARRAY: 1, - BOOLEAN: 2, - INTEGER: 3, - NULL: 4, - NUMBER: 5, - OBJECT: 6, - STRING: 7 -}; - -/** - * optional string ref = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getRef = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setRef = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional string title = 5; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getTitle = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setTitle = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - -/** - * optional string description = 6; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional string default = 7; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getDefault = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setDefault = function(value) { - return jspb.Message.setProto3StringField(this, 7, value); -}; - - -/** - * optional bool read_only = 8; - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getReadOnly = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setReadOnly = function(value) { - return jspb.Message.setProto3BooleanField(this, 8, value); -}; - - -/** - * optional string example = 9; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getExample = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setExample = function(value) { - return jspb.Message.setProto3StringField(this, 9, value); -}; - - -/** - * optional double multiple_of = 10; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMultipleOf = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 10, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMultipleOf = function(value) { - return jspb.Message.setProto3FloatField(this, 10, value); -}; - - -/** - * optional double maximum = 11; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMaximum = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 11, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMaximum = function(value) { - return jspb.Message.setProto3FloatField(this, 11, value); -}; - - -/** - * optional bool exclusive_maximum = 12; - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getExclusiveMaximum = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setExclusiveMaximum = function(value) { - return jspb.Message.setProto3BooleanField(this, 12, value); -}; - - -/** - * optional double minimum = 13; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMinimum = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 13, 0.0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMinimum = function(value) { - return jspb.Message.setProto3FloatField(this, 13, value); -}; - - -/** - * optional bool exclusive_minimum = 14; - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getExclusiveMinimum = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 14, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setExclusiveMinimum = function(value) { - return jspb.Message.setProto3BooleanField(this, 14, value); -}; - - -/** - * optional uint64 max_length = 15; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMaxLength = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMaxLength = function(value) { - return jspb.Message.setProto3IntField(this, 15, value); -}; - - -/** - * optional uint64 min_length = 16; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMinLength = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMinLength = function(value) { - return jspb.Message.setProto3IntField(this, 16, value); -}; - - -/** - * optional string pattern = 17; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getPattern = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 17, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setPattern = function(value) { - return jspb.Message.setProto3StringField(this, 17, value); -}; - - -/** - * optional uint64 max_items = 20; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMaxItems = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 20, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMaxItems = function(value) { - return jspb.Message.setProto3IntField(this, 20, value); -}; - - -/** - * optional uint64 min_items = 21; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMinItems = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 21, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMinItems = function(value) { - return jspb.Message.setProto3IntField(this, 21, value); -}; - - -/** - * optional bool unique_items = 22; - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getUniqueItems = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 22, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setUniqueItems = function(value) { - return jspb.Message.setProto3BooleanField(this, 22, value); -}; - - -/** - * optional uint64 max_properties = 24; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMaxProperties = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 24, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMaxProperties = function(value) { - return jspb.Message.setProto3IntField(this, 24, value); -}; - - -/** - * optional uint64 min_properties = 25; - * @return {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getMinProperties = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 25, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setMinProperties = function(value) { - return jspb.Message.setProto3IntField(this, 25, value); -}; - - -/** - * repeated string required = 26; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getRequiredList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 26)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setRequiredList = function(value) { - return jspb.Message.setField(this, 26, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.addRequired = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 26, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.clearRequiredList = function() { - return this.setRequiredList([]); -}; - - -/** - * repeated string array = 34; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getArrayList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 34)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setArrayList = function(value) { - return jspb.Message.setField(this, 34, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.addArray = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 34, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.clearArrayList = function() { - return this.setArrayList([]); -}; - - -/** - * repeated JSONSchemaSimpleTypes type = 35; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getTypeList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 35)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setTypeList = function(value) { - return jspb.Message.setField(this, 35, value || []); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.addType = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 35, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.clearTypeList = function() { - return this.setTypeList([]); -}; - - -/** - * optional string format = 36; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getFormat = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 36, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setFormat = function(value) { - return jspb.Message.setProto3StringField(this, 36, value); -}; - - -/** - * repeated string enum = 46; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.getEnumList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 46)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.setEnumList = function(value) { - return jspb.Message.setField(this, 46, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.addEnum = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 46, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.prototype.clearEnumList = function() { - return this.setEnumList([]); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.toObject = function(includeInstance, msg) { - var f, obj = { - description: jspb.Message.getFieldWithDefault(msg, 2, ""), - externalDocs: (f = msg.getExternalDocs()) && proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Tag; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.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.setDescription(value); - break; - case 3: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.deserializeBinaryFromReader); - msg.setExternalDocs(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getExternalDocs(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string description = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional ExternalDocumentation external_docs = 3; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.getExternalDocs = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation, 3)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.setExternalDocs = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Tag} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.clearExternalDocs = function() { - return this.setExternalDocs(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Tag.prototype.hasExternalDocs = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.toObject = function(includeInstance, msg) { - var f, obj = { - securityMap: (f = msg.getSecurityMap()) ? f.toObject(includeInstance, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions; - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getSecurityMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.deserializeBinaryFromReader, "", new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSecurityMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.serializeBinaryToWriter); - } -}; - - -/** - * map security = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.prototype.getSecurityMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.prototype.clearSecurityMap = function() { - this.getSecurityMap().clear(); - return this;}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.toObject = function(includeInstance, msg) { - var f, obj = { - type: jspb.Message.getFieldWithDefault(msg, 1, 0), - description: jspb.Message.getFieldWithDefault(msg, 2, ""), - name: jspb.Message.getFieldWithDefault(msg, 3, ""), - pb_in: jspb.Message.getFieldWithDefault(msg, 4, 0), - flow: jspb.Message.getFieldWithDefault(msg, 5, 0), - authorizationUrl: jspb.Message.getFieldWithDefault(msg, 6, ""), - tokenUrl: jspb.Message.getFieldWithDefault(msg, 7, ""), - scopes: (f = msg.getScopes()) && proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.toObject(includeInstance, f), - extensionsMap: (f = msg.getExtensionsMap()) ? f.toObject(includeInstance, proto.google.protobuf.Value.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme; - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type} */ (reader.readEnum()); - msg.setType(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 4: - var value = /** @type {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In} */ (reader.readEnum()); - msg.setIn(value); - break; - case 5: - var value = /** @type {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow} */ (reader.readEnum()); - msg.setFlow(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setAuthorizationUrl(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setTokenUrl(value); - break; - case 8: - var value = new proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes; - reader.readMessage(value,proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.deserializeBinaryFromReader); - msg.setScopes(value); - break; - case 9: - var value = msg.getExtensionsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getType(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } - f = message.getDescription(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getIn(); - if (f !== 0.0) { - writer.writeEnum( - 4, - f - ); - } - f = message.getFlow(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } - f = message.getAuthorizationUrl(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } - f = message.getTokenUrl(); - if (f.length > 0) { - writer.writeString( - 7, - f - ); - } - f = message.getScopes(); - if (f != null) { - writer.writeMessage( - 8, - f, - proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.serializeBinaryToWriter - ); - } - f = message.getExtensionsMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.google.protobuf.Value.serializeBinaryToWriter); - } -}; - - -/** - * @enum {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type = { - TYPE_INVALID: 0, - TYPE_BASIC: 1, - TYPE_API_KEY: 2, - TYPE_OAUTH2: 3 -}; - -/** - * @enum {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In = { - IN_INVALID: 0, - IN_QUERY: 1, - IN_HEADER: 2 -}; - -/** - * @enum {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow = { - FLOW_INVALID: 0, - FLOW_IMPLICIT: 1, - FLOW_PASSWORD: 2, - FLOW_APPLICATION: 3, - FLOW_ACCESS_CODE: 4 -}; - -/** - * optional Type type = 1; - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getType = function() { - return /** @type {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setType = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - -/** - * optional string description = 2; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setDescription = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string name = 3; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - -/** - * optional In in = 4; - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getIn = function() { - return /** @type {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setIn = function(value) { - return jspb.Message.setProto3EnumField(this, 4, value); -}; - - -/** - * optional Flow flow = 5; - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getFlow = function() { - return /** @type {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setFlow = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - -/** - * optional string authorization_url = 6; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getAuthorizationUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setAuthorizationUrl = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional string token_url = 7; - * @return {string} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getTokenUrl = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - - -/** - * @param {string} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setTokenUrl = function(value) { - return jspb.Message.setProto3StringField(this, 7, value); -}; - - -/** - * optional Scopes scopes = 8; - * @return {?proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getScopes = function() { - return /** @type{?proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} */ ( - jspb.Message.getWrapperField(this, proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes, 8)); -}; - - -/** - * @param {?proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes|undefined} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this -*/ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.setScopes = function(value) { - return jspb.Message.setWrapperField(this, 8, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.clearScopes = function() { - return this.setScopes(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.hasScopes = function() { - return jspb.Message.getField(this, 8) != null; -}; - - -/** - * map extensions = 9; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.getExtensionsMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 9, opt_noLazyCreate, - proto.google.protobuf.Value)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.prototype.clearExtensionsMap = function() { - this.getExtensionsMap().clear(); - return this;}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.toObject = function(includeInstance, msg) { - var f, obj = { - securityRequirementMap: (f = msg.getSecurityRequirementMap()) ? f.toObject(includeInstance, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement; - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getSecurityRequirementMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.deserializeBinaryFromReader, "", new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue()); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSecurityRequirementMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.serializeBinaryToWriter); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.toObject = function(includeInstance, msg) { - var f, obj = { - scopeList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue; - return proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.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.addScope(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getScopeList(); - if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); - } -}; - - -/** - * repeated string scope = 1; - * @return {!Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.prototype.getScopeList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.prototype.setScopeList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.prototype.addScope = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue.prototype.clearScopeList = function() { - return this.setScopeList([]); -}; - - -/** - * map security_requirement = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.prototype.getSecurityRequirementMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.prototype.clearSecurityRequirementMap = function() { - this.getSecurityRequirementMap().clear(); - return this;}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.prototype.toObject = function(opt_includeInstance) { - return proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.toObject = function(includeInstance, msg) { - var f, obj = { - scopeMap: (f = msg.getScopeMap()) ? f.toObject(includeInstance, undefined) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes; - return proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = msg.getScopeMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getScopeMap(true); - if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); - } -}; - - -/** - * map scope = 1; - * @param {boolean=} opt_noLazyCreate Do not create the map if - * empty, instead returning `undefined` - * @return {!jspb.Map} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.prototype.getScopeMap = function(opt_noLazyCreate) { - return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - - -/** - * Clears values from the map. The map will be non-null. - * @return {!proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes} returns this - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scopes.prototype.clearScopeMap = function() { - this.getScopeMap().clear(); - return this;}; - - -/** - * @enum {number} - */ -proto.grpc.gateway.protoc_gen_openapiv2.options.Scheme = { - UNKNOWN: 0, - HTTP: 1, - HTTPS: 2, - WS: 3, - WSS: 4 -}; - -goog.object.extend(exports, proto.grpc.gateway.protoc_gen_openapiv2.options); diff --git a/mods/limiter/src/service/runner.ts b/mods/limiter/src/service/runner.ts new file mode 100644 index 000000000..8e22dc47a --- /dev/null +++ b/mods/limiter/src/service/runner.ts @@ -0,0 +1,36 @@ +#!/usr/bin/env node +/* + * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com) + * http://github.com/fonoster/fonoster + * + * This file is part of Fonoster + * + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {Tracer as T} from "@fonoster/common"; +T.init("auth-service"); + +import {LimiterService} from "@fonoster/auth/dist/service/protos/auth_grpc_pb"; +import {runServices} from "@fonoster/common"; +import LimiterServer from "./limiter"; + +const services = [ + { + name: "limiter", + version: "v1beta1", + service: LimiterService, + server: new LimiterServer() + } +]; + +runServices(services, []); diff --git a/mods/limiter/src/service/types.ts b/mods/limiter/src/service/types.ts new file mode 100644 index 000000000..1f94d1e69 --- /dev/null +++ b/mods/limiter/src/service/types.ts @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com) + * http://github.com/fonoster/fonoster + * + * This file is part of Fonoster + * + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import {UserStatus} from "@fonoster/users/dist/service/types"; + +export enum TimeUnit { + DAY = "day", + MONTH = "month", + EVER = "ever" +} + +export interface Limit { + path: string; + resource: string; + limit: number; + timeUnit: TimeUnit; + allowedForStatus: UserStatus; +} + +export interface Limiter { + name: string; + limits: Limit[]; +} diff --git a/mods/limiter/src/utils/utils.ts b/mods/limiter/src/utils/utils.ts new file mode 100644 index 000000000..b0beeaea2 --- /dev/null +++ b/mods/limiter/src/utils/utils.ts @@ -0,0 +1,105 @@ +/* eslint-disable require-jsdoc */ +/* + * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com) + * http://github.com/fonoster/fonoster + * + * This file is part of Fonoster + * + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import userDecoder from "@fonoster/users/dist/service/decoder"; +import projectDecoder from "@fonoster/projects/dist/service/decoder"; +import {UserLimiter} from "@fonoster/users/dist/service/types"; +import {Limit, Limiter} from "../service/types"; +import logger from "@fonoster/logger"; + +export function getUserByAccessKeyId(redis: any) { + return async (accessKeyId: string) => { + // Will return User or Project + const raw = await redis.get(accessKeyId); + if (raw) { + if (accessKeyId.startsWith("US")) { + return userDecoder(raw); + } + + const project = projectDecoder(raw); + return userDecoder(await redis.get(project.getUserRef())); + } + return null; + }; +} + +export function getLimitForPath(limiters: Limiter[]) { + return (limiterName: string, path: string): Limit => { + const lname = limiterName ? limiterName : UserLimiter.DEFAULT; + const limiter = limiters.find( + (l) => l.name.toLowerCase() === lname.toLowerCase() + ); + if (limiter) { + return limiter.limits.find((l) => l.path === path); + } + return null; + }; +} + +export function getResourceCount(redis: any, routr: any) { + return async (userAccessKeyId: string, resource: string): Promise => { + const pAccessKeyIds = await redis.smembers("u_" + userAccessKeyId); + + if (resource?.toLowerCase() === "project") { + return pAccessKeyIds.length; + } + + if ( + ["provider", "domain", "number", "agent"].includes( + resource?.toLowerCase() + ) + ) { + const res = + resource.toLowerCase() === "provider" + ? "gateways" + : `${resource.toLowerCase()}s`; + + await routr.connect(); + + return ( + await Promise.all( + pAccessKeyIds.map(async (id: string) => { + const result = await routr.resourceType(res).list( + { + itemsPerPage: 10000 + }, + id + ); + return result.meta.totalItems; + }) + ) + ).reduce((prev: number, cur: number) => prev + cur, 0); + } + + return 0; + }; +} + +export function getLimiters(): Limiter[] { + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + return require(process.env.LIMITERS_PATH || + "/home/fonoster/limiters.json") as Limiter[]; + } catch (e) { + logger.info( + "@fonoster/limiter failed to load limiters; starting without limiters" + ); + return []; + } +} diff --git a/mods/limiter/test/limiter.unit.test.ts b/mods/limiter/test/limiter.unit.test.ts new file mode 100644 index 000000000..018326028 --- /dev/null +++ b/mods/limiter/test/limiter.unit.test.ts @@ -0,0 +1,101 @@ +import chai from "chai"; +import sinon from "sinon"; +import sinonChai from "sinon-chai"; +import chaiAsPromised from "chai-as-promised"; +import AuthUtils from "../src/utils/auth_utils"; +import Jwt from "../src/utils/jwt"; +const expect = chai.expect; +chai.use(sinonChai); +chai.use(chaiAsPromised); +const sandbox = sinon.createSandbox(); + +describe("@fonoster/authentication", () => { + before(async () => { + sandbox.stub(Jwt); + }); + const expiredToken = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJpc3MiLCJyb2xlIjoicm9sZSIsImFjY2Vzc0tleUlkIjoidXNlcmlkIiwiaWF0IjoxNjIzMjY1NDQxLCJleHAiOjE2MjMyNjU0NDJ9.2o_T4VgEekNCX3ATir6W_J24fduTXaRSks6zjs2-qBk"; + + it("should create a valid token", async () => { + const stubValue = "tokenfake"; + const jwtDependency = new Jwt(); + const authUtils = new AuthUtils(jwtDependency); + const parameter = { + accessKeyIdPayload: "userId", + issuePayload: "issue", + rolePayload: "role", + privateKey: "privatekey" + }; + const stub = sinon.stub(jwtDependency, "encode").resolves(stubValue); + const token = await authUtils.createToken( + parameter.accessKeyIdPayload, + parameter.issuePayload, + parameter.rolePayload, + "privatekey" + ); + expect(stub.calledOnce).to.be.true; + expect(token.accessToken).to.be.equal(stubValue); + }); + + it("should return a decode jwt", async () => { + const stubValue = { + iss: "iss", + role: "role", + accessKeyId: "userid" + }; + const jwtDependency = new Jwt(); + const authUtils = new AuthUtils(jwtDependency); + const parameter = { + accessToken: "token" + }; + const stub = sinon.stub(jwtDependency, "decode").resolves(stubValue); + + const token = await authUtils.validateToken(parameter, "privatekey"); + expect(stub.calledOnce).to.be.true; + expect(token.data).to.be.equal(stubValue); + }); + + it("should generate a jwt", async () => { + const stubValue = { + iss: "iss", + role: "role", + accessKeyId: "userid" + }; + const jwtDependency = new Jwt(); + const token = jwtDependency.encode(stubValue, "secret"); + expect(token).to.be.not.null; + }); + + it("should return an exception with no privatekey", async () => { + const stubValue = { + iss: "iss", + role: "role", + accessKeyId: "userid" + }; + const jwtDependency = new Jwt(); + jwtDependency.encode(stubValue, "").catch((err) => { + expect(err.message).to.be.equal("Token generation failure"); + }); + }); + + it("should return an exception with jwt expired", async () => { + const jwtDependency = new Jwt(); + await jwtDependency.decode(expiredToken, "secret").catch((err) => { + expect(err.message).to.include("jwt expired"); + }); + }); + + it("should decode a token", async () => { + const stubValue = { + iss: "iss", + role: "role", + accessKeyId: "userid" + }; + const jwtDependency = new Jwt(); + jwtDependency.encode(stubValue, "secret").then((result) => { + jwtDependency.decode(result, "secret").then((objectJWT) => { + expect(objectJWT.accessKeyId).to.be.equal(stubValue.accessKeyId); + }); + }); + }); +}); diff --git a/mods/limiter/tsconfig.json b/mods/limiter/tsconfig.json new file mode 100644 index 000000000..01b974ca2 --- /dev/null +++ b/mods/limiter/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "references": [ + {"path": "../users"}, + {"path": "../projects"}, + {"path": "../common"}, + {"path": "../core"}, + {"path": "../logger"}, + {"path": "../errors"} + ], + "exclude": ["node_modules", "dist", "test"] +}