How to use getProxyRequest method in mountebank

Best JavaScript code snippet using mountebank

proxy_service.ts

Source:proxy_service.ts Github

copy

Full Screen

1/* eslint-disable */2import { messageTypeRegistry } from "../../../../../typeRegistry";3import Long from "long";4import {5 makeGenericClientConstructor,6 ChannelCredentials,7 ChannelOptions,8 UntypedServiceImplementation,9 handleUnaryCall,10 Client,11 ClientUnaryCall,12 Metadata,13 CallOptions,14 ServiceError,15} from "@grpc/grpc-js";16import _m0 from "protobufjs/minimal";17import {18 Target,19 Proxy,20} from "../../../../../yandex/cloud/serverless/mdbproxy/v1/proxy";21import { FieldMask } from "../../../../../google/protobuf/field_mask";22import { Operation } from "../../../../../yandex/cloud/operation/operation";23import {24 ListAccessBindingsRequest,25 ListAccessBindingsResponse,26 SetAccessBindingsRequest,27 UpdateAccessBindingsRequest,28} from "../../../../../yandex/cloud/access/access";29export const protobufPackage = "yandex.cloud.serverless.mdbproxy.v1";30export interface GetProxyRequest {31 $type: "yandex.cloud.serverless.mdbproxy.v1.GetProxyRequest";32 /**33 * ID of the proxy to return.34 *35 * To get a proxy ID make a [ProxyService.List] request.36 */37 proxyId: string;38}39export interface ListProxyRequest {40 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyRequest";41 /**42 * ID of the folder to list proxies in.43 *44 * To get a folder ID make a [yandex.cloud.resourcemanager.v1.FolderService.List] request.45 */46 folderId: string;47 /**48 * The maximum number of results per page to return. If the number of available49 * results is larger than `pageSize`, the service returns a [ListProxyResponse.next_page_token]50 * that can be used to get the next page of results in subsequent list requests.51 *52 * Default value: 100.53 */54 pageSize: number;55 /**56 * Page token. To get the next page of results, set `pageToken` to the57 * [ListProxyResponse.next_page_token] returned by a previous list request.58 */59 pageToken: string;60 /**61 * A filter expression that filters proxies listed in the response.62 *63 * The expression must specify:64 * 1. The field name. Currently filtering can only be applied to the [Proxy.name] field.65 * 2. An `=` operator.66 * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`.67 * Example of a filter: `name=my-proxy`.68 */69 filter: string;70}71export interface ListProxyResponse {72 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyResponse";73 /** List of proxies in the specified folder. */74 proxies: Proxy[];75 /**76 * Token for getting the next page of the list. If the number of results is greater than77 * the specified [ListProxyRequest.page_size], use `nextPageToken` as the value78 * for the [ListProxyRequest.page_token] parameter in the next list request.79 *80 * Each subsequent page will have its own `nextPageToken` to continue paging through the results.81 */82 nextPageToken: string;83}84export interface CreateProxyRequest {85 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest";86 /**87 * ID of the folder to create a proxy in.88 *89 * To get a folder ID make a [yandex.cloud.resourcemanager.v1.FolderService.List] request.90 */91 folderId: string;92 /**93 * Name of the proxy.94 * The name must be unique within the folder.95 */96 name: string;97 /** Description of the proxy. */98 description: string;99 /** Resource labels as `key:value` pairs. */100 labels: { [key: string]: string };101 /** Proxy target. */102 target?: Target;103}104export interface CreateProxyRequest_LabelsEntry {105 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest.LabelsEntry";106 key: string;107 value: string;108}109export interface CreateProxyMetadata {110 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyMetadata";111 /** ID of the proxy. */112 proxyId: string;113}114export interface UpdateProxyRequest {115 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest";116 /** ID of the proxy to update. */117 proxyId: string;118 /** Field mask that specifies which attributes of the proxy should be updated. */119 updateMask?: FieldMask;120 /**121 * New name for the proxy.122 * The name must be unique within the folder.123 */124 name: string;125 /** New description for the proxy. */126 description: string;127 /** Proxy labels as `key:value` pairs. */128 labels: { [key: string]: string };129 /** Proxy target. */130 target?: Target;131}132export interface UpdateProxyRequest_LabelsEntry {133 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest.LabelsEntry";134 key: string;135 value: string;136}137export interface UpdateProxyMetadata {138 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyMetadata";139 /** ID of the proxy. */140 proxyId: string;141}142export interface DeleteProxyRequest {143 $type: "yandex.cloud.serverless.mdbproxy.v1.DeleteProxyRequest";144 /** ID of the proxy. */145 proxyId: string;146}147export interface DeleteProxyMetadata {148 $type: "yandex.cloud.serverless.mdbproxy.v1.DeleteProxyMetadata";149 /** ID of the proxy. */150 proxyId: string;151}152export interface ListProxyOperationsRequest {153 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyOperationsRequest";154 /** ID of the proxy to list operations for. */155 proxyId: string;156 /**157 * The maximum number of results per page that should be returned. If the number of available158 * results is larger than `pageSize`, the service returns a [ListProxyOperationsResponse.next_page_token]159 * that can be used to get the next page of results in subsequent list requests.160 *161 * Default value: 100.162 */163 pageSize: number;164 /**165 * Page token. To get the next page of results, set `pageToken` to the166 * [ListProxyOperationsResponse.next_page_token] returned by a previous list request.167 */168 pageToken: string;169 /**170 * A filter expression that filters resources listed in the response.171 *172 * The expression must specify:173 * 1. The field name. Currently filtering can be applied to the [operation.Operation.done], [operation.Operation.created_by] field.174 * 2. An `=` operator.175 * 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`.176 * Examples of a filter: `done=false`, `created_by='John.Doe'`.177 */178 filter: string;179}180export interface ListProxyOperationsResponse {181 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyOperationsResponse";182 /** List of operations for the specified proxy. */183 operations: Operation[];184 /**185 * Token for getting the next page of the list. If the number of results is greater than186 * the specified [ListProxyOperationsRequest.page_size], use `nextPageToken` as the value187 * for the [ListProxyOperationsRequest.page_token] parameter in the next list request.188 *189 * Each subsequent page will have its own `nextPageToken` to continue paging through the results.190 */191 nextPageToken: string;192}193const baseGetProxyRequest: object = {194 $type: "yandex.cloud.serverless.mdbproxy.v1.GetProxyRequest",195 proxyId: "",196};197export const GetProxyRequest = {198 $type: "yandex.cloud.serverless.mdbproxy.v1.GetProxyRequest" as const,199 encode(200 message: GetProxyRequest,201 writer: _m0.Writer = _m0.Writer.create()202 ): _m0.Writer {203 if (message.proxyId !== "") {204 writer.uint32(10).string(message.proxyId);205 }206 return writer;207 },208 decode(input: _m0.Reader | Uint8Array, length?: number): GetProxyRequest {209 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);210 let end = length === undefined ? reader.len : reader.pos + length;211 const message = { ...baseGetProxyRequest } as GetProxyRequest;212 while (reader.pos < end) {213 const tag = reader.uint32();214 switch (tag >>> 3) {215 case 1:216 message.proxyId = reader.string();217 break;218 default:219 reader.skipType(tag & 7);220 break;221 }222 }223 return message;224 },225 fromJSON(object: any): GetProxyRequest {226 const message = { ...baseGetProxyRequest } as GetProxyRequest;227 message.proxyId =228 object.proxyId !== undefined && object.proxyId !== null229 ? String(object.proxyId)230 : "";231 return message;232 },233 toJSON(message: GetProxyRequest): unknown {234 const obj: any = {};235 message.proxyId !== undefined && (obj.proxyId = message.proxyId);236 return obj;237 },238 fromPartial<I extends Exact<DeepPartial<GetProxyRequest>, I>>(239 object: I240 ): GetProxyRequest {241 const message = { ...baseGetProxyRequest } as GetProxyRequest;242 message.proxyId = object.proxyId ?? "";243 return message;244 },245};246messageTypeRegistry.set(GetProxyRequest.$type, GetProxyRequest);247const baseListProxyRequest: object = {248 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyRequest",249 folderId: "",250 pageSize: 0,251 pageToken: "",252 filter: "",253};254export const ListProxyRequest = {255 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyRequest" as const,256 encode(257 message: ListProxyRequest,258 writer: _m0.Writer = _m0.Writer.create()259 ): _m0.Writer {260 if (message.folderId !== "") {261 writer.uint32(10).string(message.folderId);262 }263 if (message.pageSize !== 0) {264 writer.uint32(16).int64(message.pageSize);265 }266 if (message.pageToken !== "") {267 writer.uint32(26).string(message.pageToken);268 }269 if (message.filter !== "") {270 writer.uint32(34).string(message.filter);271 }272 return writer;273 },274 decode(input: _m0.Reader | Uint8Array, length?: number): ListProxyRequest {275 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);276 let end = length === undefined ? reader.len : reader.pos + length;277 const message = { ...baseListProxyRequest } as ListProxyRequest;278 while (reader.pos < end) {279 const tag = reader.uint32();280 switch (tag >>> 3) {281 case 1:282 message.folderId = reader.string();283 break;284 case 2:285 message.pageSize = longToNumber(reader.int64() as Long);286 break;287 case 3:288 message.pageToken = reader.string();289 break;290 case 4:291 message.filter = reader.string();292 break;293 default:294 reader.skipType(tag & 7);295 break;296 }297 }298 return message;299 },300 fromJSON(object: any): ListProxyRequest {301 const message = { ...baseListProxyRequest } as ListProxyRequest;302 message.folderId =303 object.folderId !== undefined && object.folderId !== null304 ? String(object.folderId)305 : "";306 message.pageSize =307 object.pageSize !== undefined && object.pageSize !== null308 ? Number(object.pageSize)309 : 0;310 message.pageToken =311 object.pageToken !== undefined && object.pageToken !== null312 ? String(object.pageToken)313 : "";314 message.filter =315 object.filter !== undefined && object.filter !== null316 ? String(object.filter)317 : "";318 return message;319 },320 toJSON(message: ListProxyRequest): unknown {321 const obj: any = {};322 message.folderId !== undefined && (obj.folderId = message.folderId);323 message.pageSize !== undefined &&324 (obj.pageSize = Math.round(message.pageSize));325 message.pageToken !== undefined && (obj.pageToken = message.pageToken);326 message.filter !== undefined && (obj.filter = message.filter);327 return obj;328 },329 fromPartial<I extends Exact<DeepPartial<ListProxyRequest>, I>>(330 object: I331 ): ListProxyRequest {332 const message = { ...baseListProxyRequest } as ListProxyRequest;333 message.folderId = object.folderId ?? "";334 message.pageSize = object.pageSize ?? 0;335 message.pageToken = object.pageToken ?? "";336 message.filter = object.filter ?? "";337 return message;338 },339};340messageTypeRegistry.set(ListProxyRequest.$type, ListProxyRequest);341const baseListProxyResponse: object = {342 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyResponse",343 nextPageToken: "",344};345export const ListProxyResponse = {346 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyResponse" as const,347 encode(348 message: ListProxyResponse,349 writer: _m0.Writer = _m0.Writer.create()350 ): _m0.Writer {351 for (const v of message.proxies) {352 Proxy.encode(v!, writer.uint32(10).fork()).ldelim();353 }354 if (message.nextPageToken !== "") {355 writer.uint32(18).string(message.nextPageToken);356 }357 return writer;358 },359 decode(input: _m0.Reader | Uint8Array, length?: number): ListProxyResponse {360 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);361 let end = length === undefined ? reader.len : reader.pos + length;362 const message = { ...baseListProxyResponse } as ListProxyResponse;363 message.proxies = [];364 while (reader.pos < end) {365 const tag = reader.uint32();366 switch (tag >>> 3) {367 case 1:368 message.proxies.push(Proxy.decode(reader, reader.uint32()));369 break;370 case 2:371 message.nextPageToken = reader.string();372 break;373 default:374 reader.skipType(tag & 7);375 break;376 }377 }378 return message;379 },380 fromJSON(object: any): ListProxyResponse {381 const message = { ...baseListProxyResponse } as ListProxyResponse;382 message.proxies = (object.proxies ?? []).map((e: any) => Proxy.fromJSON(e));383 message.nextPageToken =384 object.nextPageToken !== undefined && object.nextPageToken !== null385 ? String(object.nextPageToken)386 : "";387 return message;388 },389 toJSON(message: ListProxyResponse): unknown {390 const obj: any = {};391 if (message.proxies) {392 obj.proxies = message.proxies.map((e) =>393 e ? Proxy.toJSON(e) : undefined394 );395 } else {396 obj.proxies = [];397 }398 message.nextPageToken !== undefined &&399 (obj.nextPageToken = message.nextPageToken);400 return obj;401 },402 fromPartial<I extends Exact<DeepPartial<ListProxyResponse>, I>>(403 object: I404 ): ListProxyResponse {405 const message = { ...baseListProxyResponse } as ListProxyResponse;406 message.proxies = object.proxies?.map((e) => Proxy.fromPartial(e)) || [];407 message.nextPageToken = object.nextPageToken ?? "";408 return message;409 },410};411messageTypeRegistry.set(ListProxyResponse.$type, ListProxyResponse);412const baseCreateProxyRequest: object = {413 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest",414 folderId: "",415 name: "",416 description: "",417};418export const CreateProxyRequest = {419 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest" as const,420 encode(421 message: CreateProxyRequest,422 writer: _m0.Writer = _m0.Writer.create()423 ): _m0.Writer {424 if (message.folderId !== "") {425 writer.uint32(10).string(message.folderId);426 }427 if (message.name !== "") {428 writer.uint32(18).string(message.name);429 }430 if (message.description !== "") {431 writer.uint32(26).string(message.description);432 }433 Object.entries(message.labels).forEach(([key, value]) => {434 CreateProxyRequest_LabelsEntry.encode(435 {436 $type:437 "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest.LabelsEntry",438 key: key as any,439 value,440 },441 writer.uint32(34).fork()442 ).ldelim();443 });444 if (message.target !== undefined) {445 Target.encode(message.target, writer.uint32(42).fork()).ldelim();446 }447 return writer;448 },449 decode(input: _m0.Reader | Uint8Array, length?: number): CreateProxyRequest {450 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);451 let end = length === undefined ? reader.len : reader.pos + length;452 const message = { ...baseCreateProxyRequest } as CreateProxyRequest;453 message.labels = {};454 while (reader.pos < end) {455 const tag = reader.uint32();456 switch (tag >>> 3) {457 case 1:458 message.folderId = reader.string();459 break;460 case 2:461 message.name = reader.string();462 break;463 case 3:464 message.description = reader.string();465 break;466 case 4:467 const entry4 = CreateProxyRequest_LabelsEntry.decode(468 reader,469 reader.uint32()470 );471 if (entry4.value !== undefined) {472 message.labels[entry4.key] = entry4.value;473 }474 break;475 case 5:476 message.target = Target.decode(reader, reader.uint32());477 break;478 default:479 reader.skipType(tag & 7);480 break;481 }482 }483 return message;484 },485 fromJSON(object: any): CreateProxyRequest {486 const message = { ...baseCreateProxyRequest } as CreateProxyRequest;487 message.folderId =488 object.folderId !== undefined && object.folderId !== null489 ? String(object.folderId)490 : "";491 message.name =492 object.name !== undefined && object.name !== null493 ? String(object.name)494 : "";495 message.description =496 object.description !== undefined && object.description !== null497 ? String(object.description)498 : "";499 message.labels = Object.entries(object.labels ?? {}).reduce<{500 [key: string]: string;501 }>((acc, [key, value]) => {502 acc[key] = String(value);503 return acc;504 }, {});505 message.target =506 object.target !== undefined && object.target !== null507 ? Target.fromJSON(object.target)508 : undefined;509 return message;510 },511 toJSON(message: CreateProxyRequest): unknown {512 const obj: any = {};513 message.folderId !== undefined && (obj.folderId = message.folderId);514 message.name !== undefined && (obj.name = message.name);515 message.description !== undefined &&516 (obj.description = message.description);517 obj.labels = {};518 if (message.labels) {519 Object.entries(message.labels).forEach(([k, v]) => {520 obj.labels[k] = v;521 });522 }523 message.target !== undefined &&524 (obj.target = message.target ? Target.toJSON(message.target) : undefined);525 return obj;526 },527 fromPartial<I extends Exact<DeepPartial<CreateProxyRequest>, I>>(528 object: I529 ): CreateProxyRequest {530 const message = { ...baseCreateProxyRequest } as CreateProxyRequest;531 message.folderId = object.folderId ?? "";532 message.name = object.name ?? "";533 message.description = object.description ?? "";534 message.labels = Object.entries(object.labels ?? {}).reduce<{535 [key: string]: string;536 }>((acc, [key, value]) => {537 if (value !== undefined) {538 acc[key] = String(value);539 }540 return acc;541 }, {});542 message.target =543 object.target !== undefined && object.target !== null544 ? Target.fromPartial(object.target)545 : undefined;546 return message;547 },548};549messageTypeRegistry.set(CreateProxyRequest.$type, CreateProxyRequest);550const baseCreateProxyRequest_LabelsEntry: object = {551 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest.LabelsEntry",552 key: "",553 value: "",554};555export const CreateProxyRequest_LabelsEntry = {556 $type:557 "yandex.cloud.serverless.mdbproxy.v1.CreateProxyRequest.LabelsEntry" as const,558 encode(559 message: CreateProxyRequest_LabelsEntry,560 writer: _m0.Writer = _m0.Writer.create()561 ): _m0.Writer {562 if (message.key !== "") {563 writer.uint32(10).string(message.key);564 }565 if (message.value !== "") {566 writer.uint32(18).string(message.value);567 }568 return writer;569 },570 decode(571 input: _m0.Reader | Uint8Array,572 length?: number573 ): CreateProxyRequest_LabelsEntry {574 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);575 let end = length === undefined ? reader.len : reader.pos + length;576 const message = {577 ...baseCreateProxyRequest_LabelsEntry,578 } as CreateProxyRequest_LabelsEntry;579 while (reader.pos < end) {580 const tag = reader.uint32();581 switch (tag >>> 3) {582 case 1:583 message.key = reader.string();584 break;585 case 2:586 message.value = reader.string();587 break;588 default:589 reader.skipType(tag & 7);590 break;591 }592 }593 return message;594 },595 fromJSON(object: any): CreateProxyRequest_LabelsEntry {596 const message = {597 ...baseCreateProxyRequest_LabelsEntry,598 } as CreateProxyRequest_LabelsEntry;599 message.key =600 object.key !== undefined && object.key !== null ? String(object.key) : "";601 message.value =602 object.value !== undefined && object.value !== null603 ? String(object.value)604 : "";605 return message;606 },607 toJSON(message: CreateProxyRequest_LabelsEntry): unknown {608 const obj: any = {};609 message.key !== undefined && (obj.key = message.key);610 message.value !== undefined && (obj.value = message.value);611 return obj;612 },613 fromPartial<I extends Exact<DeepPartial<CreateProxyRequest_LabelsEntry>, I>>(614 object: I615 ): CreateProxyRequest_LabelsEntry {616 const message = {617 ...baseCreateProxyRequest_LabelsEntry,618 } as CreateProxyRequest_LabelsEntry;619 message.key = object.key ?? "";620 message.value = object.value ?? "";621 return message;622 },623};624messageTypeRegistry.set(625 CreateProxyRequest_LabelsEntry.$type,626 CreateProxyRequest_LabelsEntry627);628const baseCreateProxyMetadata: object = {629 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyMetadata",630 proxyId: "",631};632export const CreateProxyMetadata = {633 $type: "yandex.cloud.serverless.mdbproxy.v1.CreateProxyMetadata" as const,634 encode(635 message: CreateProxyMetadata,636 writer: _m0.Writer = _m0.Writer.create()637 ): _m0.Writer {638 if (message.proxyId !== "") {639 writer.uint32(10).string(message.proxyId);640 }641 return writer;642 },643 decode(input: _m0.Reader | Uint8Array, length?: number): CreateProxyMetadata {644 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);645 let end = length === undefined ? reader.len : reader.pos + length;646 const message = { ...baseCreateProxyMetadata } as CreateProxyMetadata;647 while (reader.pos < end) {648 const tag = reader.uint32();649 switch (tag >>> 3) {650 case 1:651 message.proxyId = reader.string();652 break;653 default:654 reader.skipType(tag & 7);655 break;656 }657 }658 return message;659 },660 fromJSON(object: any): CreateProxyMetadata {661 const message = { ...baseCreateProxyMetadata } as CreateProxyMetadata;662 message.proxyId =663 object.proxyId !== undefined && object.proxyId !== null664 ? String(object.proxyId)665 : "";666 return message;667 },668 toJSON(message: CreateProxyMetadata): unknown {669 const obj: any = {};670 message.proxyId !== undefined && (obj.proxyId = message.proxyId);671 return obj;672 },673 fromPartial<I extends Exact<DeepPartial<CreateProxyMetadata>, I>>(674 object: I675 ): CreateProxyMetadata {676 const message = { ...baseCreateProxyMetadata } as CreateProxyMetadata;677 message.proxyId = object.proxyId ?? "";678 return message;679 },680};681messageTypeRegistry.set(CreateProxyMetadata.$type, CreateProxyMetadata);682const baseUpdateProxyRequest: object = {683 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest",684 proxyId: "",685 name: "",686 description: "",687};688export const UpdateProxyRequest = {689 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest" as const,690 encode(691 message: UpdateProxyRequest,692 writer: _m0.Writer = _m0.Writer.create()693 ): _m0.Writer {694 if (message.proxyId !== "") {695 writer.uint32(10).string(message.proxyId);696 }697 if (message.updateMask !== undefined) {698 FieldMask.encode(message.updateMask, writer.uint32(18).fork()).ldelim();699 }700 if (message.name !== "") {701 writer.uint32(26).string(message.name);702 }703 if (message.description !== "") {704 writer.uint32(34).string(message.description);705 }706 Object.entries(message.labels).forEach(([key, value]) => {707 UpdateProxyRequest_LabelsEntry.encode(708 {709 $type:710 "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest.LabelsEntry",711 key: key as any,712 value,713 },714 writer.uint32(42).fork()715 ).ldelim();716 });717 if (message.target !== undefined) {718 Target.encode(message.target, writer.uint32(50).fork()).ldelim();719 }720 return writer;721 },722 decode(input: _m0.Reader | Uint8Array, length?: number): UpdateProxyRequest {723 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);724 let end = length === undefined ? reader.len : reader.pos + length;725 const message = { ...baseUpdateProxyRequest } as UpdateProxyRequest;726 message.labels = {};727 while (reader.pos < end) {728 const tag = reader.uint32();729 switch (tag >>> 3) {730 case 1:731 message.proxyId = reader.string();732 break;733 case 2:734 message.updateMask = FieldMask.decode(reader, reader.uint32());735 break;736 case 3:737 message.name = reader.string();738 break;739 case 4:740 message.description = reader.string();741 break;742 case 5:743 const entry5 = UpdateProxyRequest_LabelsEntry.decode(744 reader,745 reader.uint32()746 );747 if (entry5.value !== undefined) {748 message.labels[entry5.key] = entry5.value;749 }750 break;751 case 6:752 message.target = Target.decode(reader, reader.uint32());753 break;754 default:755 reader.skipType(tag & 7);756 break;757 }758 }759 return message;760 },761 fromJSON(object: any): UpdateProxyRequest {762 const message = { ...baseUpdateProxyRequest } as UpdateProxyRequest;763 message.proxyId =764 object.proxyId !== undefined && object.proxyId !== null765 ? String(object.proxyId)766 : "";767 message.updateMask =768 object.updateMask !== undefined && object.updateMask !== null769 ? FieldMask.fromJSON(object.updateMask)770 : undefined;771 message.name =772 object.name !== undefined && object.name !== null773 ? String(object.name)774 : "";775 message.description =776 object.description !== undefined && object.description !== null777 ? String(object.description)778 : "";779 message.labels = Object.entries(object.labels ?? {}).reduce<{780 [key: string]: string;781 }>((acc, [key, value]) => {782 acc[key] = String(value);783 return acc;784 }, {});785 message.target =786 object.target !== undefined && object.target !== null787 ? Target.fromJSON(object.target)788 : undefined;789 return message;790 },791 toJSON(message: UpdateProxyRequest): unknown {792 const obj: any = {};793 message.proxyId !== undefined && (obj.proxyId = message.proxyId);794 message.updateMask !== undefined &&795 (obj.updateMask = message.updateMask796 ? FieldMask.toJSON(message.updateMask)797 : undefined);798 message.name !== undefined && (obj.name = message.name);799 message.description !== undefined &&800 (obj.description = message.description);801 obj.labels = {};802 if (message.labels) {803 Object.entries(message.labels).forEach(([k, v]) => {804 obj.labels[k] = v;805 });806 }807 message.target !== undefined &&808 (obj.target = message.target ? Target.toJSON(message.target) : undefined);809 return obj;810 },811 fromPartial<I extends Exact<DeepPartial<UpdateProxyRequest>, I>>(812 object: I813 ): UpdateProxyRequest {814 const message = { ...baseUpdateProxyRequest } as UpdateProxyRequest;815 message.proxyId = object.proxyId ?? "";816 message.updateMask =817 object.updateMask !== undefined && object.updateMask !== null818 ? FieldMask.fromPartial(object.updateMask)819 : undefined;820 message.name = object.name ?? "";821 message.description = object.description ?? "";822 message.labels = Object.entries(object.labels ?? {}).reduce<{823 [key: string]: string;824 }>((acc, [key, value]) => {825 if (value !== undefined) {826 acc[key] = String(value);827 }828 return acc;829 }, {});830 message.target =831 object.target !== undefined && object.target !== null832 ? Target.fromPartial(object.target)833 : undefined;834 return message;835 },836};837messageTypeRegistry.set(UpdateProxyRequest.$type, UpdateProxyRequest);838const baseUpdateProxyRequest_LabelsEntry: object = {839 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest.LabelsEntry",840 key: "",841 value: "",842};843export const UpdateProxyRequest_LabelsEntry = {844 $type:845 "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyRequest.LabelsEntry" as const,846 encode(847 message: UpdateProxyRequest_LabelsEntry,848 writer: _m0.Writer = _m0.Writer.create()849 ): _m0.Writer {850 if (message.key !== "") {851 writer.uint32(10).string(message.key);852 }853 if (message.value !== "") {854 writer.uint32(18).string(message.value);855 }856 return writer;857 },858 decode(859 input: _m0.Reader | Uint8Array,860 length?: number861 ): UpdateProxyRequest_LabelsEntry {862 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);863 let end = length === undefined ? reader.len : reader.pos + length;864 const message = {865 ...baseUpdateProxyRequest_LabelsEntry,866 } as UpdateProxyRequest_LabelsEntry;867 while (reader.pos < end) {868 const tag = reader.uint32();869 switch (tag >>> 3) {870 case 1:871 message.key = reader.string();872 break;873 case 2:874 message.value = reader.string();875 break;876 default:877 reader.skipType(tag & 7);878 break;879 }880 }881 return message;882 },883 fromJSON(object: any): UpdateProxyRequest_LabelsEntry {884 const message = {885 ...baseUpdateProxyRequest_LabelsEntry,886 } as UpdateProxyRequest_LabelsEntry;887 message.key =888 object.key !== undefined && object.key !== null ? String(object.key) : "";889 message.value =890 object.value !== undefined && object.value !== null891 ? String(object.value)892 : "";893 return message;894 },895 toJSON(message: UpdateProxyRequest_LabelsEntry): unknown {896 const obj: any = {};897 message.key !== undefined && (obj.key = message.key);898 message.value !== undefined && (obj.value = message.value);899 return obj;900 },901 fromPartial<I extends Exact<DeepPartial<UpdateProxyRequest_LabelsEntry>, I>>(902 object: I903 ): UpdateProxyRequest_LabelsEntry {904 const message = {905 ...baseUpdateProxyRequest_LabelsEntry,906 } as UpdateProxyRequest_LabelsEntry;907 message.key = object.key ?? "";908 message.value = object.value ?? "";909 return message;910 },911};912messageTypeRegistry.set(913 UpdateProxyRequest_LabelsEntry.$type,914 UpdateProxyRequest_LabelsEntry915);916const baseUpdateProxyMetadata: object = {917 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyMetadata",918 proxyId: "",919};920export const UpdateProxyMetadata = {921 $type: "yandex.cloud.serverless.mdbproxy.v1.UpdateProxyMetadata" as const,922 encode(923 message: UpdateProxyMetadata,924 writer: _m0.Writer = _m0.Writer.create()925 ): _m0.Writer {926 if (message.proxyId !== "") {927 writer.uint32(10).string(message.proxyId);928 }929 return writer;930 },931 decode(input: _m0.Reader | Uint8Array, length?: number): UpdateProxyMetadata {932 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);933 let end = length === undefined ? reader.len : reader.pos + length;934 const message = { ...baseUpdateProxyMetadata } as UpdateProxyMetadata;935 while (reader.pos < end) {936 const tag = reader.uint32();937 switch (tag >>> 3) {938 case 1:939 message.proxyId = reader.string();940 break;941 default:942 reader.skipType(tag & 7);943 break;944 }945 }946 return message;947 },948 fromJSON(object: any): UpdateProxyMetadata {949 const message = { ...baseUpdateProxyMetadata } as UpdateProxyMetadata;950 message.proxyId =951 object.proxyId !== undefined && object.proxyId !== null952 ? String(object.proxyId)953 : "";954 return message;955 },956 toJSON(message: UpdateProxyMetadata): unknown {957 const obj: any = {};958 message.proxyId !== undefined && (obj.proxyId = message.proxyId);959 return obj;960 },961 fromPartial<I extends Exact<DeepPartial<UpdateProxyMetadata>, I>>(962 object: I963 ): UpdateProxyMetadata {964 const message = { ...baseUpdateProxyMetadata } as UpdateProxyMetadata;965 message.proxyId = object.proxyId ?? "";966 return message;967 },968};969messageTypeRegistry.set(UpdateProxyMetadata.$type, UpdateProxyMetadata);970const baseDeleteProxyRequest: object = {971 $type: "yandex.cloud.serverless.mdbproxy.v1.DeleteProxyRequest",972 proxyId: "",973};974export const DeleteProxyRequest = {975 $type: "yandex.cloud.serverless.mdbproxy.v1.DeleteProxyRequest" as const,976 encode(977 message: DeleteProxyRequest,978 writer: _m0.Writer = _m0.Writer.create()979 ): _m0.Writer {980 if (message.proxyId !== "") {981 writer.uint32(10).string(message.proxyId);982 }983 return writer;984 },985 decode(input: _m0.Reader | Uint8Array, length?: number): DeleteProxyRequest {986 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);987 let end = length === undefined ? reader.len : reader.pos + length;988 const message = { ...baseDeleteProxyRequest } as DeleteProxyRequest;989 while (reader.pos < end) {990 const tag = reader.uint32();991 switch (tag >>> 3) {992 case 1:993 message.proxyId = reader.string();994 break;995 default:996 reader.skipType(tag & 7);997 break;998 }999 }1000 return message;1001 },1002 fromJSON(object: any): DeleteProxyRequest {1003 const message = { ...baseDeleteProxyRequest } as DeleteProxyRequest;1004 message.proxyId =1005 object.proxyId !== undefined && object.proxyId !== null1006 ? String(object.proxyId)1007 : "";1008 return message;1009 },1010 toJSON(message: DeleteProxyRequest): unknown {1011 const obj: any = {};1012 message.proxyId !== undefined && (obj.proxyId = message.proxyId);1013 return obj;1014 },1015 fromPartial<I extends Exact<DeepPartial<DeleteProxyRequest>, I>>(1016 object: I1017 ): DeleteProxyRequest {1018 const message = { ...baseDeleteProxyRequest } as DeleteProxyRequest;1019 message.proxyId = object.proxyId ?? "";1020 return message;1021 },1022};1023messageTypeRegistry.set(DeleteProxyRequest.$type, DeleteProxyRequest);1024const baseDeleteProxyMetadata: object = {1025 $type: "yandex.cloud.serverless.mdbproxy.v1.DeleteProxyMetadata",1026 proxyId: "",1027};1028export const DeleteProxyMetadata = {1029 $type: "yandex.cloud.serverless.mdbproxy.v1.DeleteProxyMetadata" as const,1030 encode(1031 message: DeleteProxyMetadata,1032 writer: _m0.Writer = _m0.Writer.create()1033 ): _m0.Writer {1034 if (message.proxyId !== "") {1035 writer.uint32(10).string(message.proxyId);1036 }1037 return writer;1038 },1039 decode(input: _m0.Reader | Uint8Array, length?: number): DeleteProxyMetadata {1040 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);1041 let end = length === undefined ? reader.len : reader.pos + length;1042 const message = { ...baseDeleteProxyMetadata } as DeleteProxyMetadata;1043 while (reader.pos < end) {1044 const tag = reader.uint32();1045 switch (tag >>> 3) {1046 case 1:1047 message.proxyId = reader.string();1048 break;1049 default:1050 reader.skipType(tag & 7);1051 break;1052 }1053 }1054 return message;1055 },1056 fromJSON(object: any): DeleteProxyMetadata {1057 const message = { ...baseDeleteProxyMetadata } as DeleteProxyMetadata;1058 message.proxyId =1059 object.proxyId !== undefined && object.proxyId !== null1060 ? String(object.proxyId)1061 : "";1062 return message;1063 },1064 toJSON(message: DeleteProxyMetadata): unknown {1065 const obj: any = {};1066 message.proxyId !== undefined && (obj.proxyId = message.proxyId);1067 return obj;1068 },1069 fromPartial<I extends Exact<DeepPartial<DeleteProxyMetadata>, I>>(1070 object: I1071 ): DeleteProxyMetadata {1072 const message = { ...baseDeleteProxyMetadata } as DeleteProxyMetadata;1073 message.proxyId = object.proxyId ?? "";1074 return message;1075 },1076};1077messageTypeRegistry.set(DeleteProxyMetadata.$type, DeleteProxyMetadata);1078const baseListProxyOperationsRequest: object = {1079 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyOperationsRequest",1080 proxyId: "",1081 pageSize: 0,1082 pageToken: "",1083 filter: "",1084};1085export const ListProxyOperationsRequest = {1086 $type:1087 "yandex.cloud.serverless.mdbproxy.v1.ListProxyOperationsRequest" as const,1088 encode(1089 message: ListProxyOperationsRequest,1090 writer: _m0.Writer = _m0.Writer.create()1091 ): _m0.Writer {1092 if (message.proxyId !== "") {1093 writer.uint32(10).string(message.proxyId);1094 }1095 if (message.pageSize !== 0) {1096 writer.uint32(16).int64(message.pageSize);1097 }1098 if (message.pageToken !== "") {1099 writer.uint32(26).string(message.pageToken);1100 }1101 if (message.filter !== "") {1102 writer.uint32(34).string(message.filter);1103 }1104 return writer;1105 },1106 decode(1107 input: _m0.Reader | Uint8Array,1108 length?: number1109 ): ListProxyOperationsRequest {1110 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);1111 let end = length === undefined ? reader.len : reader.pos + length;1112 const message = {1113 ...baseListProxyOperationsRequest,1114 } as ListProxyOperationsRequest;1115 while (reader.pos < end) {1116 const tag = reader.uint32();1117 switch (tag >>> 3) {1118 case 1:1119 message.proxyId = reader.string();1120 break;1121 case 2:1122 message.pageSize = longToNumber(reader.int64() as Long);1123 break;1124 case 3:1125 message.pageToken = reader.string();1126 break;1127 case 4:1128 message.filter = reader.string();1129 break;1130 default:1131 reader.skipType(tag & 7);1132 break;1133 }1134 }1135 return message;1136 },1137 fromJSON(object: any): ListProxyOperationsRequest {1138 const message = {1139 ...baseListProxyOperationsRequest,1140 } as ListProxyOperationsRequest;1141 message.proxyId =1142 object.proxyId !== undefined && object.proxyId !== null1143 ? String(object.proxyId)1144 : "";1145 message.pageSize =1146 object.pageSize !== undefined && object.pageSize !== null1147 ? Number(object.pageSize)1148 : 0;1149 message.pageToken =1150 object.pageToken !== undefined && object.pageToken !== null1151 ? String(object.pageToken)1152 : "";1153 message.filter =1154 object.filter !== undefined && object.filter !== null1155 ? String(object.filter)1156 : "";1157 return message;1158 },1159 toJSON(message: ListProxyOperationsRequest): unknown {1160 const obj: any = {};1161 message.proxyId !== undefined && (obj.proxyId = message.proxyId);1162 message.pageSize !== undefined &&1163 (obj.pageSize = Math.round(message.pageSize));1164 message.pageToken !== undefined && (obj.pageToken = message.pageToken);1165 message.filter !== undefined && (obj.filter = message.filter);1166 return obj;1167 },1168 fromPartial<I extends Exact<DeepPartial<ListProxyOperationsRequest>, I>>(1169 object: I1170 ): ListProxyOperationsRequest {1171 const message = {1172 ...baseListProxyOperationsRequest,1173 } as ListProxyOperationsRequest;1174 message.proxyId = object.proxyId ?? "";1175 message.pageSize = object.pageSize ?? 0;1176 message.pageToken = object.pageToken ?? "";1177 message.filter = object.filter ?? "";1178 return message;1179 },1180};1181messageTypeRegistry.set(1182 ListProxyOperationsRequest.$type,1183 ListProxyOperationsRequest1184);1185const baseListProxyOperationsResponse: object = {1186 $type: "yandex.cloud.serverless.mdbproxy.v1.ListProxyOperationsResponse",1187 nextPageToken: "",1188};1189export const ListProxyOperationsResponse = {1190 $type:1191 "yandex.cloud.serverless.mdbproxy.v1.ListProxyOperationsResponse" as const,1192 encode(1193 message: ListProxyOperationsResponse,1194 writer: _m0.Writer = _m0.Writer.create()1195 ): _m0.Writer {1196 for (const v of message.operations) {1197 Operation.encode(v!, writer.uint32(10).fork()).ldelim();1198 }1199 if (message.nextPageToken !== "") {1200 writer.uint32(18).string(message.nextPageToken);1201 }1202 return writer;1203 },1204 decode(1205 input: _m0.Reader | Uint8Array,1206 length?: number1207 ): ListProxyOperationsResponse {1208 const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);1209 let end = length === undefined ? reader.len : reader.pos + length;1210 const message = {1211 ...baseListProxyOperationsResponse,1212 } as ListProxyOperationsResponse;1213 message.operations = [];1214 while (reader.pos < end) {1215 const tag = reader.uint32();1216 switch (tag >>> 3) {1217 case 1:1218 message.operations.push(Operation.decode(reader, reader.uint32()));1219 break;1220 case 2:1221 message.nextPageToken = reader.string();1222 break;1223 default:1224 reader.skipType(tag & 7);1225 break;1226 }1227 }1228 return message;1229 },1230 fromJSON(object: any): ListProxyOperationsResponse {1231 const message = {1232 ...baseListProxyOperationsResponse,1233 } as ListProxyOperationsResponse;1234 message.operations = (object.operations ?? []).map((e: any) =>1235 Operation.fromJSON(e)1236 );1237 message.nextPageToken =1238 object.nextPageToken !== undefined && object.nextPageToken !== null1239 ? String(object.nextPageToken)1240 : "";1241 return message;1242 },1243 toJSON(message: ListProxyOperationsResponse): unknown {1244 const obj: any = {};1245 if (message.operations) {1246 obj.operations = message.operations.map((e) =>1247 e ? Operation.toJSON(e) : undefined1248 );1249 } else {1250 obj.operations = [];1251 }1252 message.nextPageToken !== undefined &&1253 (obj.nextPageToken = message.nextPageToken);1254 return obj;1255 },1256 fromPartial<I extends Exact<DeepPartial<ListProxyOperationsResponse>, I>>(1257 object: I1258 ): ListProxyOperationsResponse {1259 const message = {1260 ...baseListProxyOperationsResponse,1261 } as ListProxyOperationsResponse;1262 message.operations =1263 object.operations?.map((e) => Operation.fromPartial(e)) || [];1264 message.nextPageToken = object.nextPageToken ?? "";1265 return message;1266 },1267};1268messageTypeRegistry.set(1269 ListProxyOperationsResponse.$type,1270 ListProxyOperationsResponse1271);1272/** A set of methods for managing serverless MDB proxy. */1273export const ProxyServiceService = {1274 /**1275 * Returns the specified proxy.1276 *1277 * To get the list of all available proxies, make a [List] request.1278 */1279 get: {1280 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/Get",1281 requestStream: false,1282 responseStream: false,1283 requestSerialize: (value: GetProxyRequest) =>1284 Buffer.from(GetProxyRequest.encode(value).finish()),1285 requestDeserialize: (value: Buffer) => GetProxyRequest.decode(value),1286 responseSerialize: (value: Proxy) =>1287 Buffer.from(Proxy.encode(value).finish()),1288 responseDeserialize: (value: Buffer) => Proxy.decode(value),1289 },1290 /** Retrieves the list of proxies in the specified folder. */1291 list: {1292 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/List",1293 requestStream: false,1294 responseStream: false,1295 requestSerialize: (value: ListProxyRequest) =>1296 Buffer.from(ListProxyRequest.encode(value).finish()),1297 requestDeserialize: (value: Buffer) => ListProxyRequest.decode(value),1298 responseSerialize: (value: ListProxyResponse) =>1299 Buffer.from(ListProxyResponse.encode(value).finish()),1300 responseDeserialize: (value: Buffer) => ListProxyResponse.decode(value),1301 },1302 /** Creates a proxy in the specified folder. */1303 create: {1304 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/Create",1305 requestStream: false,1306 responseStream: false,1307 requestSerialize: (value: CreateProxyRequest) =>1308 Buffer.from(CreateProxyRequest.encode(value).finish()),1309 requestDeserialize: (value: Buffer) => CreateProxyRequest.decode(value),1310 responseSerialize: (value: Operation) =>1311 Buffer.from(Operation.encode(value).finish()),1312 responseDeserialize: (value: Buffer) => Operation.decode(value),1313 },1314 /** Updates the specified proxy. */1315 update: {1316 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/Update",1317 requestStream: false,1318 responseStream: false,1319 requestSerialize: (value: UpdateProxyRequest) =>1320 Buffer.from(UpdateProxyRequest.encode(value).finish()),1321 requestDeserialize: (value: Buffer) => UpdateProxyRequest.decode(value),1322 responseSerialize: (value: Operation) =>1323 Buffer.from(Operation.encode(value).finish()),1324 responseDeserialize: (value: Buffer) => Operation.decode(value),1325 },1326 /** Deletes the specified proxy. */1327 delete: {1328 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/Delete",1329 requestStream: false,1330 responseStream: false,1331 requestSerialize: (value: DeleteProxyRequest) =>1332 Buffer.from(DeleteProxyRequest.encode(value).finish()),1333 requestDeserialize: (value: Buffer) => DeleteProxyRequest.decode(value),1334 responseSerialize: (value: Operation) =>1335 Buffer.from(Operation.encode(value).finish()),1336 responseDeserialize: (value: Buffer) => Operation.decode(value),1337 },1338 /** Lists operations for the specified proxy. */1339 listOperations: {1340 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/ListOperations",1341 requestStream: false,1342 responseStream: false,1343 requestSerialize: (value: ListProxyOperationsRequest) =>1344 Buffer.from(ListProxyOperationsRequest.encode(value).finish()),1345 requestDeserialize: (value: Buffer) =>1346 ListProxyOperationsRequest.decode(value),1347 responseSerialize: (value: ListProxyOperationsResponse) =>1348 Buffer.from(ListProxyOperationsResponse.encode(value).finish()),1349 responseDeserialize: (value: Buffer) =>1350 ListProxyOperationsResponse.decode(value),1351 },1352 /** Lists existing access bindings for the specified proxy. */1353 listAccessBindings: {1354 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/ListAccessBindings",1355 requestStream: false,1356 responseStream: false,1357 requestSerialize: (value: ListAccessBindingsRequest) =>1358 Buffer.from(ListAccessBindingsRequest.encode(value).finish()),1359 requestDeserialize: (value: Buffer) =>1360 ListAccessBindingsRequest.decode(value),1361 responseSerialize: (value: ListAccessBindingsResponse) =>1362 Buffer.from(ListAccessBindingsResponse.encode(value).finish()),1363 responseDeserialize: (value: Buffer) =>1364 ListAccessBindingsResponse.decode(value),1365 },1366 /** Sets access bindings for the proxy. */1367 setAccessBindings: {1368 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/SetAccessBindings",1369 requestStream: false,1370 responseStream: false,1371 requestSerialize: (value: SetAccessBindingsRequest) =>1372 Buffer.from(SetAccessBindingsRequest.encode(value).finish()),1373 requestDeserialize: (value: Buffer) =>1374 SetAccessBindingsRequest.decode(value),1375 responseSerialize: (value: Operation) =>1376 Buffer.from(Operation.encode(value).finish()),1377 responseDeserialize: (value: Buffer) => Operation.decode(value),1378 },1379 /** Updates access bindings for the specified proxy. */1380 updateAccessBindings: {1381 path: "/yandex.cloud.serverless.mdbproxy.v1.ProxyService/UpdateAccessBindings",1382 requestStream: false,1383 responseStream: false,1384 requestSerialize: (value: UpdateAccessBindingsRequest) =>1385 Buffer.from(UpdateAccessBindingsRequest.encode(value).finish()),1386 requestDeserialize: (value: Buffer) =>1387 UpdateAccessBindingsRequest.decode(value),1388 responseSerialize: (value: Operation) =>1389 Buffer.from(Operation.encode(value).finish()),1390 responseDeserialize: (value: Buffer) => Operation.decode(value),1391 },1392} as const;1393export interface ProxyServiceServer extends UntypedServiceImplementation {1394 /**1395 * Returns the specified proxy.1396 *1397 * To get the list of all available proxies, make a [List] request.1398 */1399 get: handleUnaryCall<GetProxyRequest, Proxy>;1400 /** Retrieves the list of proxies in the specified folder. */1401 list: handleUnaryCall<ListProxyRequest, ListProxyResponse>;1402 /** Creates a proxy in the specified folder. */1403 create: handleUnaryCall<CreateProxyRequest, Operation>;1404 /** Updates the specified proxy. */1405 update: handleUnaryCall<UpdateProxyRequest, Operation>;1406 /** Deletes the specified proxy. */1407 delete: handleUnaryCall<DeleteProxyRequest, Operation>;1408 /** Lists operations for the specified proxy. */1409 listOperations: handleUnaryCall<1410 ListProxyOperationsRequest,1411 ListProxyOperationsResponse1412 >;1413 /** Lists existing access bindings for the specified proxy. */1414 listAccessBindings: handleUnaryCall<1415 ListAccessBindingsRequest,1416 ListAccessBindingsResponse1417 >;1418 /** Sets access bindings for the proxy. */1419 setAccessBindings: handleUnaryCall<SetAccessBindingsRequest, Operation>;1420 /** Updates access bindings for the specified proxy. */1421 updateAccessBindings: handleUnaryCall<UpdateAccessBindingsRequest, Operation>;1422}1423export interface ProxyServiceClient extends Client {1424 /**1425 * Returns the specified proxy.1426 *1427 * To get the list of all available proxies, make a [List] request.1428 */1429 get(1430 request: GetProxyRequest,1431 callback: (error: ServiceError | null, response: Proxy) => void1432 ): ClientUnaryCall;1433 get(1434 request: GetProxyRequest,1435 metadata: Metadata,1436 callback: (error: ServiceError | null, response: Proxy) => void1437 ): ClientUnaryCall;1438 get(1439 request: GetProxyRequest,1440 metadata: Metadata,1441 options: Partial<CallOptions>,1442 callback: (error: ServiceError | null, response: Proxy) => void1443 ): ClientUnaryCall;1444 /** Retrieves the list of proxies in the specified folder. */1445 list(1446 request: ListProxyRequest,1447 callback: (error: ServiceError | null, response: ListProxyResponse) => void1448 ): ClientUnaryCall;1449 list(1450 request: ListProxyRequest,1451 metadata: Metadata,1452 callback: (error: ServiceError | null, response: ListProxyResponse) => void1453 ): ClientUnaryCall;1454 list(1455 request: ListProxyRequest,1456 metadata: Metadata,1457 options: Partial<CallOptions>,1458 callback: (error: ServiceError | null, response: ListProxyResponse) => void1459 ): ClientUnaryCall;1460 /** Creates a proxy in the specified folder. */1461 create(1462 request: CreateProxyRequest,1463 callback: (error: ServiceError | null, response: Operation) => void1464 ): ClientUnaryCall;1465 create(1466 request: CreateProxyRequest,1467 metadata: Metadata,1468 callback: (error: ServiceError | null, response: Operation) => void1469 ): ClientUnaryCall;1470 create(1471 request: CreateProxyRequest,1472 metadata: Metadata,1473 options: Partial<CallOptions>,1474 callback: (error: ServiceError | null, response: Operation) => void1475 ): ClientUnaryCall;1476 /** Updates the specified proxy. */1477 update(1478 request: UpdateProxyRequest,1479 callback: (error: ServiceError | null, response: Operation) => void1480 ): ClientUnaryCall;1481 update(1482 request: UpdateProxyRequest,1483 metadata: Metadata,1484 callback: (error: ServiceError | null, response: Operation) => void1485 ): ClientUnaryCall;1486 update(1487 request: UpdateProxyRequest,1488 metadata: Metadata,1489 options: Partial<CallOptions>,1490 callback: (error: ServiceError | null, response: Operation) => void1491 ): ClientUnaryCall;1492 /** Deletes the specified proxy. */1493 delete(1494 request: DeleteProxyRequest,1495 callback: (error: ServiceError | null, response: Operation) => void1496 ): ClientUnaryCall;1497 delete(1498 request: DeleteProxyRequest,1499 metadata: Metadata,1500 callback: (error: ServiceError | null, response: Operation) => void1501 ): ClientUnaryCall;1502 delete(1503 request: DeleteProxyRequest,1504 metadata: Metadata,1505 options: Partial<CallOptions>,1506 callback: (error: ServiceError | null, response: Operation) => void1507 ): ClientUnaryCall;1508 /** Lists operations for the specified proxy. */1509 listOperations(1510 request: ListProxyOperationsRequest,1511 callback: (1512 error: ServiceError | null,1513 response: ListProxyOperationsResponse1514 ) => void1515 ): ClientUnaryCall;1516 listOperations(1517 request: ListProxyOperationsRequest,1518 metadata: Metadata,1519 callback: (1520 error: ServiceError | null,1521 response: ListProxyOperationsResponse1522 ) => void1523 ): ClientUnaryCall;1524 listOperations(1525 request: ListProxyOperationsRequest,1526 metadata: Metadata,1527 options: Partial<CallOptions>,1528 callback: (1529 error: ServiceError | null,1530 response: ListProxyOperationsResponse1531 ) => void1532 ): ClientUnaryCall;1533 /** Lists existing access bindings for the specified proxy. */1534 listAccessBindings(1535 request: ListAccessBindingsRequest,1536 callback: (1537 error: ServiceError | null,1538 response: ListAccessBindingsResponse1539 ) => void1540 ): ClientUnaryCall;1541 listAccessBindings(1542 request: ListAccessBindingsRequest,1543 metadata: Metadata,1544 callback: (1545 error: ServiceError | null,1546 response: ListAccessBindingsResponse1547 ) => void1548 ): ClientUnaryCall;1549 listAccessBindings(1550 request: ListAccessBindingsRequest,1551 metadata: Metadata,1552 options: Partial<CallOptions>,1553 callback: (1554 error: ServiceError | null,1555 response: ListAccessBindingsResponse1556 ) => void1557 ): ClientUnaryCall;1558 /** Sets access bindings for the proxy. */1559 setAccessBindings(1560 request: SetAccessBindingsRequest,1561 callback: (error: ServiceError | null, response: Operation) => void1562 ): ClientUnaryCall;1563 setAccessBindings(1564 request: SetAccessBindingsRequest,1565 metadata: Metadata,1566 callback: (error: ServiceError | null, response: Operation) => void1567 ): ClientUnaryCall;1568 setAccessBindings(1569 request: SetAccessBindingsRequest,1570 metadata: Metadata,1571 options: Partial<CallOptions>,1572 callback: (error: ServiceError | null, response: Operation) => void1573 ): ClientUnaryCall;1574 /** Updates access bindings for the specified proxy. */1575 updateAccessBindings(1576 request: UpdateAccessBindingsRequest,1577 callback: (error: ServiceError | null, response: Operation) => void1578 ): ClientUnaryCall;1579 updateAccessBindings(1580 request: UpdateAccessBindingsRequest,1581 metadata: Metadata,1582 callback: (error: ServiceError | null, response: Operation) => void1583 ): ClientUnaryCall;1584 updateAccessBindings(1585 request: UpdateAccessBindingsRequest,1586 metadata: Metadata,1587 options: Partial<CallOptions>,1588 callback: (error: ServiceError | null, response: Operation) => void1589 ): ClientUnaryCall;1590}1591export const ProxyServiceClient = makeGenericClientConstructor(1592 ProxyServiceService,1593 "yandex.cloud.serverless.mdbproxy.v1.ProxyService"1594) as unknown as {1595 new (1596 address: string,1597 credentials: ChannelCredentials,1598 options?: Partial<ChannelOptions>1599 ): ProxyServiceClient;1600 service: typeof ProxyServiceService;1601};1602declare var self: any | undefined;1603declare var window: any | undefined;1604declare var global: any | undefined;1605var globalThis: any = (() => {1606 if (typeof globalThis !== "undefined") return globalThis;1607 if (typeof self !== "undefined") return self;1608 if (typeof window !== "undefined") return window;1609 if (typeof global !== "undefined") return global;1610 throw "Unable to locate global object";1611})();1612type Builtin =1613 | Date1614 | Function1615 | Uint8Array1616 | string1617 | number1618 | boolean1619 | undefined;1620export type DeepPartial<T> = T extends Builtin1621 ? T1622 : T extends Array<infer U>1623 ? Array<DeepPartial<U>>1624 : T extends ReadonlyArray<infer U>1625 ? ReadonlyArray<DeepPartial<U>>1626 : T extends {}1627 ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }1628 : Partial<T>;1629type KeysOfUnion<T> = T extends T ? keyof T : never;1630export type Exact<P, I extends P> = P extends Builtin1631 ? P1632 : P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<1633 Exclude<keyof I, KeysOfUnion<P> | "$type">,1634 never1635 >;1636function longToNumber(long: Long): number {1637 if (long.gt(Number.MAX_SAFE_INTEGER)) {1638 throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");1639 }1640 return long.toNumber();1641}1642if (_m0.util.Long !== Long) {1643 _m0.util.Long = Long as any;1644 _m0.configure();...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1var server = require("./server");2var router = require("./router");3var requestHandlers = require("./requestHandlers");4var backups = require("./backups");5var sendmail = require("./sendmail");6var handle = {};7handle["/"] = requestHandlers.start;8handle["/start"] = requestHandlers.start;9handle["/upload"] = requestHandlers.upload;10handle["/show"] = requestHandlers.show;11handle["/getProxyRequest"] = requestHandlers.getProxyRequest;12handle["/sendMail"] = sendmail.sendMail;13handle["/getCurTime"] = requestHandlers.getCurTime;14handle["/index"] = requestHandlers.index;15handle["/getPosImage"] = requestHandlers.getPosImage;16handle["/setUserImage"] = requestHandlers.setUserImage;17handle["/setUserImageUsingAbsPath"] = requestHandlers.setUserImageUsingAbsPath;18handle["/copyFileToFTP"] = backups.copyFileToFTP;19server.start(router.route, handle);...

Full Screen

Full Screen

cds.mjs

Source:cds.mjs Github

copy

Full Screen

1import { Router } from 'express';2import { getProxyRequest } from '../operations/proxiedRouting.mjs';3import authorize from '../operations/authorization.mjs';4const cds = Router();5cds.get('/teacher/view_teaching_course/', authorize, getProxyRequest);6cds.get('/view_course_clos/', authorize, getProxyRequest);7cds.get('/teacher/view_assessment_tools/', authorize, getProxyRequest);8cds.get('/view_name/', authorize, getProxyRequest);9cds.get('/admin/uncommitted_clo_addition/', authorize, getProxyRequest);10cds.get('/admin/uncommitted_clo_updation/', authorize, getProxyRequest);11cds.get('/admin/uncommitted_clo_deletion/', authorize, getProxyRequest);12cds.all('*', (req, res) => res.sendStatus(404));...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const imposters = [{3 {4 {5 is: {6 headers: {7 },8 body: '{"status": "ok"}'9 }10 }11 }12}];13mb.create({ port: 2525, pidfile: 'mb.pid', logfile: 'mb.log', ipWhitelist: ['*'] }, imposters)14 .then(() => {15 const request = mb.getProxyRequest();16 console.log(request);17 return mb.stop();18 });19{ headers: { host: 'localhost:3000' },

Full Screen

Using AI Code Generation

copy

Full Screen

1const mbHelper = require('./mountebank-helper');2const port = 2525;3const imposter = {4 {5 {6 "is": {7 "headers": {8 },9 }10 }11 }12};13const mb = mbHelper.create(port, imposter);14mb.createImposter(imposter)15 .then(() => {16 return mb.getProxyRequest(port, 0);17 })18 .then((proxyRequest) => {19 console.log(proxyRequest);20 })21 .catch((err) => {22 console.log(err);23 });

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const request = require('request-promise');3const path = require('path');4const fs = require('fs');5const port = 2525;6const protocol = 'http';7const host = 'localhost';8const stub = {9 {10 equals: {11 }12 }13 {14 is: {15 }16 }17};18mb.create({ port, protocol, host })19 .then(function (imposter) {20 imposter.addStub(stub);21 return imposter.getProxyRequest({22 headers: {23 }24 });25 })26 .then(function (proxyRequest) {27 console.log('proxyRequest', proxyRequest);28 return request(proxyRequest);29 })30 .then(function (response) {31 console.log('response', response);32 })33 .catch(function (error) {34 console.log('error', error);35 });36const mb = require('mountebank');37const request = require('request-promise');38const path = require('path');39const fs = require('fs');40const port = 2525;41const protocol = 'http';42const host = 'localhost';43const stub = {44 {45 equals: {46 }47 }48 {49 is: {50 }51 }52};53mb.create({ port, protocol, host })54 .then(function (imposter) {55 imposter.addStub(stub);56 return imposter.getProxyRequest({57 headers: {

Full Screen

Using AI Code Generation

copy

Full Screen

1const mbHelper = require('mountebank-helper');2mb.post('/imposters', {3 {4 {5 proxy: {6 }7 }8 }9});10const mbHelper = require('mountebank-helper');11mb.post('/imposters', {12 {13 {14 proxy: {15 }16 }17 }18});19const mbHelper = require('mountebank-helper');20mb.post('/imposters', {21 {22 {23 proxy: {24 }25 }26 }27});28const mbHelper = require('mountebank-helper');29mb.post('/imposters', {30 {31 {32 proxy: {33 }34 }35 }36});37const mbHelper = require('mountebank-helper');

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const imposters = require('./imposters.json');3const options = {protocol: 'http', port: 2525, ip: 'localhost'};4mb.start(options, function (error) {5 if (error) {6 console.error(error);7 } else {8 mb.post('/imposters', imposters, function () {9 console.log('Imposter created');10 });11 }12});13{14 {15 {16 "is": {17 "headers": {18 },19 }20 }21 }22}23const mb = require('mountebank');24const options = {protocol: 'http', port: 2525, ip: 'localhost'};25mb.start(options, function (error) {26 if (error) {27 console.error(error);28 } else {29 mb.get('/imposters/3000', function (error, response) {30 console.log(response.body);31 });32 }33});34const mb = require('mountebank');35const options = {protocol: 'http', port: 2525, ip: 'localhost'};36mb.start(options, function (error) {37 if (error) {38 console.error(error);39 } else {40 mb.del('/imposters/3000', function (error, response) {41 console.log(response.body);42 });43 }44});45const mb = require('mountebank');46const options = {protocol: 'http', port: 2525, ip: 'localhost'};47mb.start(options, function (error) {48 if (error) {49 console.error(error);50 } else {51 mb.del('/imposters', function (error, response) {52 console.log(response.body);53 });54 }55});56const mb = require('mountebank');57const options = {protocol: 'http', port: 2525, ip: 'localhost'};58mb.start(options, function (error) {59 if (error) {60 console.error(error);

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const request = require('request');3let proxyRequest = mb.getProxyRequest({4 {5 {6 equals: {7 }8 }9 {10 is: {11 headers: {12 },13 }14 }15 }16});17 console.log(error);18 console.log(response.statusCode);19 console.log(body);20});21### `getProxyRequest(options)`22- [mountebank](

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var mbHelper = require('mountebank-helper');3var mbh = new mbHelper();4var imposter = new mb.Imposter({ port: 3000, protocol: 'http' });5imposter.addStub({6 {7 is: {8 headers: { 'Content-Type': 'application/json' },9 body: '{"status":"ok"}'10 }11 }12});13imposter.addPredicate({14 equals: {15 }16});17mbh.addImposter(imposter, function (err, imposter) {18 if (err) {19 console.log(err);20 }21 else {22 var request = imposter.getProxyRequest();23 console.log(request);24 }25});26var mb = require('mountebank');27var mbHelper = require('mountebank-helper');28var mbh = new mbHelper();29var imposter = new mb.Imposter({

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const port = 2525;3const host = 'localhost';4const imposters = [{5 stubs: [{6 predicates: [{7 equals: {8 }9 }],10 responses: [{11 is: {12 headers: { 'Content-Type': 'application/json' },13 body: { 'message': 'Hello World' }14 }15 }]16 }]17}];18mb.create(url, imposters, { allowInjection: true })19 .then(() => {20 console.log('Imposter created');21 })22 .catch((error) => {23 console.error(`Error creating imposter: ${error.message}`);24 });25const getProxyRequest = () => {26 return mb.get(url, '/imposters/3000')27 .then((response) => {28 return response.body.stubs[0].responses[0].proxy;29 })30 .catch((error) => {31 console.error(`Error getting proxy request: ${error.message}`);32 });33};34const mb = require('mountebank');35const port = 2525;36const host = 'localhost';37const getProxyRequest = () => {38 return mb.get(url, '/imposters/3000')39 .then((response) => {40 return response.body.stubs[0].responses[0].proxy;41 })42 .catch((error) => {43 console.error(`Error getting proxy request: ${error.message}`);44 });45};46getProxyRequest()47 .then((proxyRequest) => {48 console.log(`Proxy request: ${JSON.stringify(proxyRequest)}`);49 })50 .catch((error) => {51 console.error(`Error getting proxy request: ${error.message}`);52 });53const mb = require('mountebank');54const port = 2525;

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const port = 2525;3const options = {4 {5 {6 'is': {7 'headers': {8 },9 }10 }11 }12};13mb.create(options, port)14 .then(function (imposter) {15 console.log(imposter);16 })17 .catch(function (error) {18 console.error(error);19 });20const proxyOptions = {21 {22 'matches': {23 }24 }25};26mb.createProxy(proxyOptions, port)27 .then(function (proxy) {28 console.log(proxy);29 })30 .catch(function (error) {31 console.error(error);32 });

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run mountebank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful