googlevideo
Version:
A set of utilities for working with Google Video APIs.
109 lines (108 loc) • 3.87 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.0
// protoc v3.21.12
// source: video_streaming/request_cancellation_policy.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export const protobufPackage = "video_streaming";
function createBaseRequestCancellationPolicy() {
return { N0: 0, items: [], jq: 0 };
}
export const RequestCancellationPolicy = {
encode(message, writer = new BinaryWriter()) {
if (message.N0 !== undefined && message.N0 !== 0) {
writer.uint32(8).int32(message.N0);
}
for (const v of message.items) {
RequestCancellationPolicy_Item.encode(v, writer.uint32(18).fork()).join();
}
if (message.jq !== undefined && message.jq !== 0) {
writer.uint32(24).int32(message.jq);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRequestCancellationPolicy();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.N0 = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
message.items.push(RequestCancellationPolicy_Item.decode(reader, reader.uint32()));
continue;
case 3:
if (tag !== 24) {
break;
}
message.jq = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};
function createBaseRequestCancellationPolicy_Item() {
return { fR: 0, NK: 0, minReadaheadMs: 0 };
}
export const RequestCancellationPolicy_Item = {
encode(message, writer = new BinaryWriter()) {
if (message.fR !== undefined && message.fR !== 0) {
writer.uint32(8).int32(message.fR);
}
if (message.NK !== undefined && message.NK !== 0) {
writer.uint32(16).int32(message.NK);
}
if (message.minReadaheadMs !== undefined && message.minReadaheadMs !== 0) {
writer.uint32(24).int32(message.minReadaheadMs);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRequestCancellationPolicy_Item();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.fR = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
message.NK = reader.int32();
continue;
case 3:
if (tag !== 24) {
break;
}
message.minReadaheadMs = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
};