Files
googlevideo/protos/generated/video_streaming/onesie_innertube_response.ts
2025-07-24 10:00:27 -03:00

95 lines
2.8 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.7.5
// protoc v5.28.0
// source: video_streaming/onesie_innertube_response.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { HttpHeader } from "../misc/common.js";
import { OnesieProxyStatus } from "./onesie_proxy_status.js";
export const protobufPackage = "video_streaming";
export interface OnesieInnertubeResponse {
onesieProxyStatus?: OnesieProxyStatus | undefined;
httpStatus?: number | undefined;
headers: HttpHeader[];
body?: Uint8Array | undefined;
}
function createBaseOnesieInnertubeResponse(): OnesieInnertubeResponse {
return { onesieProxyStatus: 0, httpStatus: 0, headers: [], body: new Uint8Array(0) };
}
export const OnesieInnertubeResponse: MessageFns<OnesieInnertubeResponse> = {
encode(message: OnesieInnertubeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.onesieProxyStatus !== undefined && message.onesieProxyStatus !== 0) {
writer.uint32(8).int32(message.onesieProxyStatus);
}
if (message.httpStatus !== undefined && message.httpStatus !== 0) {
writer.uint32(16).int32(message.httpStatus);
}
for (const v of message.headers) {
HttpHeader.encode(v!, writer.uint32(26).fork()).join();
}
if (message.body !== undefined && message.body.length !== 0) {
writer.uint32(34).bytes(message.body);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): OnesieInnertubeResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseOnesieInnertubeResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.onesieProxyStatus = reader.int32() as any;
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.httpStatus = reader.int32();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.headers.push(HttpHeader.decode(reader, reader.uint32()));
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.body = reader.bytes();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
}