UNPKG

@htdangkhoa/google-ads

Version:
183 lines (182 loc) 7.91 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.181.2 // protoc v3.21.12 // source: google/ads/googleads/v24/resources/youtube_video_upload.proto /* eslint-disable */ import Long from "long"; import _m0 from "protobufjs/minimal.js"; import { youTubeVideoPrivacyEnum_YouTubeVideoPrivacyFromJSON, youTubeVideoPrivacyEnum_YouTubeVideoPrivacyToJSON, } from "../enums/youtube_video_privacy.js"; import { youTubeVideoUploadStateEnum_YouTubeVideoUploadStateFromJSON, youTubeVideoUploadStateEnum_YouTubeVideoUploadStateToJSON, } from "../enums/youtube_video_upload_state.js"; function createBaseYouTubeVideoUpload() { return { resource_name: "", video_upload_id: "0", channel_id: "", video_id: "", state: 0, video_title: "", video_description: "", video_privacy: 0, }; } export const YouTubeVideoUpload = { encode(message, writer = _m0.Writer.create()) { if (message.resource_name !== undefined && message.resource_name !== "") { writer.uint32(10).string(message.resource_name); } if (message.video_upload_id !== undefined && message.video_upload_id !== "0") { writer.uint32(16).int64(message.video_upload_id); } if (message.channel_id !== undefined && message.channel_id !== "") { writer.uint32(26).string(message.channel_id); } if (message.video_id !== undefined && message.video_id !== "") { writer.uint32(34).string(message.video_id); } if (message.state !== undefined && message.state !== 0) { writer.uint32(40).int32(message.state); } if (message.video_title !== undefined && message.video_title !== "") { writer.uint32(50).string(message.video_title); } if (message.video_description !== undefined && message.video_description !== "") { writer.uint32(58).string(message.video_description); } if (message.video_privacy !== undefined && message.video_privacy !== 0) { writer.uint32(64).int32(message.video_privacy); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseYouTubeVideoUpload(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.resource_name = reader.string(); continue; case 2: if (tag !== 16) { break; } message.video_upload_id = longToString(reader.int64()); continue; case 3: if (tag !== 26) { break; } message.channel_id = reader.string(); continue; case 4: if (tag !== 34) { break; } message.video_id = reader.string(); continue; case 5: if (tag !== 40) { break; } message.state = reader.int32(); continue; case 6: if (tag !== 50) { break; } message.video_title = reader.string(); continue; case 7: if (tag !== 58) { break; } message.video_description = reader.string(); continue; case 8: if (tag !== 64) { break; } message.video_privacy = reader.int32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { resource_name: isSet(object.resource_name) ? globalThis.String(object.resource_name) : "", video_upload_id: isSet(object.video_upload_id) ? globalThis.String(object.video_upload_id) : "0", channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "", video_id: isSet(object.video_id) ? globalThis.String(object.video_id) : "", state: isSet(object.state) ? youTubeVideoUploadStateEnum_YouTubeVideoUploadStateFromJSON(object.state) : 0, video_title: isSet(object.video_title) ? globalThis.String(object.video_title) : "", video_description: isSet(object.video_description) ? globalThis.String(object.video_description) : "", video_privacy: isSet(object.video_privacy) ? youTubeVideoPrivacyEnum_YouTubeVideoPrivacyFromJSON(object.video_privacy) : 0, }; }, toJSON(message) { const obj = {}; if (message.resource_name !== undefined && message.resource_name !== "") { obj.resource_name = message.resource_name; } if (message.video_upload_id !== undefined && message.video_upload_id !== "0") { obj.video_upload_id = message.video_upload_id; } if (message.channel_id !== undefined && message.channel_id !== "") { obj.channel_id = message.channel_id; } if (message.video_id !== undefined && message.video_id !== "") { obj.video_id = message.video_id; } if (message.state !== undefined && message.state !== 0) { obj.state = youTubeVideoUploadStateEnum_YouTubeVideoUploadStateToJSON(message.state); } if (message.video_title !== undefined && message.video_title !== "") { obj.video_title = message.video_title; } if (message.video_description !== undefined && message.video_description !== "") { obj.video_description = message.video_description; } if (message.video_privacy !== undefined && message.video_privacy !== 0) { obj.video_privacy = youTubeVideoPrivacyEnum_YouTubeVideoPrivacyToJSON(message.video_privacy); } return obj; }, create(base) { return YouTubeVideoUpload.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c, _d, _e, _f, _g, _h; const message = createBaseYouTubeVideoUpload(); message.resource_name = (_a = object.resource_name) !== null && _a !== void 0 ? _a : ""; message.video_upload_id = (_b = object.video_upload_id) !== null && _b !== void 0 ? _b : "0"; message.channel_id = (_c = object.channel_id) !== null && _c !== void 0 ? _c : ""; message.video_id = (_d = object.video_id) !== null && _d !== void 0 ? _d : ""; message.state = (_e = object.state) !== null && _e !== void 0 ? _e : 0; message.video_title = (_f = object.video_title) !== null && _f !== void 0 ? _f : ""; message.video_description = (_g = object.video_description) !== null && _g !== void 0 ? _g : ""; message.video_privacy = (_h = object.video_privacy) !== null && _h !== void 0 ? _h : 0; return message; }, }; function longToString(long) { return long.toString(); } if (_m0.util.Long !== Long) { _m0.util.Long = Long; _m0.configure(); } function isSet(value) { return value !== null && value !== undefined; }