|
| 1 | +// @generated by protobuf-ts 2.11.1 |
| 2 | +// @generated from protobuf file "polycentric/v2/verifications_service.proto" (package "polycentric.v2", syntax proto3) |
| 3 | +// tslint:disable |
| 4 | +import { ServiceType } from "@protobuf-ts/runtime-rpc"; |
| 5 | +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; |
| 6 | +import type { IBinaryWriter } from "@protobuf-ts/runtime"; |
| 7 | +import { WireType } from "@protobuf-ts/runtime"; |
| 8 | +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; |
| 9 | +import type { IBinaryReader } from "@protobuf-ts/runtime"; |
| 10 | +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; |
| 11 | +import type { PartialMessage } from "@protobuf-ts/runtime"; |
| 12 | +import { reflectionMergePartial } from "@protobuf-ts/runtime"; |
| 13 | +import { MessageType } from "@protobuf-ts/runtime"; |
| 14 | +import { EventBundle } from "./events"; |
| 15 | +// RPC surface for verification claims. Kept separate from |
| 16 | +// verifications.proto because the response references EventBundle |
| 17 | +// (events.proto), and events.proto -> content.proto -> verifications.proto |
| 18 | +// already form a chain; importing events.proto from verifications.proto |
| 19 | +// would create a cyclic import. |
| 20 | + |
| 21 | +/** |
| 22 | + * @generated from protobuf message polycentric.v2.ListClaimsRequest |
| 23 | + */ |
| 24 | +export interface ListClaimsRequest { |
| 25 | + /** |
| 26 | + * Identity whose verification claims to list. |
| 27 | + * |
| 28 | + * @generated from protobuf field: string claimed_by_identity = 1 |
| 29 | + */ |
| 30 | + claimedByIdentity: string; |
| 31 | +} |
| 32 | +/** |
| 33 | + * @generated from protobuf message polycentric.v2.ListClaimsResponse |
| 34 | + */ |
| 35 | +export interface ListClaimsResponse { |
| 36 | + /** |
| 37 | + * Claim events created by the identity, newest first. |
| 38 | + * |
| 39 | + * @generated from protobuf field: repeated polycentric.v2.EventBundle event_bundles = 1 |
| 40 | + */ |
| 41 | + eventBundles: EventBundle[]; |
| 42 | +} |
| 43 | +// @generated message type with reflection information, may provide speed optimized methods |
| 44 | +class ListClaimsRequest$Type extends MessageType<ListClaimsRequest> { |
| 45 | + constructor() { |
| 46 | + super("polycentric.v2.ListClaimsRequest", [ |
| 47 | + { no: 1, name: "claimed_by_identity", kind: "scalar", T: 9 /*ScalarType.STRING*/ } |
| 48 | + ]); |
| 49 | + } |
| 50 | + create(value?: PartialMessage<ListClaimsRequest>): ListClaimsRequest { |
| 51 | + const message = globalThis.Object.create((this.messagePrototype!)); |
| 52 | + message.claimedByIdentity = ""; |
| 53 | + if (value !== undefined) |
| 54 | + reflectionMergePartial<ListClaimsRequest>(this, message, value); |
| 55 | + return message; |
| 56 | + } |
| 57 | + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListClaimsRequest): ListClaimsRequest { |
| 58 | + let message = target ?? this.create(), end = reader.pos + length; |
| 59 | + while (reader.pos < end) { |
| 60 | + let [fieldNo, wireType] = reader.tag(); |
| 61 | + switch (fieldNo) { |
| 62 | + case /* string claimed_by_identity */ 1: |
| 63 | + message.claimedByIdentity = reader.string(); |
| 64 | + break; |
| 65 | + default: |
| 66 | + let u = options.readUnknownField; |
| 67 | + if (u === "throw") |
| 68 | + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); |
| 69 | + let d = reader.skip(wireType); |
| 70 | + if (u !== false) |
| 71 | + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); |
| 72 | + } |
| 73 | + } |
| 74 | + return message; |
| 75 | + } |
| 76 | + internalBinaryWrite(message: ListClaimsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { |
| 77 | + /* string claimed_by_identity = 1; */ |
| 78 | + if (message.claimedByIdentity !== "") |
| 79 | + writer.tag(1, WireType.LengthDelimited).string(message.claimedByIdentity); |
| 80 | + let u = options.writeUnknownFields; |
| 81 | + if (u !== false) |
| 82 | + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); |
| 83 | + return writer; |
| 84 | + } |
| 85 | +} |
| 86 | +/** |
| 87 | + * @generated MessageType for protobuf message polycentric.v2.ListClaimsRequest |
| 88 | + */ |
| 89 | +export const ListClaimsRequest = new ListClaimsRequest$Type(); |
| 90 | +// @generated message type with reflection information, may provide speed optimized methods |
| 91 | +class ListClaimsResponse$Type extends MessageType<ListClaimsResponse> { |
| 92 | + constructor() { |
| 93 | + super("polycentric.v2.ListClaimsResponse", [ |
| 94 | + { no: 1, name: "event_bundles", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => EventBundle } |
| 95 | + ]); |
| 96 | + } |
| 97 | + create(value?: PartialMessage<ListClaimsResponse>): ListClaimsResponse { |
| 98 | + const message = globalThis.Object.create((this.messagePrototype!)); |
| 99 | + message.eventBundles = []; |
| 100 | + if (value !== undefined) |
| 101 | + reflectionMergePartial<ListClaimsResponse>(this, message, value); |
| 102 | + return message; |
| 103 | + } |
| 104 | + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListClaimsResponse): ListClaimsResponse { |
| 105 | + let message = target ?? this.create(), end = reader.pos + length; |
| 106 | + while (reader.pos < end) { |
| 107 | + let [fieldNo, wireType] = reader.tag(); |
| 108 | + switch (fieldNo) { |
| 109 | + case /* repeated polycentric.v2.EventBundle event_bundles */ 1: |
| 110 | + message.eventBundles.push(EventBundle.internalBinaryRead(reader, reader.uint32(), options)); |
| 111 | + break; |
| 112 | + default: |
| 113 | + let u = options.readUnknownField; |
| 114 | + if (u === "throw") |
| 115 | + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); |
| 116 | + let d = reader.skip(wireType); |
| 117 | + if (u !== false) |
| 118 | + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); |
| 119 | + } |
| 120 | + } |
| 121 | + return message; |
| 122 | + } |
| 123 | + internalBinaryWrite(message: ListClaimsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { |
| 124 | + /* repeated polycentric.v2.EventBundle event_bundles = 1; */ |
| 125 | + for (let i = 0; i < message.eventBundles.length; i++) |
| 126 | + EventBundle.internalBinaryWrite(message.eventBundles[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); |
| 127 | + let u = options.writeUnknownFields; |
| 128 | + if (u !== false) |
| 129 | + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); |
| 130 | + return writer; |
| 131 | + } |
| 132 | +} |
| 133 | +/** |
| 134 | + * @generated MessageType for protobuf message polycentric.v2.ListClaimsResponse |
| 135 | + */ |
| 136 | +export const ListClaimsResponse = new ListClaimsResponse$Type(); |
| 137 | +/** |
| 138 | + * @generated ServiceType for protobuf service polycentric.v2.VerificationsService |
| 139 | + */ |
| 140 | +export const VerificationsService = new ServiceType("polycentric.v2.VerificationsService", [ |
| 141 | + { name: "ListClaims", options: {}, I: ListClaimsRequest, O: ListClaimsResponse } |
| 142 | +]); |
0 commit comments