@snap/camera-kit
Version:
Camera Kit Web
49 lines • 1.7 kB
JavaScript
import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "snapchat.cdp.cof";
function createBaseMdpMediaAttribution() {
return { mediaSource: 0, assetType: 0 };
}
export const MdpMediaAttribution = {
encode(message, writer = _m0.Writer.create()) {
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 _m0.Reader ? input : new _m0.Reader(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:
message.mediaSource = reader.int32();
break;
case 2:
message.assetType = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
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;
},
};
if (_m0.util.Long !== Long) {
_m0.util.Long = Long;
_m0.configure();
}
//# sourceMappingURL=mdp_media_attribution.js.map