UNPKG

@snap/camera-kit

Version:
56 lines 2 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = "snapchat.cdp.cof"; function createBaseMdpMediaAttribution() { return { mediaSource: 0, assetType: 0 }; } export const MdpMediaAttribution = { encode(message, writer = new BinaryWriter()) { if (message.mediaSource !== 0) { writer.uint32(8).int32(message.mediaSource); } if (message.assetType !== 0) { writer.uint32(16).int32(message.assetType); } 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 = createBaseMdpMediaAttribution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.mediaSource = reader.int32(); continue; } case 2: { if (tag !== 16) { break; } message.assetType = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, create(base) { return MdpMediaAttribution.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b; const message = createBaseMdpMediaAttribution(); message.mediaSource = (_a = object.mediaSource) !== null && _a !== void 0 ? _a : 0; message.assetType = (_b = object.assetType) !== null && _b !== void 0 ? _b : 0; return message; }, }; //# sourceMappingURL=mdp_media_attribution.js.map