// @generated by protobuf-ts 2.7.0 with parameter long_type_string,generate_dependencies // @generated from protobuf file "parca/share/share.proto" (package "polarsignals.share", syntax proto3) // tslint:disable import { QueryResponse } from "../query/v1alpha1/query"; import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; import { WireType } from "@protobuf-ts/runtime"; import type { BinaryReadOptions } from "@protobuf-ts/runtime"; import type { IBinaryReader } from "@protobuf-ts/runtime"; import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; /** * UploadRequest represents the request with profile bytes and description. * * @generated from protobuf message polarsignals.share.UploadRequest */ export interface UploadRequest { /** * pprof bytes of the profile to be uploaded. * * @generated from protobuf field: bytes profile = 1; */ profile: Uint8Array; /** * Description of the profile. * * @generated from protobuf field: string description = 2; */ description: string; } /** * UploadResponse represents the response with the link that can be used to access the profile. * * @generated from protobuf message polarsignals.share.UploadResponse */ export interface UploadResponse { /** * id of the uploaded profile. * * @generated from protobuf field: string id = 1; */ id: string; /** * link that can be used to access the profile. * * @generated from protobuf field: string link = 2; */ link: string; } /** * ProfileRequest represents the request with the id of the profile to be queried. * * @generated from protobuf message polarsignals.share.ProfileRequest */ export interface ProfileRequest { /** * id of the profile to be queried. * * @generated from protobuf field: string id = 1; */ id: string; } // @generated message type with reflection information, may provide speed optimized methods class UploadRequest$Type extends MessageType { constructor() { super("polarsignals.share.UploadRequest", [ { no: 1, name: "profile", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): UploadRequest { const message = { profile: new Uint8Array(0), description: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadRequest): UploadRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* bytes profile */ 1: message.profile = reader.bytes(); break; case /* string description */ 2: message.description = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: UploadRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* bytes profile = 1; */ if (message.profile.length) writer.tag(1, WireType.LengthDelimited).bytes(message.profile); /* string description = 2; */ if (message.description !== "") writer.tag(2, WireType.LengthDelimited).string(message.description); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message polarsignals.share.UploadRequest */ export const UploadRequest = new UploadRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class UploadResponse$Type extends MessageType { constructor() { super("polarsignals.share.UploadResponse", [ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "link", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): UploadResponse { const message = { id: "", link: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadResponse): UploadResponse { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string id */ 1: message.id = reader.string(); break; case /* string link */ 2: message.link = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: UploadResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string id = 1; */ if (message.id !== "") writer.tag(1, WireType.LengthDelimited).string(message.id); /* string link = 2; */ if (message.link !== "") writer.tag(2, WireType.LengthDelimited).string(message.link); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message polarsignals.share.UploadResponse */ export const UploadResponse = new UploadResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class ProfileRequest$Type extends MessageType { constructor() { super("polarsignals.share.ProfileRequest", [ { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): ProfileRequest { const message = { id: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ProfileRequest): ProfileRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string id */ 1: message.id = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: ProfileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string id = 1; */ if (message.id !== "") writer.tag(1, WireType.LengthDelimited).string(message.id); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message polarsignals.share.ProfileRequest */ export const ProfileRequest = new ProfileRequest$Type(); /** * @generated ServiceType for protobuf service polarsignals.share.Share */ export const Share = new ServiceType("polarsignals.share.Share", [ { name: "Upload", options: {}, I: UploadRequest, O: UploadResponse }, { name: "Query", options: {}, I: ProfileRequest, O: QueryResponse } ]);