// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.6.1 // protoc unknown // source: Flight.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { type CallContext, type CallOptions } from "nice-grpc-common"; import { Timestamp } from "./google/protobuf/timestamp.js"; import { messageTypeRegistry } from "./typeRegistry.js"; export const protobufPackage = "arrow.flight.protocol"; /** * The result of a cancel operation. * * This is used by CancelFlightInfoResult.status. */ export enum CancelStatus { /** * UNSPECIFIED - The cancellation status is unknown. Servers should avoid using * this value (send a NOT_FOUND error if the requested query is * not known). Clients can retry the request. */ UNSPECIFIED = 0, /** * CANCELLED - The cancellation request is complete. Subsequent requests with * the same payload may return CANCELLED or a NOT_FOUND error. */ CANCELLED = 1, /** * CANCELLING - The cancellation request is in progress. The client may retry * the cancellation request. */ CANCELLING = 2, /** * NOT_CANCELLABLE - The query is not cancellable. The client should not retry the * cancellation request. */ NOT_CANCELLABLE = 3, UNRECOGNIZED = -1, } export function cancelStatusFromJSON(object: any): CancelStatus { switch (object) { case 0: case "CANCEL_STATUS_UNSPECIFIED": return CancelStatus.UNSPECIFIED; case 1: case "CANCEL_STATUS_CANCELLED": return CancelStatus.CANCELLED; case 2: case "CANCEL_STATUS_CANCELLING": return CancelStatus.CANCELLING; case 3: case "CANCEL_STATUS_NOT_CANCELLABLE": return CancelStatus.NOT_CANCELLABLE; case -1: case "UNRECOGNIZED": default: return CancelStatus.UNRECOGNIZED; } } export function cancelStatusToJSON(object: CancelStatus): string { switch (object) { case CancelStatus.UNSPECIFIED: return "CANCEL_STATUS_UNSPECIFIED"; case CancelStatus.CANCELLED: return "CANCEL_STATUS_CANCELLED"; case CancelStatus.CANCELLING: return "CANCEL_STATUS_CANCELLING"; case CancelStatus.NOT_CANCELLABLE: return "CANCEL_STATUS_NOT_CANCELLABLE"; case CancelStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } /** The request that a client provides to a server on handshake. */ export interface HandshakeRequest { $type: "arrow.flight.protocol.HandshakeRequest"; /** A defined protocol version */ readonly protocolVersion: bigint; /** Arbitrary auth/handshake info. */ readonly payload: Uint8Array; } export interface HandshakeResponse { $type: "arrow.flight.protocol.HandshakeResponse"; /** A defined protocol version */ readonly protocolVersion: bigint; /** Arbitrary auth/handshake info. */ readonly payload: Uint8Array; } /** A message for doing simple auth. */ export interface BasicAuth { $type: "arrow.flight.protocol.BasicAuth"; readonly username: string; readonly password: string; } export interface Empty { $type: "arrow.flight.protocol.Empty"; } /** * Describes an available action, including both the name used for execution * along with a short description of the purpose of the action. */ export interface ActionType { $type: "arrow.flight.protocol.ActionType"; readonly type: string; readonly description: string; } /** * A service specific expression that can be used to return a limited set * of available Arrow Flight streams. */ export interface Criteria { $type: "arrow.flight.protocol.Criteria"; readonly expression: Uint8Array; } /** An opaque action specific for the service. */ export interface Action { $type: "arrow.flight.protocol.Action"; readonly type: string; readonly body: Uint8Array; } /** * The request of the CancelFlightInfo action. * * The request should be stored in Action.body. */ export interface CancelFlightInfoRequest { $type: "arrow.flight.protocol.CancelFlightInfoRequest"; readonly info: FlightInfo | undefined; } /** * The request of the RenewFlightEndpoint action. * * The request should be stored in Action.body. */ export interface RenewFlightEndpointRequest { $type: "arrow.flight.protocol.RenewFlightEndpointRequest"; readonly endpoint: FlightEndpoint | undefined; } /** An opaque result returned after executing an action. */ export interface Result { $type: "arrow.flight.protocol.Result"; readonly body: Uint8Array; } /** * The result of the CancelFlightInfo action. * * The result should be stored in Result.body. */ export interface CancelFlightInfoResult { $type: "arrow.flight.protocol.CancelFlightInfoResult"; readonly status: CancelStatus; } /** Wrap the result of a getSchema call */ export interface SchemaResult { $type: "arrow.flight.protocol.SchemaResult"; /** * The schema of the dataset in its IPC form: * 4 bytes - an optional IPC_CONTINUATION_TOKEN prefix * 4 bytes - the byte length of the payload * a flatbuffer Message whose header is the Schema */ readonly schema: Uint8Array; } /** * The name or tag for a Flight. May be used as a way to retrieve or generate * a flight or be used to expose a set of previously defined flights. */ export interface FlightDescriptor { $type: "arrow.flight.protocol.FlightDescriptor"; readonly type: FlightDescriptor_DescriptorType; /** * Opaque value used to express a command. Should only be defined when * type = CMD. */ readonly cmd: Uint8Array; /** * List of strings identifying a particular dataset. Should only be defined * when type = PATH. */ readonly path: readonly string[]; } /** Describes what type of descriptor is defined. */ export enum FlightDescriptor_DescriptorType { /** UNKNOWN - Protobuf pattern, not used. */ UNKNOWN = 0, /** * PATH - A named path that identifies a dataset. A path is composed of a string * or list of strings describing a particular dataset. This is conceptually * similar to a path inside a filesystem. */ PATH = 1, /** CMD - An opaque command to generate a dataset. */ CMD = 2, UNRECOGNIZED = -1, } export function flightDescriptor_DescriptorTypeFromJSON(object: any): FlightDescriptor_DescriptorType { switch (object) { case 0: case "UNKNOWN": return FlightDescriptor_DescriptorType.UNKNOWN; case 1: case "PATH": return FlightDescriptor_DescriptorType.PATH; case 2: case "CMD": return FlightDescriptor_DescriptorType.CMD; case -1: case "UNRECOGNIZED": default: return FlightDescriptor_DescriptorType.UNRECOGNIZED; } } export function flightDescriptor_DescriptorTypeToJSON(object: FlightDescriptor_DescriptorType): string { switch (object) { case FlightDescriptor_DescriptorType.UNKNOWN: return "UNKNOWN"; case FlightDescriptor_DescriptorType.PATH: return "PATH"; case FlightDescriptor_DescriptorType.CMD: return "CMD"; case FlightDescriptor_DescriptorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } /** * The access coordinates for retrieval of a dataset. With a FlightInfo, a * consumer is able to determine how to retrieve a dataset. */ export interface FlightInfo { $type: "arrow.flight.protocol.FlightInfo"; /** * The schema of the dataset in its IPC form: * 4 bytes - an optional IPC_CONTINUATION_TOKEN prefix * 4 bytes - the byte length of the payload * a flatbuffer Message whose header is the Schema */ readonly schema: Uint8Array; /** The descriptor associated with this info. */ readonly flightDescriptor: | FlightDescriptor | undefined; /** * A list of endpoints associated with the flight. To consume the * whole flight, all endpoints (and hence all Tickets) must be * consumed. Endpoints can be consumed in any order. * * In other words, an application can use multiple endpoints to * represent partitioned data. * * If the returned data has an ordering, an application can use * "FlightInfo.ordered = true" or should return the all data in a * single endpoint. Otherwise, there is no ordering defined on * endpoints or the data within. * * A client can read ordered data by reading data from returned * endpoints, in order, from front to back. * * Note that a client may ignore "FlightInfo.ordered = true". If an * ordering is important for an application, an application must * choose one of them: * * * An application requires that all clients must read data in * returned endpoints order. * * An application must return the all data in a single endpoint. */ readonly endpoint: readonly FlightEndpoint[]; /** Set these to -1 if unknown. */ readonly totalRecords: bigint; readonly totalBytes: bigint; /** FlightEndpoints are in the same order as the data. */ readonly ordered: boolean; /** * Application-defined metadata. * * There is no inherent or required relationship between this * and the app_metadata fields in the FlightEndpoints or resulting * FlightData messages. Since this metadata is application-defined, * a given application could define there to be a relationship, * but there is none required by the spec. */ readonly appMetadata: Uint8Array; } /** The information to process a long-running query. */ export interface PollInfo { $type: "arrow.flight.protocol.PollInfo"; /** * The currently available results. * * If "flight_descriptor" is not specified, the query is complete * and "info" specifies all results. Otherwise, "info" contains * partial query results. * * Note that each PollInfo response contains a complete * FlightInfo (not just the delta between the previous and current * FlightInfo). * * Subsequent PollInfo responses may only append new endpoints to * info. * * Clients can begin fetching results via DoGet(Ticket) with the * ticket in the info before the query is * completed. FlightInfo.ordered is also valid. */ readonly info: | FlightInfo | undefined; /** * The descriptor the client should use on the next try. * If unset, the query is complete. */ readonly flightDescriptor: | FlightDescriptor | undefined; /** * Query progress. If known, must be in [0.0, 1.0] but need not be * monotonic or nondecreasing. If unknown, do not set. */ readonly progress?: | number | undefined; /** * Expiration time for this request. After this passes, the server * might not accept the retry descriptor anymore (and the query may * be cancelled). This may be updated on a call to PollFlightInfo. */ readonly expirationTime: Date | undefined; } /** A particular stream or split associated with a flight. */ export interface FlightEndpoint { $type: "arrow.flight.protocol.FlightEndpoint"; /** Token used to retrieve this stream. */ readonly ticket: | Ticket | undefined; /** * A list of URIs where this ticket can be redeemed via DoGet(). * * If the list is empty, the expectation is that the ticket can only * be redeemed on the current service where the ticket was * generated. * * If the list is not empty, the expectation is that the ticket can * be redeemed at any of the locations, and that the data returned * will be equivalent. In this case, the ticket may only be redeemed * at one of the given locations, and not (necessarily) on the * current service. * * In other words, an application can use multiple locations to * represent redundant and/or load balanced services. */ readonly location: readonly Location[]; /** * Expiration time of this stream. If present, clients may assume * they can retry DoGet requests. Otherwise, it is * application-defined whether DoGet requests may be retried. */ readonly expirationTime: | Date | undefined; /** * Application-defined metadata. * * There is no inherent or required relationship between this * and the app_metadata fields in the FlightInfo or resulting * FlightData messages. Since this metadata is application-defined, * a given application could define there to be a relationship, * but there is none required by the spec. */ readonly appMetadata: Uint8Array; } /** * A location where a Flight service will accept retrieval of a particular * stream given a ticket. */ export interface Location { $type: "arrow.flight.protocol.Location"; readonly uri: string; } /** * An opaque identifier that the service can use to retrieve a particular * portion of a stream. * * Tickets are meant to be single use. It is an error/application-defined * behavior to reuse a ticket. */ export interface Ticket { $type: "arrow.flight.protocol.Ticket"; readonly ticket: Uint8Array; } /** A batch of Arrow data as part of a stream of batches. */ export interface FlightData { $type: "arrow.flight.protocol.FlightData"; /** * The descriptor of the data. This is only relevant when a client is * starting a new DoPut stream. */ readonly flightDescriptor: | FlightDescriptor | undefined; /** Header for message data as described in Message.fbs::Message. */ readonly dataHeader: Uint8Array; /** Application-defined metadata. */ readonly appMetadata: Uint8Array; /** * The actual batch of Arrow data. Preferably handled with minimal-copies * coming last in the definition to help with sidecar patterns (it is * expected that some implementations will fetch this field off the wire * with specialized code to avoid extra memory copies). */ readonly dataBody: Uint8Array; } /** The response message associated with the submission of a DoPut. */ export interface PutResult { $type: "arrow.flight.protocol.PutResult"; readonly appMetadata: Uint8Array; } function createBaseHandshakeRequest(): HandshakeRequest { return { $type: "arrow.flight.protocol.HandshakeRequest", protocolVersion: 0n, payload: new Uint8Array(0) }; } export const HandshakeRequest: MessageFns = { $type: "arrow.flight.protocol.HandshakeRequest" as const, encode(message: HandshakeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.protocolVersion !== 0n) { if (BigInt.asUintN(64, message.protocolVersion) !== message.protocolVersion) { throw new globalThis.Error("value provided for field message.protocolVersion of type uint64 too large"); } writer.uint32(8).uint64(message.protocolVersion); } if (message.payload.length !== 0) { writer.uint32(18).bytes(message.payload); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): HandshakeRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHandshakeRequest() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.protocolVersion = reader.uint64() as bigint; continue; } case 2: { if (tag !== 18) { break; } message.payload = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): HandshakeRequest { return { $type: HandshakeRequest.$type, protocolVersion: isSet(object.protocolVersion) ? BigInt(object.protocolVersion) : 0n, payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0), }; }, toJSON(message: HandshakeRequest): unknown { const obj: any = {}; if (message.protocolVersion !== 0n) { obj.protocolVersion = message.protocolVersion.toString(); } if (message.payload.length !== 0) { obj.payload = base64FromBytes(message.payload); } return obj; }, create, I>>(base?: I): HandshakeRequest { return HandshakeRequest.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): HandshakeRequest { const message = createBaseHandshakeRequest() as any; message.protocolVersion = object.protocolVersion ?? 0n; message.payload = object.payload ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(HandshakeRequest.$type, HandshakeRequest); function createBaseHandshakeResponse(): HandshakeResponse { return { $type: "arrow.flight.protocol.HandshakeResponse", protocolVersion: 0n, payload: new Uint8Array(0) }; } export const HandshakeResponse: MessageFns = { $type: "arrow.flight.protocol.HandshakeResponse" as const, encode(message: HandshakeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.protocolVersion !== 0n) { if (BigInt.asUintN(64, message.protocolVersion) !== message.protocolVersion) { throw new globalThis.Error("value provided for field message.protocolVersion of type uint64 too large"); } writer.uint32(8).uint64(message.protocolVersion); } if (message.payload.length !== 0) { writer.uint32(18).bytes(message.payload); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): HandshakeResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHandshakeResponse() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.protocolVersion = reader.uint64() as bigint; continue; } case 2: { if (tag !== 18) { break; } message.payload = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): HandshakeResponse { return { $type: HandshakeResponse.$type, protocolVersion: isSet(object.protocolVersion) ? BigInt(object.protocolVersion) : 0n, payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0), }; }, toJSON(message: HandshakeResponse): unknown { const obj: any = {}; if (message.protocolVersion !== 0n) { obj.protocolVersion = message.protocolVersion.toString(); } if (message.payload.length !== 0) { obj.payload = base64FromBytes(message.payload); } return obj; }, create, I>>(base?: I): HandshakeResponse { return HandshakeResponse.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): HandshakeResponse { const message = createBaseHandshakeResponse() as any; message.protocolVersion = object.protocolVersion ?? 0n; message.payload = object.payload ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(HandshakeResponse.$type, HandshakeResponse); function createBaseBasicAuth(): BasicAuth { return { $type: "arrow.flight.protocol.BasicAuth", username: "", password: "" }; } export const BasicAuth: MessageFns = { $type: "arrow.flight.protocol.BasicAuth" as const, encode(message: BasicAuth, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.username !== "") { writer.uint32(18).string(message.username); } if (message.password !== "") { writer.uint32(26).string(message.password); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BasicAuth { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasicAuth() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: { if (tag !== 18) { break; } message.username = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.password = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): BasicAuth { return { $type: BasicAuth.$type, username: isSet(object.username) ? globalThis.String(object.username) : "", password: isSet(object.password) ? globalThis.String(object.password) : "", }; }, toJSON(message: BasicAuth): unknown { const obj: any = {}; if (message.username !== "") { obj.username = message.username; } if (message.password !== "") { obj.password = message.password; } return obj; }, create, I>>(base?: I): BasicAuth { return BasicAuth.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): BasicAuth { const message = createBaseBasicAuth() as any; message.username = object.username ?? ""; message.password = object.password ?? ""; return message; }, }; messageTypeRegistry.set(BasicAuth.$type, BasicAuth); function createBaseEmpty(): Empty { return { $type: "arrow.flight.protocol.Empty" }; } export const Empty: MessageFns = { $type: "arrow.flight.protocol.Empty" as const, encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Empty { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEmpty() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(_: any): Empty { return { $type: Empty.$type }; }, toJSON(_: Empty): unknown { const obj: any = {}; return obj; }, create, I>>(base?: I): Empty { return Empty.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(_: I): Empty { const message = createBaseEmpty() as any; return message; }, }; messageTypeRegistry.set(Empty.$type, Empty); function createBaseActionType(): ActionType { return { $type: "arrow.flight.protocol.ActionType", type: "", description: "" }; } export const ActionType: MessageFns = { $type: "arrow.flight.protocol.ActionType" as const, encode(message: ActionType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } if (message.description !== "") { writer.uint32(18).string(message.description); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ActionType { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseActionType() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.type = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.description = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): ActionType { return { $type: ActionType.$type, type: isSet(object.type) ? globalThis.String(object.type) : "", description: isSet(object.description) ? globalThis.String(object.description) : "", }; }, toJSON(message: ActionType): unknown { const obj: any = {}; if (message.type !== "") { obj.type = message.type; } if (message.description !== "") { obj.description = message.description; } return obj; }, create, I>>(base?: I): ActionType { return ActionType.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): ActionType { const message = createBaseActionType() as any; message.type = object.type ?? ""; message.description = object.description ?? ""; return message; }, }; messageTypeRegistry.set(ActionType.$type, ActionType); function createBaseCriteria(): Criteria { return { $type: "arrow.flight.protocol.Criteria", expression: new Uint8Array(0) }; } export const Criteria: MessageFns = { $type: "arrow.flight.protocol.Criteria" as const, encode(message: Criteria, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.expression.length !== 0) { writer.uint32(10).bytes(message.expression); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Criteria { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCriteria() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.expression = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): Criteria { return { $type: Criteria.$type, expression: isSet(object.expression) ? bytesFromBase64(object.expression) : new Uint8Array(0), }; }, toJSON(message: Criteria): unknown { const obj: any = {}; if (message.expression.length !== 0) { obj.expression = base64FromBytes(message.expression); } return obj; }, create, I>>(base?: I): Criteria { return Criteria.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Criteria { const message = createBaseCriteria() as any; message.expression = object.expression ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(Criteria.$type, Criteria); function createBaseAction(): Action { return { $type: "arrow.flight.protocol.Action", type: "", body: new Uint8Array(0) }; } export const Action: MessageFns = { $type: "arrow.flight.protocol.Action" as const, encode(message: Action, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } if (message.body.length !== 0) { writer.uint32(18).bytes(message.body); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Action { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAction() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.type = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.body = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): Action { return { $type: Action.$type, type: isSet(object.type) ? globalThis.String(object.type) : "", body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0), }; }, toJSON(message: Action): unknown { const obj: any = {}; if (message.type !== "") { obj.type = message.type; } if (message.body.length !== 0) { obj.body = base64FromBytes(message.body); } return obj; }, create, I>>(base?: I): Action { return Action.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Action { const message = createBaseAction() as any; message.type = object.type ?? ""; message.body = object.body ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(Action.$type, Action); function createBaseCancelFlightInfoRequest(): CancelFlightInfoRequest { return { $type: "arrow.flight.protocol.CancelFlightInfoRequest", info: undefined }; } export const CancelFlightInfoRequest: MessageFns< CancelFlightInfoRequest, "arrow.flight.protocol.CancelFlightInfoRequest" > = { $type: "arrow.flight.protocol.CancelFlightInfoRequest" as const, encode(message: CancelFlightInfoRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.info !== undefined) { FlightInfo.encode(message.info, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CancelFlightInfoRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCancelFlightInfoRequest() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.info = FlightInfo.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): CancelFlightInfoRequest { return { $type: CancelFlightInfoRequest.$type, info: isSet(object.info) ? FlightInfo.fromJSON(object.info) : undefined, }; }, toJSON(message: CancelFlightInfoRequest): unknown { const obj: any = {}; if (message.info !== undefined) { obj.info = FlightInfo.toJSON(message.info); } return obj; }, create, I>>(base?: I): CancelFlightInfoRequest { return CancelFlightInfoRequest.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): CancelFlightInfoRequest { const message = createBaseCancelFlightInfoRequest() as any; message.info = (object.info !== undefined && object.info !== null) ? FlightInfo.fromPartial(object.info) : undefined; return message; }, }; messageTypeRegistry.set(CancelFlightInfoRequest.$type, CancelFlightInfoRequest); function createBaseRenewFlightEndpointRequest(): RenewFlightEndpointRequest { return { $type: "arrow.flight.protocol.RenewFlightEndpointRequest", endpoint: undefined }; } export const RenewFlightEndpointRequest: MessageFns< RenewFlightEndpointRequest, "arrow.flight.protocol.RenewFlightEndpointRequest" > = { $type: "arrow.flight.protocol.RenewFlightEndpointRequest" as const, encode(message: RenewFlightEndpointRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.endpoint !== undefined) { FlightEndpoint.encode(message.endpoint, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RenewFlightEndpointRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRenewFlightEndpointRequest() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.endpoint = FlightEndpoint.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): RenewFlightEndpointRequest { return { $type: RenewFlightEndpointRequest.$type, endpoint: isSet(object.endpoint) ? FlightEndpoint.fromJSON(object.endpoint) : undefined, }; }, toJSON(message: RenewFlightEndpointRequest): unknown { const obj: any = {}; if (message.endpoint !== undefined) { obj.endpoint = FlightEndpoint.toJSON(message.endpoint); } return obj; }, create, I>>(base?: I): RenewFlightEndpointRequest { return RenewFlightEndpointRequest.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): RenewFlightEndpointRequest { const message = createBaseRenewFlightEndpointRequest() as any; message.endpoint = (object.endpoint !== undefined && object.endpoint !== null) ? FlightEndpoint.fromPartial(object.endpoint) : undefined; return message; }, }; messageTypeRegistry.set(RenewFlightEndpointRequest.$type, RenewFlightEndpointRequest); function createBaseResult(): Result { return { $type: "arrow.flight.protocol.Result", body: new Uint8Array(0) }; } export const Result: MessageFns = { $type: "arrow.flight.protocol.Result" as const, encode(message: Result, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.body.length !== 0) { writer.uint32(10).bytes(message.body); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Result { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResult() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.body = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): Result { return { $type: Result.$type, body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0) }; }, toJSON(message: Result): unknown { const obj: any = {}; if (message.body.length !== 0) { obj.body = base64FromBytes(message.body); } return obj; }, create, I>>(base?: I): Result { return Result.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Result { const message = createBaseResult() as any; message.body = object.body ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(Result.$type, Result); function createBaseCancelFlightInfoResult(): CancelFlightInfoResult { return { $type: "arrow.flight.protocol.CancelFlightInfoResult", status: 0 }; } export const CancelFlightInfoResult: MessageFns< CancelFlightInfoResult, "arrow.flight.protocol.CancelFlightInfoResult" > = { $type: "arrow.flight.protocol.CancelFlightInfoResult" as const, encode(message: CancelFlightInfoResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.status !== 0) { writer.uint32(8).int32(message.status); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CancelFlightInfoResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCancelFlightInfoResult() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.status = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): CancelFlightInfoResult { return { $type: CancelFlightInfoResult.$type, status: isSet(object.status) ? cancelStatusFromJSON(object.status) : 0, }; }, toJSON(message: CancelFlightInfoResult): unknown { const obj: any = {}; if (message.status !== 0) { obj.status = cancelStatusToJSON(message.status); } return obj; }, create, I>>(base?: I): CancelFlightInfoResult { return CancelFlightInfoResult.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): CancelFlightInfoResult { const message = createBaseCancelFlightInfoResult() as any; message.status = object.status ?? 0; return message; }, }; messageTypeRegistry.set(CancelFlightInfoResult.$type, CancelFlightInfoResult); function createBaseSchemaResult(): SchemaResult { return { $type: "arrow.flight.protocol.SchemaResult", schema: new Uint8Array(0) }; } export const SchemaResult: MessageFns = { $type: "arrow.flight.protocol.SchemaResult" as const, encode(message: SchemaResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.schema.length !== 0) { writer.uint32(10).bytes(message.schema); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SchemaResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSchemaResult() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.schema = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): SchemaResult { return { $type: SchemaResult.$type, schema: isSet(object.schema) ? bytesFromBase64(object.schema) : new Uint8Array(0), }; }, toJSON(message: SchemaResult): unknown { const obj: any = {}; if (message.schema.length !== 0) { obj.schema = base64FromBytes(message.schema); } return obj; }, create, I>>(base?: I): SchemaResult { return SchemaResult.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): SchemaResult { const message = createBaseSchemaResult() as any; message.schema = object.schema ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(SchemaResult.$type, SchemaResult); function createBaseFlightDescriptor(): FlightDescriptor { return { $type: "arrow.flight.protocol.FlightDescriptor", type: 0, cmd: new Uint8Array(0), path: [] }; } export const FlightDescriptor: MessageFns = { $type: "arrow.flight.protocol.FlightDescriptor" as const, encode(message: FlightDescriptor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.cmd.length !== 0) { writer.uint32(18).bytes(message.cmd); } for (const v of message.path) { writer.uint32(26).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): FlightDescriptor { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFlightDescriptor() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.type = reader.int32() as any; continue; } case 2: { if (tag !== 18) { break; } message.cmd = reader.bytes(); continue; } case 3: { if (tag !== 26) { break; } message.path.push(reader.string()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): FlightDescriptor { return { $type: FlightDescriptor.$type, type: isSet(object.type) ? flightDescriptor_DescriptorTypeFromJSON(object.type) : 0, cmd: isSet(object.cmd) ? bytesFromBase64(object.cmd) : new Uint8Array(0), path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: FlightDescriptor): unknown { const obj: any = {}; if (message.type !== 0) { obj.type = flightDescriptor_DescriptorTypeToJSON(message.type); } if (message.cmd.length !== 0) { obj.cmd = base64FromBytes(message.cmd); } if (message.path?.length) { obj.path = message.path; } return obj; }, create, I>>(base?: I): FlightDescriptor { return FlightDescriptor.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): FlightDescriptor { const message = createBaseFlightDescriptor() as any; message.type = object.type ?? 0; message.cmd = object.cmd ?? new Uint8Array(0); message.path = object.path?.map((e) => e) || []; return message; }, }; messageTypeRegistry.set(FlightDescriptor.$type, FlightDescriptor); function createBaseFlightInfo(): FlightInfo { return { $type: "arrow.flight.protocol.FlightInfo", schema: new Uint8Array(0), flightDescriptor: undefined, endpoint: [], totalRecords: 0n, totalBytes: 0n, ordered: false, appMetadata: new Uint8Array(0), }; } export const FlightInfo: MessageFns = { $type: "arrow.flight.protocol.FlightInfo" as const, encode(message: FlightInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.schema.length !== 0) { writer.uint32(10).bytes(message.schema); } if (message.flightDescriptor !== undefined) { FlightDescriptor.encode(message.flightDescriptor, writer.uint32(18).fork()).join(); } for (const v of message.endpoint) { FlightEndpoint.encode(v!, writer.uint32(26).fork()).join(); } if (message.totalRecords !== 0n) { if (BigInt.asIntN(64, message.totalRecords) !== message.totalRecords) { throw new globalThis.Error("value provided for field message.totalRecords of type int64 too large"); } writer.uint32(32).int64(message.totalRecords); } if (message.totalBytes !== 0n) { if (BigInt.asIntN(64, message.totalBytes) !== message.totalBytes) { throw new globalThis.Error("value provided for field message.totalBytes of type int64 too large"); } writer.uint32(40).int64(message.totalBytes); } if (message.ordered !== false) { writer.uint32(48).bool(message.ordered); } if (message.appMetadata.length !== 0) { writer.uint32(58).bytes(message.appMetadata); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): FlightInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFlightInfo() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.schema = reader.bytes(); continue; } case 2: { if (tag !== 18) { break; } message.flightDescriptor = FlightDescriptor.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.endpoint.push(FlightEndpoint.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 32) { break; } message.totalRecords = reader.int64() as bigint; continue; } case 5: { if (tag !== 40) { break; } message.totalBytes = reader.int64() as bigint; continue; } case 6: { if (tag !== 48) { break; } message.ordered = reader.bool(); continue; } case 7: { if (tag !== 58) { break; } message.appMetadata = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): FlightInfo { return { $type: FlightInfo.$type, schema: isSet(object.schema) ? bytesFromBase64(object.schema) : new Uint8Array(0), flightDescriptor: isSet(object.flightDescriptor) ? FlightDescriptor.fromJSON(object.flightDescriptor) : undefined, endpoint: globalThis.Array.isArray(object?.endpoint) ? object.endpoint.map((e: any) => FlightEndpoint.fromJSON(e)) : [], totalRecords: isSet(object.totalRecords) ? BigInt(object.totalRecords) : 0n, totalBytes: isSet(object.totalBytes) ? BigInt(object.totalBytes) : 0n, ordered: isSet(object.ordered) ? globalThis.Boolean(object.ordered) : false, appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0), }; }, toJSON(message: FlightInfo): unknown { const obj: any = {}; if (message.schema.length !== 0) { obj.schema = base64FromBytes(message.schema); } if (message.flightDescriptor !== undefined) { obj.flightDescriptor = FlightDescriptor.toJSON(message.flightDescriptor); } if (message.endpoint?.length) { obj.endpoint = message.endpoint.map((e) => FlightEndpoint.toJSON(e)); } if (message.totalRecords !== 0n) { obj.totalRecords = message.totalRecords.toString(); } if (message.totalBytes !== 0n) { obj.totalBytes = message.totalBytes.toString(); } if (message.ordered !== false) { obj.ordered = message.ordered; } if (message.appMetadata.length !== 0) { obj.appMetadata = base64FromBytes(message.appMetadata); } return obj; }, create, I>>(base?: I): FlightInfo { return FlightInfo.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): FlightInfo { const message = createBaseFlightInfo() as any; message.schema = object.schema ?? new Uint8Array(0); message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null) ? FlightDescriptor.fromPartial(object.flightDescriptor) : undefined; message.endpoint = object.endpoint?.map((e) => FlightEndpoint.fromPartial(e)) || []; message.totalRecords = object.totalRecords ?? 0n; message.totalBytes = object.totalBytes ?? 0n; message.ordered = object.ordered ?? false; message.appMetadata = object.appMetadata ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(FlightInfo.$type, FlightInfo); function createBasePollInfo(): PollInfo { return { $type: "arrow.flight.protocol.PollInfo", info: undefined, flightDescriptor: undefined, progress: undefined, expirationTime: undefined, }; } export const PollInfo: MessageFns = { $type: "arrow.flight.protocol.PollInfo" as const, encode(message: PollInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.info !== undefined) { FlightInfo.encode(message.info, writer.uint32(10).fork()).join(); } if (message.flightDescriptor !== undefined) { FlightDescriptor.encode(message.flightDescriptor, writer.uint32(18).fork()).join(); } if (message.progress !== undefined) { writer.uint32(25).double(message.progress); } if (message.expirationTime !== undefined) { Timestamp.encode(toTimestamp(message.expirationTime), writer.uint32(34).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): PollInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePollInfo() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.info = FlightInfo.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.flightDescriptor = FlightDescriptor.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 25) { break; } message.progress = reader.double(); continue; } case 4: { if (tag !== 34) { break; } message.expirationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): PollInfo { return { $type: PollInfo.$type, info: isSet(object.info) ? FlightInfo.fromJSON(object.info) : undefined, flightDescriptor: isSet(object.flightDescriptor) ? FlightDescriptor.fromJSON(object.flightDescriptor) : undefined, progress: isSet(object.progress) ? globalThis.Number(object.progress) : undefined, expirationTime: isSet(object.expirationTime) ? fromJsonTimestamp(object.expirationTime) : undefined, }; }, toJSON(message: PollInfo): unknown { const obj: any = {}; if (message.info !== undefined) { obj.info = FlightInfo.toJSON(message.info); } if (message.flightDescriptor !== undefined) { obj.flightDescriptor = FlightDescriptor.toJSON(message.flightDescriptor); } if (message.progress !== undefined) { obj.progress = message.progress; } if (message.expirationTime !== undefined) { obj.expirationTime = message.expirationTime.toISOString(); } return obj; }, create, I>>(base?: I): PollInfo { return PollInfo.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): PollInfo { const message = createBasePollInfo() as any; message.info = (object.info !== undefined && object.info !== null) ? FlightInfo.fromPartial(object.info) : undefined; message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null) ? FlightDescriptor.fromPartial(object.flightDescriptor) : undefined; message.progress = object.progress ?? undefined; message.expirationTime = object.expirationTime ?? undefined; return message; }, }; messageTypeRegistry.set(PollInfo.$type, PollInfo); function createBaseFlightEndpoint(): FlightEndpoint { return { $type: "arrow.flight.protocol.FlightEndpoint", ticket: undefined, location: [], expirationTime: undefined, appMetadata: new Uint8Array(0), }; } export const FlightEndpoint: MessageFns = { $type: "arrow.flight.protocol.FlightEndpoint" as const, encode(message: FlightEndpoint, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.ticket !== undefined) { Ticket.encode(message.ticket, writer.uint32(10).fork()).join(); } for (const v of message.location) { Location.encode(v!, writer.uint32(18).fork()).join(); } if (message.expirationTime !== undefined) { Timestamp.encode(toTimestamp(message.expirationTime), writer.uint32(26).fork()).join(); } if (message.appMetadata.length !== 0) { writer.uint32(34).bytes(message.appMetadata); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): FlightEndpoint { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFlightEndpoint() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ticket = Ticket.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.location.push(Location.decode(reader, reader.uint32())); continue; } case 3: { if (tag !== 26) { break; } message.expirationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.appMetadata = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): FlightEndpoint { return { $type: FlightEndpoint.$type, ticket: isSet(object.ticket) ? Ticket.fromJSON(object.ticket) : undefined, location: globalThis.Array.isArray(object?.location) ? object.location.map((e: any) => Location.fromJSON(e)) : [], expirationTime: isSet(object.expirationTime) ? fromJsonTimestamp(object.expirationTime) : undefined, appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0), }; }, toJSON(message: FlightEndpoint): unknown { const obj: any = {}; if (message.ticket !== undefined) { obj.ticket = Ticket.toJSON(message.ticket); } if (message.location?.length) { obj.location = message.location.map((e) => Location.toJSON(e)); } if (message.expirationTime !== undefined) { obj.expirationTime = message.expirationTime.toISOString(); } if (message.appMetadata.length !== 0) { obj.appMetadata = base64FromBytes(message.appMetadata); } return obj; }, create, I>>(base?: I): FlightEndpoint { return FlightEndpoint.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): FlightEndpoint { const message = createBaseFlightEndpoint() as any; message.ticket = (object.ticket !== undefined && object.ticket !== null) ? Ticket.fromPartial(object.ticket) : undefined; message.location = object.location?.map((e) => Location.fromPartial(e)) || []; message.expirationTime = object.expirationTime ?? undefined; message.appMetadata = object.appMetadata ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(FlightEndpoint.$type, FlightEndpoint); function createBaseLocation(): Location { return { $type: "arrow.flight.protocol.Location", uri: "" }; } export const Location: MessageFns = { $type: "arrow.flight.protocol.Location" as const, encode(message: Location, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.uri !== "") { writer.uint32(10).string(message.uri); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Location { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLocation() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.uri = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): Location { return { $type: Location.$type, uri: isSet(object.uri) ? globalThis.String(object.uri) : "" }; }, toJSON(message: Location): unknown { const obj: any = {}; if (message.uri !== "") { obj.uri = message.uri; } return obj; }, create, I>>(base?: I): Location { return Location.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Location { const message = createBaseLocation() as any; message.uri = object.uri ?? ""; return message; }, }; messageTypeRegistry.set(Location.$type, Location); function createBaseTicket(): Ticket { return { $type: "arrow.flight.protocol.Ticket", ticket: new Uint8Array(0) }; } export const Ticket: MessageFns = { $type: "arrow.flight.protocol.Ticket" as const, encode(message: Ticket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.ticket.length !== 0) { writer.uint32(10).bytes(message.ticket); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Ticket { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTicket() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.ticket = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): Ticket { return { $type: Ticket.$type, ticket: isSet(object.ticket) ? bytesFromBase64(object.ticket) : new Uint8Array(0) }; }, toJSON(message: Ticket): unknown { const obj: any = {}; if (message.ticket.length !== 0) { obj.ticket = base64FromBytes(message.ticket); } return obj; }, create, I>>(base?: I): Ticket { return Ticket.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Ticket { const message = createBaseTicket() as any; message.ticket = object.ticket ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(Ticket.$type, Ticket); function createBaseFlightData(): FlightData { return { $type: "arrow.flight.protocol.FlightData", flightDescriptor: undefined, dataHeader: new Uint8Array(0), appMetadata: new Uint8Array(0), dataBody: new Uint8Array(0), }; } export const FlightData: MessageFns = { $type: "arrow.flight.protocol.FlightData" as const, encode(message: FlightData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.flightDescriptor !== undefined) { FlightDescriptor.encode(message.flightDescriptor, writer.uint32(10).fork()).join(); } if (message.dataHeader.length !== 0) { writer.uint32(18).bytes(message.dataHeader); } if (message.appMetadata.length !== 0) { writer.uint32(26).bytes(message.appMetadata); } if (message.dataBody.length !== 0) { writer.uint32(8002).bytes(message.dataBody); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): FlightData { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFlightData() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.flightDescriptor = FlightDescriptor.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.dataHeader = reader.bytes(); continue; } case 3: { if (tag !== 26) { break; } message.appMetadata = reader.bytes(); continue; } case 1000: { if (tag !== 8002) { break; } message.dataBody = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): FlightData { return { $type: FlightData.$type, flightDescriptor: isSet(object.flightDescriptor) ? FlightDescriptor.fromJSON(object.flightDescriptor) : undefined, dataHeader: isSet(object.dataHeader) ? bytesFromBase64(object.dataHeader) : new Uint8Array(0), appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0), dataBody: isSet(object.dataBody) ? bytesFromBase64(object.dataBody) : new Uint8Array(0), }; }, toJSON(message: FlightData): unknown { const obj: any = {}; if (message.flightDescriptor !== undefined) { obj.flightDescriptor = FlightDescriptor.toJSON(message.flightDescriptor); } if (message.dataHeader.length !== 0) { obj.dataHeader = base64FromBytes(message.dataHeader); } if (message.appMetadata.length !== 0) { obj.appMetadata = base64FromBytes(message.appMetadata); } if (message.dataBody.length !== 0) { obj.dataBody = base64FromBytes(message.dataBody); } return obj; }, create, I>>(base?: I): FlightData { return FlightData.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): FlightData { const message = createBaseFlightData() as any; message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null) ? FlightDescriptor.fromPartial(object.flightDescriptor) : undefined; message.dataHeader = object.dataHeader ?? new Uint8Array(0); message.appMetadata = object.appMetadata ?? new Uint8Array(0); message.dataBody = object.dataBody ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(FlightData.$type, FlightData); function createBasePutResult(): PutResult { return { $type: "arrow.flight.protocol.PutResult", appMetadata: new Uint8Array(0) }; } export const PutResult: MessageFns = { $type: "arrow.flight.protocol.PutResult" as const, encode(message: PutResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.appMetadata.length !== 0) { writer.uint32(10).bytes(message.appMetadata); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): PutResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePutResult() as any; while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.appMetadata = reader.bytes(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object: any): PutResult { return { $type: PutResult.$type, appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0), }; }, toJSON(message: PutResult): unknown { const obj: any = {}; if (message.appMetadata.length !== 0) { obj.appMetadata = base64FromBytes(message.appMetadata); } return obj; }, create, I>>(base?: I): PutResult { return PutResult.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): PutResult { const message = createBasePutResult() as any; message.appMetadata = object.appMetadata ?? new Uint8Array(0); return message; }, }; messageTypeRegistry.set(PutResult.$type, PutResult); /** * A flight service is an endpoint for retrieving or storing Arrow data. A * flight service can expose one or more predefined endpoints that can be * accessed using the Arrow Flight Protocol. Additionally, a flight service * can expose a set of actions that are available. */ export type FlightServiceDefinition = typeof FlightServiceDefinition; export const FlightServiceDefinition = { name: "FlightService", fullName: "arrow.flight.protocol.FlightService", methods: { /** * Handshake between client and server. Depending on the server, the * handshake may be required to determine the token that should be used for * future operations. Both request and response are streams to allow multiple * round-trips depending on auth mechanism. */ handshake: { name: "Handshake", requestType: HandshakeRequest, requestStream: true, responseType: HandshakeResponse, responseStream: true, options: {}, }, /** * Get a list of available streams given a particular criteria. Most flight * services will expose one or more streams that are readily available for * retrieval. This api allows listing the streams available for * consumption. A user can also provide a criteria. The criteria can limit * the subset of streams that can be listed via this interface. Each flight * service allows its own definition of how to consume criteria. */ listFlights: { name: "ListFlights", requestType: Criteria, requestStream: false, responseType: FlightInfo, responseStream: true, options: {}, }, /** * For a given FlightDescriptor, get information about how the flight can be * consumed. This is a useful interface if the consumer of the interface * already can identify the specific flight to consume. This interface can * also allow a consumer to generate a flight stream through a specified * descriptor. For example, a flight descriptor might be something that * includes a SQL statement or a Pickled Python operation that will be * executed. In those cases, the descriptor will not be previously available * within the list of available streams provided by ListFlights but will be * available for consumption for the duration defined by the specific flight * service. */ getFlightInfo: { name: "GetFlightInfo", requestType: FlightDescriptor, requestStream: false, responseType: FlightInfo, responseStream: false, options: {}, }, /** * For a given FlightDescriptor, start a query and get information * to poll its execution status. This is a useful interface if the * query may be a long-running query. The first PollFlightInfo call * should return as quickly as possible. (GetFlightInfo doesn't * return until the query is complete.) * * A client can consume any available results before * the query is completed. See PollInfo.info for details. * * A client can poll the updated query status by calling * PollFlightInfo() with PollInfo.flight_descriptor. A server * should not respond until the result would be different from last * time. That way, the client can "long poll" for updates * without constantly making requests. Clients can set a short timeout * to avoid blocking calls if desired. * * A client can't use PollInfo.flight_descriptor after * PollInfo.expiration_time passes. A server might not accept the * retry descriptor anymore and the query may be cancelled. * * A client may use the CancelFlightInfo action with * PollInfo.info to cancel the running query. */ pollFlightInfo: { name: "PollFlightInfo", requestType: FlightDescriptor, requestStream: false, responseType: PollInfo, responseStream: false, options: {}, }, /** * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema * This is used when a consumer needs the Schema of flight stream. Similar to * GetFlightInfo this interface may generate a new flight that was not previously * available in ListFlights. */ getSchema: { name: "GetSchema", requestType: FlightDescriptor, requestStream: false, responseType: SchemaResult, responseStream: false, options: {}, }, /** * Retrieve a single stream associated with a particular descriptor * associated with the referenced ticket. A Flight can be composed of one or * more streams where each stream can be retrieved using a separate opaque * ticket that the flight service uses for managing a collection of streams. */ doGet: { name: "DoGet", requestType: Ticket, requestStream: false, responseType: FlightData, responseStream: true, options: {}, }, /** * Push a stream to the flight service associated with a particular * flight stream. This allows a client of a flight service to upload a stream * of data. Depending on the particular flight service, a client consumer * could be allowed to upload a single stream per descriptor or an unlimited * number. In the latter, the service might implement a 'seal' action that * can be applied to a descriptor once all streams are uploaded. */ doPut: { name: "DoPut", requestType: FlightData, requestStream: true, responseType: PutResult, responseStream: true, options: {}, }, /** * Open a bidirectional data channel for a given descriptor. This * allows clients to send and receive arbitrary Arrow data and * application-specific metadata in a single logical stream. In * contrast to DoGet/DoPut, this is more suited for clients * offloading computation (rather than storage) to a Flight service. */ doExchange: { name: "DoExchange", requestType: FlightData, requestStream: true, responseType: FlightData, responseStream: true, options: {}, }, /** * Flight services can support an arbitrary number of simple actions in * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut * operations that are potentially available. DoAction allows a flight client * to do a specific action against a flight service. An action includes * opaque request and response objects that are specific to the type action * being undertaken. */ doAction: { name: "DoAction", requestType: Action, requestStream: false, responseType: Result, responseStream: true, options: {}, }, /** * A flight service exposes all of the available action types that it has * along with descriptions. This allows different flight consumers to * understand the capabilities of the flight service. */ listActions: { name: "ListActions", requestType: Empty, requestStream: false, responseType: ActionType, responseStream: true, options: {}, }, }, } as const; export interface FlightServiceImplementation { /** * Handshake between client and server. Depending on the server, the * handshake may be required to determine the token that should be used for * future operations. Both request and response are streams to allow multiple * round-trips depending on auth mechanism. */ handshake( request: AsyncIterable, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; /** * Get a list of available streams given a particular criteria. Most flight * services will expose one or more streams that are readily available for * retrieval. This api allows listing the streams available for * consumption. A user can also provide a criteria. The criteria can limit * the subset of streams that can be listed via this interface. Each flight * service allows its own definition of how to consume criteria. */ listFlights( request: Criteria, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; /** * For a given FlightDescriptor, get information about how the flight can be * consumed. This is a useful interface if the consumer of the interface * already can identify the specific flight to consume. This interface can * also allow a consumer to generate a flight stream through a specified * descriptor. For example, a flight descriptor might be something that * includes a SQL statement or a Pickled Python operation that will be * executed. In those cases, the descriptor will not be previously available * within the list of available streams provided by ListFlights but will be * available for consumption for the duration defined by the specific flight * service. */ getFlightInfo(request: FlightDescriptor, context: CallContext & CallContextExt): Promise>; /** * For a given FlightDescriptor, start a query and get information * to poll its execution status. This is a useful interface if the * query may be a long-running query. The first PollFlightInfo call * should return as quickly as possible. (GetFlightInfo doesn't * return until the query is complete.) * * A client can consume any available results before * the query is completed. See PollInfo.info for details. * * A client can poll the updated query status by calling * PollFlightInfo() with PollInfo.flight_descriptor. A server * should not respond until the result would be different from last * time. That way, the client can "long poll" for updates * without constantly making requests. Clients can set a short timeout * to avoid blocking calls if desired. * * A client can't use PollInfo.flight_descriptor after * PollInfo.expiration_time passes. A server might not accept the * retry descriptor anymore and the query may be cancelled. * * A client may use the CancelFlightInfo action with * PollInfo.info to cancel the running query. */ pollFlightInfo(request: FlightDescriptor, context: CallContext & CallContextExt): Promise>; /** * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema * This is used when a consumer needs the Schema of flight stream. Similar to * GetFlightInfo this interface may generate a new flight that was not previously * available in ListFlights. */ getSchema(request: FlightDescriptor, context: CallContext & CallContextExt): Promise>; /** * Retrieve a single stream associated with a particular descriptor * associated with the referenced ticket. A Flight can be composed of one or * more streams where each stream can be retrieved using a separate opaque * ticket that the flight service uses for managing a collection of streams. */ doGet(request: Ticket, context: CallContext & CallContextExt): ServerStreamingMethodResult>; /** * Push a stream to the flight service associated with a particular * flight stream. This allows a client of a flight service to upload a stream * of data. Depending on the particular flight service, a client consumer * could be allowed to upload a single stream per descriptor or an unlimited * number. In the latter, the service might implement a 'seal' action that * can be applied to a descriptor once all streams are uploaded. */ doPut( request: AsyncIterable, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; /** * Open a bidirectional data channel for a given descriptor. This * allows clients to send and receive arbitrary Arrow data and * application-specific metadata in a single logical stream. In * contrast to DoGet/DoPut, this is more suited for clients * offloading computation (rather than storage) to a Flight service. */ doExchange( request: AsyncIterable, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; /** * Flight services can support an arbitrary number of simple actions in * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut * operations that are potentially available. DoAction allows a flight client * to do a specific action against a flight service. An action includes * opaque request and response objects that are specific to the type action * being undertaken. */ doAction(request: Action, context: CallContext & CallContextExt): ServerStreamingMethodResult>; /** * A flight service exposes all of the available action types that it has * along with descriptions. This allows different flight consumers to * understand the capabilities of the flight service. */ listActions( request: Empty, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; } export interface FlightServiceClient { /** * Handshake between client and server. Depending on the server, the * handshake may be required to determine the token that should be used for * future operations. Both request and response are streams to allow multiple * round-trips depending on auth mechanism. */ handshake( request: AsyncIterable>, options?: CallOptions & CallOptionsExt, ): AsyncIterable; /** * Get a list of available streams given a particular criteria. Most flight * services will expose one or more streams that are readily available for * retrieval. This api allows listing the streams available for * consumption. A user can also provide a criteria. The criteria can limit * the subset of streams that can be listed via this interface. Each flight * service allows its own definition of how to consume criteria. */ listFlights(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; /** * For a given FlightDescriptor, get information about how the flight can be * consumed. This is a useful interface if the consumer of the interface * already can identify the specific flight to consume. This interface can * also allow a consumer to generate a flight stream through a specified * descriptor. For example, a flight descriptor might be something that * includes a SQL statement or a Pickled Python operation that will be * executed. In those cases, the descriptor will not be previously available * within the list of available streams provided by ListFlights but will be * available for consumption for the duration defined by the specific flight * service. */ getFlightInfo(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * For a given FlightDescriptor, start a query and get information * to poll its execution status. This is a useful interface if the * query may be a long-running query. The first PollFlightInfo call * should return as quickly as possible. (GetFlightInfo doesn't * return until the query is complete.) * * A client can consume any available results before * the query is completed. See PollInfo.info for details. * * A client can poll the updated query status by calling * PollFlightInfo() with PollInfo.flight_descriptor. A server * should not respond until the result would be different from last * time. That way, the client can "long poll" for updates * without constantly making requests. Clients can set a short timeout * to avoid blocking calls if desired. * * A client can't use PollInfo.flight_descriptor after * PollInfo.expiration_time passes. A server might not accept the * retry descriptor anymore and the query may be cancelled. * * A client may use the CancelFlightInfo action with * PollInfo.info to cancel the running query. */ pollFlightInfo(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema * This is used when a consumer needs the Schema of flight stream. Similar to * GetFlightInfo this interface may generate a new flight that was not previously * available in ListFlights. */ getSchema(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Retrieve a single stream associated with a particular descriptor * associated with the referenced ticket. A Flight can be composed of one or * more streams where each stream can be retrieved using a separate opaque * ticket that the flight service uses for managing a collection of streams. */ doGet(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; /** * Push a stream to the flight service associated with a particular * flight stream. This allows a client of a flight service to upload a stream * of data. Depending on the particular flight service, a client consumer * could be allowed to upload a single stream per descriptor or an unlimited * number. In the latter, the service might implement a 'seal' action that * can be applied to a descriptor once all streams are uploaded. */ doPut( request: AsyncIterable>, options?: CallOptions & CallOptionsExt, ): AsyncIterable; /** * Open a bidirectional data channel for a given descriptor. This * allows clients to send and receive arbitrary Arrow data and * application-specific metadata in a single logical stream. In * contrast to DoGet/DoPut, this is more suited for clients * offloading computation (rather than storage) to a Flight service. */ doExchange( request: AsyncIterable>, options?: CallOptions & CallOptionsExt, ): AsyncIterable; /** * Flight services can support an arbitrary number of simple actions in * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut * operations that are potentially available. DoAction allows a flight client * to do a specific action against a flight service. An action includes * opaque request and response objects that are specific to the type action * being undertaken. */ doAction(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; /** * A flight service exposes all of the available action types that it has * along with descriptions. This allows different flight consumers to * understand the capabilities of the flight service. */ listActions(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; } function bytesFromBase64(b64: string): Uint8Array { if ((globalThis as any).Buffer) { return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); } else { const bin = globalThis.atob(b64); const arr = new Uint8Array(bin.length); for (let i = 0; i < bin.length; ++i) { arr[i] = bin.charCodeAt(i); } return arr; } } function base64FromBytes(arr: Uint8Array): string { if ((globalThis as any).Buffer) { return globalThis.Buffer.from(arr).toString("base64"); } else { const bin: string[] = []; arr.forEach((byte) => { bin.push(globalThis.String.fromCharCode(byte)); }); return globalThis.btoa(bin.join("")); } } type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends { readonly $case: string } ? { [K in keyof Omit]?: DeepPartial } & { readonly $case: T["$case"] } : T extends {} ? { [K in Exclude]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude | "$type">]: never }; function toTimestamp(date: Date): Timestamp { const seconds = BigInt(Math.trunc(date.getTime() / 1_000)); const nanos = (date.getTime() % 1_000) * 1_000_000; return { $type: "google.protobuf.Timestamp", seconds, nanos }; } function fromTimestamp(t: Timestamp): Date { let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000; millis += (t.nanos || 0) / 1_000_000; return new globalThis.Date(millis); } function fromJsonTimestamp(o: any): Date { if (o instanceof globalThis.Date) { return o; } else if (typeof o === "string") { return new globalThis.Date(o); } else { return fromTimestamp(Timestamp.fromJSON(o)); } } function isSet(value: any): boolean { return value !== null && value !== undefined; } export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator }; export interface MessageFns { readonly $type: V; encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create, I>>(base?: I): T; fromPartial, I>>(object: I): T; }