// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.7.7
//   protoc               v6.33.5
// source: youtube/api/pfiinnertube/metadata_update_request.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { InnerTubeContext } from "./innertube_context.js";
export const protobufPackage = "youtube.api.pfiinnertube";
function createBaseMetadataUpdateRequest() {
    return {
        context: undefined,
        encryptedVideoId: undefined,
        title: undefined,
        description: undefined,
        privacy: undefined,
        tags: undefined,
        category: undefined,
        license: undefined,
        ageRestriction: undefined,
        videoStill: undefined,
        madeForKids: undefined,
        racy: undefined,
    };
}
export const MetadataUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.context !== undefined) {
            InnerTubeContext.encode(message.context, writer.uint32(10).fork()).join();
        }
        if (message.encryptedVideoId !== undefined) {
            writer.uint32(18).string(message.encryptedVideoId);
        }
        if (message.title !== undefined) {
            MetadataUpdateRequest_MdeTitleUpdateRequest.encode(message.title, writer.uint32(26).fork()).join();
        }
        if (message.description !== undefined) {
            MetadataUpdateRequest_MdeDescriptionUpdateRequest.encode(message.description, writer.uint32(34).fork()).join();
        }
        if (message.privacy !== undefined) {
            MetadataUpdateRequest_MdePrivacyUpdateRequest.encode(message.privacy, writer.uint32(42).fork()).join();
        }
        if (message.tags !== undefined) {
            MetadataUpdateRequest_MdeTagsUpdateRequest.encode(message.tags, writer.uint32(50).fork()).join();
        }
        if (message.category !== undefined) {
            MetadataUpdateRequest_MdeCategoryUpdateRequest.encode(message.category, writer.uint32(58).fork()).join();
        }
        if (message.license !== undefined) {
            MetadataUpdateRequest_MdeLicenseUpdateRequest.encode(message.license, writer.uint32(66).fork()).join();
        }
        if (message.ageRestriction !== undefined) {
            MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.encode(message.ageRestriction, writer.uint32(90).fork())
                .join();
        }
        if (message.videoStill !== undefined) {
            MetadataUpdateRequest_MdeVideoStillRequestParams.encode(message.videoStill, writer.uint32(162).fork()).join();
        }
        if (message.madeForKids !== undefined) {
            MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.encode(message.madeForKids, writer.uint32(546).fork())
                .join();
        }
        if (message.racy !== undefined) {
            MetadataUpdateRequest_MdeRacyRequestParams.encode(message.racy, writer.uint32(554).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.context = InnerTubeContext.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.encryptedVideoId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.title = MetadataUpdateRequest_MdeTitleUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.description = MetadataUpdateRequest_MdeDescriptionUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.privacy = MetadataUpdateRequest_MdePrivacyUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.tags = MetadataUpdateRequest_MdeTagsUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.category = MetadataUpdateRequest_MdeCategoryUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.license = MetadataUpdateRequest_MdeLicenseUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 11: {
                    if (tag !== 90) {
                        break;
                    }
                    message.ageRestriction = MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 20: {
                    if (tag !== 162) {
                        break;
                    }
                    message.videoStill = MetadataUpdateRequest_MdeVideoStillRequestParams.decode(reader, reader.uint32());
                    continue;
                }
                case 68: {
                    if (tag !== 546) {
                        break;
                    }
                    message.madeForKids = MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.decode(reader, reader.uint32());
                    continue;
                }
                case 69: {
                    if (tag !== 554) {
                        break;
                    }
                    message.racy = MetadataUpdateRequest_MdeRacyRequestParams.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeTitleUpdateRequest() {
    return { newTitle: undefined };
}
export const MetadataUpdateRequest_MdeTitleUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.newTitle !== undefined) {
            writer.uint32(10).string(message.newTitle);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeTitleUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.newTitle = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest() {
    return { newDescription: undefined };
}
export const MetadataUpdateRequest_MdeDescriptionUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.newDescription !== undefined) {
            writer.uint32(10).string(message.newDescription);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.newDescription = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest() {
    return { newPrivacy: undefined, clearPrivacyDraft: undefined };
}
export const MetadataUpdateRequest_MdePrivacyUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.newPrivacy !== undefined) {
            writer.uint32(8).int32(message.newPrivacy);
        }
        if (message.clearPrivacyDraft !== undefined) {
            writer.uint32(16).bool(message.clearPrivacyDraft);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.newPrivacy = reader.int32();
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.clearPrivacyDraft = reader.bool();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeTagsUpdateRequest() {
    return { newTags: [] };
}
export const MetadataUpdateRequest_MdeTagsUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        for (const v of message.newTags) {
            writer.uint32(10).string(v);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeTagsUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.newTags.push(reader.string());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest() {
    return { newCategoryId: undefined };
}
export const MetadataUpdateRequest_MdeCategoryUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.newCategoryId !== undefined) {
            writer.uint32(8).int32(message.newCategoryId);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.newCategoryId = reader.int32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest() {
    return { newLicenseId: undefined };
}
export const MetadataUpdateRequest_MdeLicenseUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.newLicenseId !== undefined) {
            writer.uint32(10).string(message.newLicenseId);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.newLicenseId = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams() {
    return { operation: undefined, newMfk: undefined };
}
export const MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams = {
    encode(message, writer = new BinaryWriter()) {
        if (message.operation !== undefined) {
            writer.uint32(8).int32(message.operation);
        }
        if (message.newMfk !== undefined) {
            writer.uint32(16).int32(message.newMfk);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.operation = reader.int32();
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.newMfk = reader.int32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeRacyRequestParams() {
    return { operation: undefined, newRacy: undefined };
}
export const MetadataUpdateRequest_MdeRacyRequestParams = {
    encode(message, writer = new BinaryWriter()) {
        if (message.operation !== undefined) {
            writer.uint32(8).int32(message.operation);
        }
        if (message.newRacy !== undefined) {
            writer.uint32(16).int32(message.newRacy);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeRacyRequestParams();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.operation = reader.int32();
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.newRacy = reader.int32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest() {
    return { newIsAgeRestricted: undefined };
}
export const MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.newIsAgeRestricted !== undefined) {
            writer.uint32(8).bool(message.newIsAgeRestricted);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.newIsAgeRestricted = reader.bool();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams() {
    return { operation: undefined, newStillId: undefined, image: undefined, testImage: undefined, experimentImage: [] };
}
export const MetadataUpdateRequest_MdeVideoStillRequestParams = {
    encode(message, writer = new BinaryWriter()) {
        if (message.operation !== undefined) {
            writer.uint32(8).int32(message.operation);
        }
        if (message.newStillId !== undefined) {
            writer.uint32(16).int32(message.newStillId);
        }
        if (message.image !== undefined) {
            MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.encode(message.image, writer.uint32(26).fork()).join();
        }
        if (message.testImage !== undefined) {
            MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.encode(message.testImage, writer.uint32(34).fork()).join();
        }
        for (const v of message.experimentImage) {
            MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.encode(v, writer.uint32(50).fork())
                .join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.operation = reader.int32();
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.newStillId = reader.int32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.image = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.testImage = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.decode(reader, reader.uint32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.experimentImage.push(MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData() {
    return { image: undefined };
}
export const MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData = {
    encode(message, writer = new BinaryWriter()) {
        if (message.image !== undefined) {
            MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.encode(message.image, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.image = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage() {
    return { rawBytes: undefined, dataUri: undefined, frameTimestampUs: undefined, isVertical: undefined };
}
export const MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage = {
    encode(message, writer = new BinaryWriter()) {
        if (message.rawBytes !== undefined) {
            writer.uint32(10).bytes(message.rawBytes);
        }
        if (message.dataUri !== undefined) {
            writer.uint32(18).string(message.dataUri);
        }
        if (message.frameTimestampUs !== undefined) {
            writer.uint32(32).int64(message.frameTimestampUs);
        }
        if (message.isVertical !== undefined) {
            writer.uint32(40).bool(message.isVertical);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.rawBytes = reader.bytes();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.dataUri = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 32) {
                        break;
                    }
                    message.frameTimestampUs = longToNumber(reader.int64());
                    continue;
                }
                case 5: {
                    if (tag !== 40) {
                        break;
                    }
                    message.isVertical = reader.bool();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
};
function longToNumber(int64) {
    const num = globalThis.Number(int64.toString());
    if (num > globalThis.Number.MAX_SAFE_INTEGER) {
        throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
    }
    if (num < globalThis.Number.MIN_SAFE_INTEGER) {
        throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
    }
    return num;
}
//# sourceMappingURL=metadata_update_request.js.map