From 91d308149691cf8037e54c294e173a91864c48fa Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:59:17 +0200 Subject: [PATCH] chore(protos): Avoid generating unused protobuf code (#774) --- dev-scripts/generate-proto.mjs | 2 +- protos/generated/misc/common.ts | 165 -- protos/generated/misc/params.ts | 1318 ----------- .../pfiinnertube/attestation_response_data.ts | 123 - .../api/pfiinnertube/capability_info.ts | 95 - .../youtube/api/pfiinnertube/client_info.ts | 2008 ----------------- .../api/pfiinnertube/get_watch_request.ts | 68 - .../api/pfiinnertube/innertube_context.ts | 272 --- .../pfiinnertube/metadata_update_request.ts | 540 ----- .../api/pfiinnertube/playback_context.ts | 238 -- .../player_attestation_request_data.ts | 94 - .../api/pfiinnertube/player_request.ts | 198 -- .../player_request_caption_params.ts | 67 - .../pfiinnertube/reel_item_watch_request.ts | 64 - .../youtube/api/pfiinnertube/request_info.ts | 270 --- .../service_integrity_dimensions.ts | 58 - .../api/pfiinnertube/third_party_info.ts | 114 - .../youtube/api/pfiinnertube/user_info.ts | 172 -- .../api/pfiinnertube/watch_next_request.ts | 218 -- 19 files changed, 1 insertion(+), 6083 deletions(-) diff --git a/dev-scripts/generate-proto.mjs b/dev-scripts/generate-proto.mjs index 6f476d99..769bd33d 100644 --- a/dev-scripts/generate-proto.mjs +++ b/dev-scripts/generate-proto.mjs @@ -45,7 +45,7 @@ if (!protoFiles.length) { } protoFiles.forEach((file) => { - const command = `protoc --proto_path=${protoDir} --plugin=protoc-gen-ts=${protocGenTs} --ts_opt=env=browser --ts_opt=importSuffix=.js --ts_out=${outDir} ${file}`; + const command = `protoc --proto_path=${protoDir} --plugin=protoc-gen-ts=${protocGenTs} --ts_opt=env=browser --ts_opt=importSuffix=.js --ts_out=${outDir} --ts_opt=outputJsonMethods=false --ts_opt=outputPartialMethods=false ${file}`; exec(command, (error, _stdout, stderr) => { if (error) { console.error(`Error compiling ${file}:`, stderr); diff --git a/protos/generated/misc/common.ts b/protos/generated/misc/common.ts index e5fadfbb..229e5dd7 100644 --- a/protos/generated/misc/common.ts +++ b/protos/generated/misc/common.ts @@ -79,34 +79,6 @@ export const HttpHeader: MessageFns = { } return message; }, - - fromJSON(object: any): HttpHeader { - return { - name: isSet(object.name) ? globalThis.String(object.name) : undefined, - value: isSet(object.value) ? globalThis.String(object.value) : undefined, - }; - }, - - toJSON(message: HttpHeader): unknown { - const obj: any = {}; - if (message.name !== undefined) { - obj.name = message.name; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): HttpHeader { - return HttpHeader.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): HttpHeader { - const message = createBaseHttpHeader(); - message.name = object.name ?? undefined; - message.value = object.value ?? undefined; - return message; - }, }; function createBaseFormatId(): FormatId { @@ -163,39 +135,6 @@ export const FormatId: MessageFns = { } return message; }, - - fromJSON(object: any): FormatId { - return { - itag: isSet(object.itag) ? globalThis.Number(object.itag) : undefined, - lastModified: isSet(object.lastModified) ? globalThis.Number(object.lastModified) : undefined, - xtags: isSet(object.xtags) ? globalThis.String(object.xtags) : undefined, - }; - }, - - toJSON(message: FormatId): unknown { - const obj: any = {}; - if (message.itag !== undefined) { - obj.itag = Math.round(message.itag); - } - if (message.lastModified !== undefined) { - obj.lastModified = Math.round(message.lastModified); - } - if (message.xtags !== undefined) { - obj.xtags = message.xtags; - } - return obj; - }, - - create, I>>(base?: I): FormatId { - return FormatId.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): FormatId { - const message = createBaseFormatId(); - message.itag = object.itag ?? undefined; - message.lastModified = object.lastModified ?? undefined; - message.xtags = object.xtags ?? undefined; - return message; - }, }; function createBaseInitRange(): InitRange { @@ -242,34 +181,6 @@ export const InitRange: MessageFns = { } return message; }, - - fromJSON(object: any): InitRange { - return { - start: isSet(object.start) ? globalThis.Number(object.start) : undefined, - end: isSet(object.end) ? globalThis.Number(object.end) : undefined, - }; - }, - - toJSON(message: InitRange): unknown { - const obj: any = {}; - if (message.start !== undefined) { - obj.start = Math.round(message.start); - } - if (message.end !== undefined) { - obj.end = Math.round(message.end); - } - return obj; - }, - - create, I>>(base?: I): InitRange { - return InitRange.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): InitRange { - const message = createBaseInitRange(); - message.start = object.start ?? undefined; - message.end = object.end ?? undefined; - return message; - }, }; function createBaseIndexRange(): IndexRange { @@ -316,34 +227,6 @@ export const IndexRange: MessageFns = { } return message; }, - - fromJSON(object: any): IndexRange { - return { - start: isSet(object.start) ? globalThis.Number(object.start) : undefined, - end: isSet(object.end) ? globalThis.Number(object.end) : undefined, - }; - }, - - toJSON(message: IndexRange): unknown { - const obj: any = {}; - if (message.start !== undefined) { - obj.start = Math.round(message.start); - } - if (message.end !== undefined) { - obj.end = Math.round(message.end); - } - return obj; - }, - - create, I>>(base?: I): IndexRange { - return IndexRange.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): IndexRange { - const message = createBaseIndexRange(); - message.start = object.start ?? undefined; - message.end = object.end ?? undefined; - return message; - }, }; function createBaseKeyValuePair(): KeyValuePair { @@ -390,48 +273,8 @@ export const KeyValuePair: MessageFns = { } return message; }, - - fromJSON(object: any): KeyValuePair { - return { - key: isSet(object.key) ? globalThis.String(object.key) : undefined, - value: isSet(object.value) ? globalThis.String(object.value) : undefined, - }; - }, - - toJSON(message: KeyValuePair): unknown { - const obj: any = {}; - if (message.key !== undefined) { - obj.key = message.key; - } - if (message.value !== undefined) { - obj.value = message.value; - } - return obj; - }, - - create, I>>(base?: I): KeyValuePair { - return KeyValuePair.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): KeyValuePair { - const message = createBaseKeyValuePair(); - message.key = object.key ?? undefined; - message.value = object.value ?? undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - function longToNumber(int64: { toString(): string }): number { const num = globalThis.Number(int64.toString()); if (num > globalThis.Number.MAX_SAFE_INTEGER) { @@ -443,15 +286,7 @@ function longToNumber(int64: { toString(): string }): number { return num; } -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/misc/params.ts b/protos/generated/misc/params.ts index 9f48eb47..b1be1e24 100644 --- a/protos/generated/misc/params.ts +++ b/protos/generated/misc/params.ts @@ -27,43 +27,6 @@ export enum SearchFilter_SortBy { UNRECOGNIZED = -1, } -export function searchFilter_SortByFromJSON(object: any): SearchFilter_SortBy { - switch (object) { - case 0: - case "RELEVANCE": - return SearchFilter_SortBy.RELEVANCE; - case 1: - case "RATING": - return SearchFilter_SortBy.RATING; - case 2: - case "UPLOAD_DATE": - return SearchFilter_SortBy.UPLOAD_DATE; - case 3: - case "VIEW_COUNT": - return SearchFilter_SortBy.VIEW_COUNT; - case -1: - case "UNRECOGNIZED": - default: - return SearchFilter_SortBy.UNRECOGNIZED; - } -} - -export function searchFilter_SortByToJSON(object: SearchFilter_SortBy): string { - switch (object) { - case SearchFilter_SortBy.RELEVANCE: - return "RELEVANCE"; - case SearchFilter_SortBy.RATING: - return "RATING"; - case SearchFilter_SortBy.UPLOAD_DATE: - return "UPLOAD_DATE"; - case SearchFilter_SortBy.VIEW_COUNT: - return "VIEW_COUNT"; - case SearchFilter_SortBy.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface SearchFilter_Filters { uploadDate?: SearchFilter_Filters_UploadDate | undefined; type?: SearchFilter_Filters_SearchType | undefined; @@ -92,53 +55,6 @@ export enum SearchFilter_Filters_UploadDate { UNRECOGNIZED = -1, } -export function searchFilter_Filters_UploadDateFromJSON(object: any): SearchFilter_Filters_UploadDate { - switch (object) { - case 0: - case "ANY_DATE": - return SearchFilter_Filters_UploadDate.ANY_DATE; - case 1: - case "HOUR": - return SearchFilter_Filters_UploadDate.HOUR; - case 2: - case "TODAY": - return SearchFilter_Filters_UploadDate.TODAY; - case 3: - case "WEEK": - return SearchFilter_Filters_UploadDate.WEEK; - case 4: - case "MONTH": - return SearchFilter_Filters_UploadDate.MONTH; - case 5: - case "YEAR": - return SearchFilter_Filters_UploadDate.YEAR; - case -1: - case "UNRECOGNIZED": - default: - return SearchFilter_Filters_UploadDate.UNRECOGNIZED; - } -} - -export function searchFilter_Filters_UploadDateToJSON(object: SearchFilter_Filters_UploadDate): string { - switch (object) { - case SearchFilter_Filters_UploadDate.ANY_DATE: - return "ANY_DATE"; - case SearchFilter_Filters_UploadDate.HOUR: - return "HOUR"; - case SearchFilter_Filters_UploadDate.TODAY: - return "TODAY"; - case SearchFilter_Filters_UploadDate.WEEK: - return "WEEK"; - case SearchFilter_Filters_UploadDate.MONTH: - return "MONTH"; - case SearchFilter_Filters_UploadDate.YEAR: - return "YEAR"; - case SearchFilter_Filters_UploadDate.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum SearchFilter_Filters_SearchType { ANY_TYPE = 0, VIDEO = 1, @@ -148,48 +64,6 @@ export enum SearchFilter_Filters_SearchType { UNRECOGNIZED = -1, } -export function searchFilter_Filters_SearchTypeFromJSON(object: any): SearchFilter_Filters_SearchType { - switch (object) { - case 0: - case "ANY_TYPE": - return SearchFilter_Filters_SearchType.ANY_TYPE; - case 1: - case "VIDEO": - return SearchFilter_Filters_SearchType.VIDEO; - case 2: - case "CHANNEL": - return SearchFilter_Filters_SearchType.CHANNEL; - case 3: - case "PLAYLIST": - return SearchFilter_Filters_SearchType.PLAYLIST; - case 4: - case "MOVIE": - return SearchFilter_Filters_SearchType.MOVIE; - case -1: - case "UNRECOGNIZED": - default: - return SearchFilter_Filters_SearchType.UNRECOGNIZED; - } -} - -export function searchFilter_Filters_SearchTypeToJSON(object: SearchFilter_Filters_SearchType): string { - switch (object) { - case SearchFilter_Filters_SearchType.ANY_TYPE: - return "ANY_TYPE"; - case SearchFilter_Filters_SearchType.VIDEO: - return "VIDEO"; - case SearchFilter_Filters_SearchType.CHANNEL: - return "CHANNEL"; - case SearchFilter_Filters_SearchType.PLAYLIST: - return "PLAYLIST"; - case SearchFilter_Filters_SearchType.MOVIE: - return "MOVIE"; - case SearchFilter_Filters_SearchType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum SearchFilter_Filters_Duration { ANY_DURATION = 0, SHORT = 1, @@ -198,43 +72,6 @@ export enum SearchFilter_Filters_Duration { UNRECOGNIZED = -1, } -export function searchFilter_Filters_DurationFromJSON(object: any): SearchFilter_Filters_Duration { - switch (object) { - case 0: - case "ANY_DURATION": - return SearchFilter_Filters_Duration.ANY_DURATION; - case 1: - case "SHORT": - return SearchFilter_Filters_Duration.SHORT; - case 2: - case "LONG": - return SearchFilter_Filters_Duration.LONG; - case 3: - case "MEDIUM": - return SearchFilter_Filters_Duration.MEDIUM; - case -1: - case "UNRECOGNIZED": - default: - return SearchFilter_Filters_Duration.UNRECOGNIZED; - } -} - -export function searchFilter_Filters_DurationToJSON(object: SearchFilter_Filters_Duration): string { - switch (object) { - case SearchFilter_Filters_Duration.ANY_DURATION: - return "ANY_DURATION"; - case SearchFilter_Filters_Duration.SHORT: - return "SHORT"; - case SearchFilter_Filters_Duration.LONG: - return "LONG"; - case SearchFilter_Filters_Duration.MEDIUM: - return "MEDIUM"; - case SearchFilter_Filters_Duration.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface SearchFilter_Filters_MusicSearchType { song?: boolean | undefined; video?: boolean | undefined; @@ -443,34 +280,6 @@ export const VisitorData: MessageFns = { } return message; }, - - fromJSON(object: any): VisitorData { - return { - id: isSet(object.id) ? globalThis.String(object.id) : "", - timestamp: isSet(object.timestamp) ? globalThis.Number(object.timestamp) : 0, - }; - }, - - toJSON(message: VisitorData): unknown { - const obj: any = {}; - if (message.id !== "") { - obj.id = message.id; - } - if (message.timestamp !== 0) { - obj.timestamp = Math.round(message.timestamp); - } - return obj; - }, - - create, I>>(base?: I): VisitorData { - return VisitorData.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): VisitorData { - const message = createBaseVisitorData(); - message.id = object.id ?? ""; - message.timestamp = object.timestamp ?? 0; - return message; - }, }; function createBaseSearchFilter(): SearchFilter { @@ -517,36 +326,6 @@ export const SearchFilter: MessageFns = { } return message; }, - - fromJSON(object: any): SearchFilter { - return { - sortBy: isSet(object.sortBy) ? searchFilter_SortByFromJSON(object.sortBy) : undefined, - filters: isSet(object.filters) ? SearchFilter_Filters.fromJSON(object.filters) : undefined, - }; - }, - - toJSON(message: SearchFilter): unknown { - const obj: any = {}; - if (message.sortBy !== undefined) { - obj.sortBy = searchFilter_SortByToJSON(message.sortBy); - } - if (message.filters !== undefined) { - obj.filters = SearchFilter_Filters.toJSON(message.filters); - } - return obj; - }, - - create, I>>(base?: I): SearchFilter { - return SearchFilter.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SearchFilter { - const message = createBaseSearchFilter(); - message.sortBy = object.sortBy ?? undefined; - message.filters = (object.filters !== undefined && object.filters !== null) - ? SearchFilter_Filters.fromPartial(object.filters) - : undefined; - return message; - }, }; function createBaseSearchFilter_Filters(): SearchFilter_Filters { @@ -739,105 +518,6 @@ export const SearchFilter_Filters: MessageFns = { } return message; }, - - fromJSON(object: any): SearchFilter_Filters { - return { - uploadDate: isSet(object.uploadDate) ? searchFilter_Filters_UploadDateFromJSON(object.uploadDate) : undefined, - type: isSet(object.type) ? searchFilter_Filters_SearchTypeFromJSON(object.type) : undefined, - duration: isSet(object.duration) ? searchFilter_Filters_DurationFromJSON(object.duration) : undefined, - musicSearchType: isSet(object.musicSearchType) - ? SearchFilter_Filters_MusicSearchType.fromJSON(object.musicSearchType) - : undefined, - featuresHd: isSet(object.featuresHd) ? globalThis.Boolean(object.featuresHd) : undefined, - featuresSubtitles: isSet(object.featuresSubtitles) ? globalThis.Boolean(object.featuresSubtitles) : undefined, - featuresCreativeCommons: isSet(object.featuresCreativeCommons) - ? globalThis.Boolean(object.featuresCreativeCommons) - : undefined, - features3d: isSet(object.features3d) ? globalThis.Boolean(object.features3d) : undefined, - featuresLive: isSet(object.featuresLive) ? globalThis.Boolean(object.featuresLive) : undefined, - featuresPurchased: isSet(object.featuresPurchased) ? globalThis.Boolean(object.featuresPurchased) : undefined, - features4k: isSet(object.features4k) ? globalThis.Boolean(object.features4k) : undefined, - features360: isSet(object.features360) ? globalThis.Boolean(object.features360) : undefined, - featuresLocation: isSet(object.featuresLocation) ? globalThis.Boolean(object.featuresLocation) : undefined, - featuresHdr: isSet(object.featuresHdr) ? globalThis.Boolean(object.featuresHdr) : undefined, - featuresVr180: isSet(object.featuresVr180) ? globalThis.Boolean(object.featuresVr180) : undefined, - }; - }, - - toJSON(message: SearchFilter_Filters): unknown { - const obj: any = {}; - if (message.uploadDate !== undefined) { - obj.uploadDate = searchFilter_Filters_UploadDateToJSON(message.uploadDate); - } - if (message.type !== undefined) { - obj.type = searchFilter_Filters_SearchTypeToJSON(message.type); - } - if (message.duration !== undefined) { - obj.duration = searchFilter_Filters_DurationToJSON(message.duration); - } - if (message.musicSearchType !== undefined) { - obj.musicSearchType = SearchFilter_Filters_MusicSearchType.toJSON(message.musicSearchType); - } - if (message.featuresHd !== undefined) { - obj.featuresHd = message.featuresHd; - } - if (message.featuresSubtitles !== undefined) { - obj.featuresSubtitles = message.featuresSubtitles; - } - if (message.featuresCreativeCommons !== undefined) { - obj.featuresCreativeCommons = message.featuresCreativeCommons; - } - if (message.features3d !== undefined) { - obj.features3d = message.features3d; - } - if (message.featuresLive !== undefined) { - obj.featuresLive = message.featuresLive; - } - if (message.featuresPurchased !== undefined) { - obj.featuresPurchased = message.featuresPurchased; - } - if (message.features4k !== undefined) { - obj.features4k = message.features4k; - } - if (message.features360 !== undefined) { - obj.features360 = message.features360; - } - if (message.featuresLocation !== undefined) { - obj.featuresLocation = message.featuresLocation; - } - if (message.featuresHdr !== undefined) { - obj.featuresHdr = message.featuresHdr; - } - if (message.featuresVr180 !== undefined) { - obj.featuresVr180 = message.featuresVr180; - } - return obj; - }, - - create, I>>(base?: I): SearchFilter_Filters { - return SearchFilter_Filters.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SearchFilter_Filters { - const message = createBaseSearchFilter_Filters(); - message.uploadDate = object.uploadDate ?? undefined; - message.type = object.type ?? undefined; - message.duration = object.duration ?? undefined; - message.musicSearchType = (object.musicSearchType !== undefined && object.musicSearchType !== null) - ? SearchFilter_Filters_MusicSearchType.fromPartial(object.musicSearchType) - : undefined; - message.featuresHd = object.featuresHd ?? undefined; - message.featuresSubtitles = object.featuresSubtitles ?? undefined; - message.featuresCreativeCommons = object.featuresCreativeCommons ?? undefined; - message.features3d = object.features3d ?? undefined; - message.featuresLive = object.featuresLive ?? undefined; - message.featuresPurchased = object.featuresPurchased ?? undefined; - message.features4k = object.features4k ?? undefined; - message.features360 = object.features360 ?? undefined; - message.featuresLocation = object.featuresLocation ?? undefined; - message.featuresHdr = object.featuresHdr ?? undefined; - message.featuresVr180 = object.featuresVr180 ?? undefined; - return message; - }, }; function createBaseSearchFilter_Filters_MusicSearchType(): SearchFilter_Filters_MusicSearchType { @@ -914,53 +594,6 @@ export const SearchFilter_Filters_MusicSearchType: MessageFns, I>>( - base?: I, - ): SearchFilter_Filters_MusicSearchType { - return SearchFilter_Filters_MusicSearchType.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): SearchFilter_Filters_MusicSearchType { - const message = createBaseSearchFilter_Filters_MusicSearchType(); - message.song = object.song ?? undefined; - message.video = object.video ?? undefined; - message.album = object.album ?? undefined; - message.artist = object.artist ?? undefined; - message.playlist = object.playlist ?? undefined; - return message; - }, }; function createBaseChannelAnalytics(): ChannelAnalytics { @@ -997,29 +630,6 @@ export const ChannelAnalytics: MessageFns = { } return message; }, - - fromJSON(object: any): ChannelAnalytics { - return { params: isSet(object.params) ? ChannelAnalytics_Params.fromJSON(object.params) : undefined }; - }, - - toJSON(message: ChannelAnalytics): unknown { - const obj: any = {}; - if (message.params !== undefined) { - obj.params = ChannelAnalytics_Params.toJSON(message.params); - } - return obj; - }, - - create, I>>(base?: I): ChannelAnalytics { - return ChannelAnalytics.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ChannelAnalytics { - const message = createBaseChannelAnalytics(); - message.params = (object.params !== undefined && object.params !== null) - ? ChannelAnalytics_Params.fromPartial(object.params) - : undefined; - return message; - }, }; function createBaseChannelAnalytics_Params(): ChannelAnalytics_Params { @@ -1056,27 +666,6 @@ export const ChannelAnalytics_Params: MessageFns = { } return message; }, - - fromJSON(object: any): ChannelAnalytics_Params { - return { channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : "" }; - }, - - toJSON(message: ChannelAnalytics_Params): unknown { - const obj: any = {}; - if (message.channelId !== "") { - obj.channelId = message.channelId; - } - return obj; - }, - - create, I>>(base?: I): ChannelAnalytics_Params { - return ChannelAnalytics_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ChannelAnalytics_Params { - const message = createBaseChannelAnalytics_Params(); - message.channelId = object.channelId ?? ""; - return message; - }, }; function createBaseSoundInfoParams(): SoundInfoParams { @@ -1113,29 +702,6 @@ export const SoundInfoParams: MessageFns = { } return message; }, - - fromJSON(object: any): SoundInfoParams { - return { sound: isSet(object.sound) ? SoundInfoParams_Sound.fromJSON(object.sound) : undefined }; - }, - - toJSON(message: SoundInfoParams): unknown { - const obj: any = {}; - if (message.sound !== undefined) { - obj.sound = SoundInfoParams_Sound.toJSON(message.sound); - } - return obj; - }, - - create, I>>(base?: I): SoundInfoParams { - return SoundInfoParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SoundInfoParams { - const message = createBaseSoundInfoParams(); - message.sound = (object.sound !== undefined && object.sound !== null) - ? SoundInfoParams_Sound.fromPartial(object.sound) - : undefined; - return message; - }, }; function createBaseSoundInfoParams_Sound(): SoundInfoParams_Sound { @@ -1172,29 +738,6 @@ export const SoundInfoParams_Sound: MessageFns = { } return message; }, - - fromJSON(object: any): SoundInfoParams_Sound { - return { params: isSet(object.params) ? SoundInfoParams_Sound_Params.fromJSON(object.params) : undefined }; - }, - - toJSON(message: SoundInfoParams_Sound): unknown { - const obj: any = {}; - if (message.params !== undefined) { - obj.params = SoundInfoParams_Sound_Params.toJSON(message.params); - } - return obj; - }, - - create, I>>(base?: I): SoundInfoParams_Sound { - return SoundInfoParams_Sound.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SoundInfoParams_Sound { - const message = createBaseSoundInfoParams_Sound(); - message.params = (object.params !== undefined && object.params !== null) - ? SoundInfoParams_Sound_Params.fromPartial(object.params) - : undefined; - return message; - }, }; function createBaseSoundInfoParams_Sound_Params(): SoundInfoParams_Sound_Params { @@ -1231,29 +774,6 @@ export const SoundInfoParams_Sound_Params: MessageFns, I>>(base?: I): SoundInfoParams_Sound_Params { - return SoundInfoParams_Sound_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SoundInfoParams_Sound_Params { - const message = createBaseSoundInfoParams_Sound_Params(); - message.ids = (object.ids !== undefined && object.ids !== null) - ? SoundInfoParams_Sound_Params_Ids.fromPartial(object.ids) - : undefined; - return message; - }, }; function createBaseSoundInfoParams_Sound_Params_Ids(): SoundInfoParams_Sound_Params_Ids { @@ -1310,43 +830,6 @@ export const SoundInfoParams_Sound_Params_Ids: MessageFns, I>>( - base?: I, - ): SoundInfoParams_Sound_Params_Ids { - return SoundInfoParams_Sound_Params_Ids.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): SoundInfoParams_Sound_Params_Ids { - const message = createBaseSoundInfoParams_Sound_Params_Ids(); - message.id1 = object.id1 ?? ""; - message.id2 = object.id2 ?? ""; - message.id3 = object.id3 ?? ""; - return message; - }, }; function createBaseNotificationPreferences(): NotificationPreferences { @@ -1413,46 +896,6 @@ export const NotificationPreferences: MessageFns = { } return message; }, - - fromJSON(object: any): NotificationPreferences { - return { - channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : "", - prefId: isSet(object.prefId) ? NotificationPreferences_Preference.fromJSON(object.prefId) : undefined, - number0: isSet(object.number0) ? globalThis.Number(object.number0) : undefined, - number1: isSet(object.number1) ? globalThis.Number(object.number1) : undefined, - }; - }, - - toJSON(message: NotificationPreferences): unknown { - const obj: any = {}; - if (message.channelId !== "") { - obj.channelId = message.channelId; - } - if (message.prefId !== undefined) { - obj.prefId = NotificationPreferences_Preference.toJSON(message.prefId); - } - if (message.number0 !== undefined) { - obj.number0 = Math.round(message.number0); - } - if (message.number1 !== undefined) { - obj.number1 = Math.round(message.number1); - } - return obj; - }, - - create, I>>(base?: I): NotificationPreferences { - return NotificationPreferences.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): NotificationPreferences { - const message = createBaseNotificationPreferences(); - message.channelId = object.channelId ?? ""; - message.prefId = (object.prefId !== undefined && object.prefId !== null) - ? NotificationPreferences_Preference.fromPartial(object.prefId) - : undefined; - message.number0 = object.number0 ?? undefined; - message.number1 = object.number1 ?? undefined; - return message; - }, }; function createBaseNotificationPreferences_Preference(): NotificationPreferences_Preference { @@ -1489,31 +932,6 @@ export const NotificationPreferences_Preference: MessageFns, I>>( - base?: I, - ): NotificationPreferences_Preference { - return NotificationPreferences_Preference.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): NotificationPreferences_Preference { - const message = createBaseNotificationPreferences_Preference(); - message.index = object.index ?? 0; - return message; - }, }; function createBaseLiveMessageParams(): LiveMessageParams { @@ -1570,41 +988,6 @@ export const LiveMessageParams: MessageFns = { } return message; }, - - fromJSON(object: any): LiveMessageParams { - return { - params: isSet(object.params) ? LiveMessageParams_Params.fromJSON(object.params) : undefined, - number0: isSet(object.number0) ? globalThis.Number(object.number0) : undefined, - number1: isSet(object.number1) ? globalThis.Number(object.number1) : undefined, - }; - }, - - toJSON(message: LiveMessageParams): unknown { - const obj: any = {}; - if (message.params !== undefined) { - obj.params = LiveMessageParams_Params.toJSON(message.params); - } - if (message.number0 !== undefined) { - obj.number0 = Math.round(message.number0); - } - if (message.number1 !== undefined) { - obj.number1 = Math.round(message.number1); - } - return obj; - }, - - create, I>>(base?: I): LiveMessageParams { - return LiveMessageParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): LiveMessageParams { - const message = createBaseLiveMessageParams(); - message.params = (object.params !== undefined && object.params !== null) - ? LiveMessageParams_Params.fromPartial(object.params) - : undefined; - message.number0 = object.number0 ?? undefined; - message.number1 = object.number1 ?? undefined; - return message; - }, }; function createBaseLiveMessageParams_Params(): LiveMessageParams_Params { @@ -1641,29 +1024,6 @@ export const LiveMessageParams_Params: MessageFns = { } return message; }, - - fromJSON(object: any): LiveMessageParams_Params { - return { ids: isSet(object.ids) ? LiveMessageParams_Params_Ids.fromJSON(object.ids) : undefined }; - }, - - toJSON(message: LiveMessageParams_Params): unknown { - const obj: any = {}; - if (message.ids !== undefined) { - obj.ids = LiveMessageParams_Params_Ids.toJSON(message.ids); - } - return obj; - }, - - create, I>>(base?: I): LiveMessageParams_Params { - return LiveMessageParams_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): LiveMessageParams_Params { - const message = createBaseLiveMessageParams_Params(); - message.ids = (object.ids !== undefined && object.ids !== null) - ? LiveMessageParams_Params_Ids.fromPartial(object.ids) - : undefined; - return message; - }, }; function createBaseLiveMessageParams_Params_Ids(): LiveMessageParams_Params_Ids { @@ -1710,34 +1070,6 @@ export const LiveMessageParams_Params_Ids: MessageFns, I>>(base?: I): LiveMessageParams_Params_Ids { - return LiveMessageParams_Params_Ids.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): LiveMessageParams_Params_Ids { - const message = createBaseLiveMessageParams_Params_Ids(); - message.channelId = object.channelId ?? ""; - message.videoId = object.videoId ?? ""; - return message; - }, }; function createBaseGetCommentsSectionParams(): GetCommentsSectionParams { @@ -1794,43 +1126,6 @@ export const GetCommentsSectionParams: MessageFns = { } return message; }, - - fromJSON(object: any): GetCommentsSectionParams { - return { - ctx: isSet(object.ctx) ? GetCommentsSectionParams_Context.fromJSON(object.ctx) : undefined, - unkParam: isSet(object.unkParam) ? globalThis.Number(object.unkParam) : 0, - params: isSet(object.params) ? GetCommentsSectionParams_Params.fromJSON(object.params) : undefined, - }; - }, - - toJSON(message: GetCommentsSectionParams): unknown { - const obj: any = {}; - if (message.ctx !== undefined) { - obj.ctx = GetCommentsSectionParams_Context.toJSON(message.ctx); - } - if (message.unkParam !== 0) { - obj.unkParam = Math.round(message.unkParam); - } - if (message.params !== undefined) { - obj.params = GetCommentsSectionParams_Params.toJSON(message.params); - } - return obj; - }, - - create, I>>(base?: I): GetCommentsSectionParams { - return GetCommentsSectionParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GetCommentsSectionParams { - const message = createBaseGetCommentsSectionParams(); - message.ctx = (object.ctx !== undefined && object.ctx !== null) - ? GetCommentsSectionParams_Context.fromPartial(object.ctx) - : undefined; - message.unkParam = object.unkParam ?? 0; - message.params = (object.params !== undefined && object.params !== null) - ? GetCommentsSectionParams_Params.fromPartial(object.params) - : undefined; - return message; - }, }; function createBaseGetCommentsSectionParams_Context(): GetCommentsSectionParams_Context { @@ -1867,31 +1162,6 @@ export const GetCommentsSectionParams_Context: MessageFns, I>>( - base?: I, - ): GetCommentsSectionParams_Context { - return GetCommentsSectionParams_Context.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): GetCommentsSectionParams_Context { - const message = createBaseGetCommentsSectionParams_Context(); - message.videoId = object.videoId ?? ""; - return message; - }, }; function createBaseGetCommentsSectionParams_Params(): GetCommentsSectionParams_Params { @@ -1968,57 +1238,6 @@ export const GetCommentsSectionParams_Params: MessageFns, I>>(base?: I): GetCommentsSectionParams_Params { - return GetCommentsSectionParams_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): GetCommentsSectionParams_Params { - const message = createBaseGetCommentsSectionParams_Params(); - message.unkToken = object.unkToken ?? undefined; - message.opts = (object.opts !== undefined && object.opts !== null) - ? GetCommentsSectionParams_Params_Options.fromPartial(object.opts) - : undefined; - message.repliesOpts = (object.repliesOpts !== undefined && object.repliesOpts !== null) - ? GetCommentsSectionParams_Params_RepliesOptions.fromPartial(object.repliesOpts) - : undefined; - message.page = object.page ?? undefined; - message.target = object.target ?? ""; - return message; - }, }; function createBaseGetCommentsSectionParams_Params_Options(): GetCommentsSectionParams_Params_Options { @@ -2085,48 +1304,6 @@ export const GetCommentsSectionParams_Params_Options: MessageFns, I>>( - base?: I, - ): GetCommentsSectionParams_Params_Options { - return GetCommentsSectionParams_Params_Options.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): GetCommentsSectionParams_Params_Options { - const message = createBaseGetCommentsSectionParams_Params_Options(); - message.videoId = object.videoId ?? ""; - message.sortBy = object.sortBy ?? 0; - message.type = object.type ?? 0; - message.commentId = object.commentId ?? undefined; - return message; - }, }; function createBaseGetCommentsSectionParams_Params_RepliesOptions(): GetCommentsSectionParams_Params_RepliesOptions { @@ -2218,62 +1395,6 @@ export const GetCommentsSectionParams_Params_RepliesOptions: MessageFns< } return message; }, - - fromJSON(object: any): GetCommentsSectionParams_Params_RepliesOptions { - return { - commentId: isSet(object.commentId) ? globalThis.String(object.commentId) : "", - unkopts: isSet(object.unkopts) - ? GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.fromJSON(object.unkopts) - : undefined, - channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : undefined, - videoId: isSet(object.videoId) ? globalThis.String(object.videoId) : "", - unkParam1: isSet(object.unkParam1) ? globalThis.Number(object.unkParam1) : 0, - unkParam2: isSet(object.unkParam2) ? globalThis.Number(object.unkParam2) : 0, - }; - }, - - toJSON(message: GetCommentsSectionParams_Params_RepliesOptions): unknown { - const obj: any = {}; - if (message.commentId !== "") { - obj.commentId = message.commentId; - } - if (message.unkopts !== undefined) { - obj.unkopts = GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.toJSON(message.unkopts); - } - if (message.channelId !== undefined) { - obj.channelId = message.channelId; - } - if (message.videoId !== "") { - obj.videoId = message.videoId; - } - if (message.unkParam1 !== 0) { - obj.unkParam1 = Math.round(message.unkParam1); - } - if (message.unkParam2 !== 0) { - obj.unkParam2 = Math.round(message.unkParam2); - } - return obj; - }, - - create, I>>( - base?: I, - ): GetCommentsSectionParams_Params_RepliesOptions { - return GetCommentsSectionParams_Params_RepliesOptions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): GetCommentsSectionParams_Params_RepliesOptions { - const message = createBaseGetCommentsSectionParams_Params_RepliesOptions(); - message.commentId = object.commentId ?? ""; - message.unkopts = (object.unkopts !== undefined && object.unkopts !== null) - ? GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.fromPartial(object.unkopts) - : undefined; - message.channelId = object.channelId ?? undefined; - message.videoId = object.videoId ?? ""; - message.unkParam1 = object.unkParam1 ?? 0; - message.unkParam2 = object.unkParam2 ?? 0; - return message; - }, }; function createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts(): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { @@ -2315,31 +1436,6 @@ export const GetCommentsSectionParams_Params_RepliesOptions_UnkOpts: MessageFns< } return message; }, - - fromJSON(object: any): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { - return { unkParam: isSet(object.unkParam) ? globalThis.Number(object.unkParam) : 0 }; - }, - - toJSON(message: GetCommentsSectionParams_Params_RepliesOptions_UnkOpts): unknown { - const obj: any = {}; - if (message.unkParam !== 0) { - obj.unkParam = Math.round(message.unkParam); - } - return obj; - }, - - create, I>>( - base?: I, - ): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { - return GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { - const message = createBaseGetCommentsSectionParams_Params_RepliesOptions_UnkOpts(); - message.unkParam = object.unkParam ?? 0; - return message; - }, }; function createBaseCreateCommentParams(): CreateCommentParams { @@ -2396,41 +1492,6 @@ export const CreateCommentParams: MessageFns = { } return message; }, - - fromJSON(object: any): CreateCommentParams { - return { - videoId: isSet(object.videoId) ? globalThis.String(object.videoId) : "", - params: isSet(object.params) ? CreateCommentParams_Params.fromJSON(object.params) : undefined, - number: isSet(object.number) ? globalThis.Number(object.number) : 0, - }; - }, - - toJSON(message: CreateCommentParams): unknown { - const obj: any = {}; - if (message.videoId !== "") { - obj.videoId = message.videoId; - } - if (message.params !== undefined) { - obj.params = CreateCommentParams_Params.toJSON(message.params); - } - if (message.number !== 0) { - obj.number = Math.round(message.number); - } - return obj; - }, - - create, I>>(base?: I): CreateCommentParams { - return CreateCommentParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): CreateCommentParams { - const message = createBaseCreateCommentParams(); - message.videoId = object.videoId ?? ""; - message.params = (object.params !== undefined && object.params !== null) - ? CreateCommentParams_Params.fromPartial(object.params) - : undefined; - message.number = object.number ?? 0; - return message; - }, }; function createBaseCreateCommentParams_Params(): CreateCommentParams_Params { @@ -2467,27 +1528,6 @@ export const CreateCommentParams_Params: MessageFns } return message; }, - - fromJSON(object: any): CreateCommentParams_Params { - return { index: isSet(object.index) ? globalThis.Number(object.index) : 0 }; - }, - - toJSON(message: CreateCommentParams_Params): unknown { - const obj: any = {}; - if (message.index !== 0) { - obj.index = Math.round(message.index); - } - return obj; - }, - - create, I>>(base?: I): CreateCommentParams_Params { - return CreateCommentParams_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): CreateCommentParams_Params { - const message = createBaseCreateCommentParams_Params(); - message.index = object.index ?? 0; - return message; - }, }; function createBasePeformCommentActionParams(): PeformCommentActionParams { @@ -2585,61 +1625,6 @@ export const PeformCommentActionParams: MessageFns = } return message; }, - - fromJSON(object: any): PeformCommentActionParams { - return { - type: isSet(object.type) ? globalThis.Number(object.type) : 0, - commentId: isSet(object.commentId) ? globalThis.String(object.commentId) : "", - videoId: isSet(object.videoId) ? globalThis.String(object.videoId) : "", - unkNum: isSet(object.unkNum) ? globalThis.Number(object.unkNum) : undefined, - channelId: isSet(object.channelId) ? globalThis.String(object.channelId) : undefined, - translateCommentParams: isSet(object.translateCommentParams) - ? PeformCommentActionParams_TranslateCommentParams.fromJSON(object.translateCommentParams) - : undefined, - }; - }, - - toJSON(message: PeformCommentActionParams): unknown { - const obj: any = {}; - if (message.type !== 0) { - obj.type = Math.round(message.type); - } - if (message.commentId !== "") { - obj.commentId = message.commentId; - } - if (message.videoId !== "") { - obj.videoId = message.videoId; - } - if (message.unkNum !== undefined) { - obj.unkNum = Math.round(message.unkNum); - } - if (message.channelId !== undefined) { - obj.channelId = message.channelId; - } - if (message.translateCommentParams !== undefined) { - obj.translateCommentParams = PeformCommentActionParams_TranslateCommentParams.toJSON( - message.translateCommentParams, - ); - } - return obj; - }, - - create, I>>(base?: I): PeformCommentActionParams { - return PeformCommentActionParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): PeformCommentActionParams { - const message = createBasePeformCommentActionParams(); - message.type = object.type ?? 0; - message.commentId = object.commentId ?? ""; - message.videoId = object.videoId ?? ""; - message.unkNum = object.unkNum ?? undefined; - message.channelId = object.channelId ?? undefined; - message.translateCommentParams = - (object.translateCommentParams !== undefined && object.translateCommentParams !== null) - ? PeformCommentActionParams_TranslateCommentParams.fromPartial(object.translateCommentParams) - : undefined; - return message; - }, }; function createBasePeformCommentActionParams_TranslateCommentParams(): PeformCommentActionParams_TranslateCommentParams { @@ -2701,47 +1686,6 @@ export const PeformCommentActionParams_TranslateCommentParams: MessageFns< } return message; }, - - fromJSON(object: any): PeformCommentActionParams_TranslateCommentParams { - return { - params: isSet(object.params) - ? PeformCommentActionParams_TranslateCommentParams_Params.fromJSON(object.params) - : undefined, - commentId: isSet(object.commentId) ? globalThis.String(object.commentId) : "", - targetLanguage: isSet(object.targetLanguage) ? globalThis.String(object.targetLanguage) : "", - }; - }, - - toJSON(message: PeformCommentActionParams_TranslateCommentParams): unknown { - const obj: any = {}; - if (message.params !== undefined) { - obj.params = PeformCommentActionParams_TranslateCommentParams_Params.toJSON(message.params); - } - if (message.commentId !== "") { - obj.commentId = message.commentId; - } - if (message.targetLanguage !== "") { - obj.targetLanguage = message.targetLanguage; - } - return obj; - }, - - create, I>>( - base?: I, - ): PeformCommentActionParams_TranslateCommentParams { - return PeformCommentActionParams_TranslateCommentParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): PeformCommentActionParams_TranslateCommentParams { - const message = createBasePeformCommentActionParams_TranslateCommentParams(); - message.params = (object.params !== undefined && object.params !== null) - ? PeformCommentActionParams_TranslateCommentParams_Params.fromPartial(object.params) - : undefined; - message.commentId = object.commentId ?? ""; - message.targetLanguage = object.targetLanguage ?? ""; - return message; - }, }; function createBasePeformCommentActionParams_TranslateCommentParams_Params(): PeformCommentActionParams_TranslateCommentParams_Params { @@ -2787,37 +1731,6 @@ export const PeformCommentActionParams_TranslateCommentParams_Params: MessageFns } return message; }, - - fromJSON(object: any): PeformCommentActionParams_TranslateCommentParams_Params { - return { - comment: isSet(object.comment) - ? PeformCommentActionParams_TranslateCommentParams_Params_Comment.fromJSON(object.comment) - : undefined, - }; - }, - - toJSON(message: PeformCommentActionParams_TranslateCommentParams_Params): unknown { - const obj: any = {}; - if (message.comment !== undefined) { - obj.comment = PeformCommentActionParams_TranslateCommentParams_Params_Comment.toJSON(message.comment); - } - return obj; - }, - - create, I>>( - base?: I, - ): PeformCommentActionParams_TranslateCommentParams_Params { - return PeformCommentActionParams_TranslateCommentParams_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): PeformCommentActionParams_TranslateCommentParams_Params { - const message = createBasePeformCommentActionParams_TranslateCommentParams_Params(); - message.comment = (object.comment !== undefined && object.comment !== null) - ? PeformCommentActionParams_TranslateCommentParams_Params_Comment.fromPartial(object.comment) - : undefined; - return message; - }, }; function createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment(): PeformCommentActionParams_TranslateCommentParams_Params_Comment { @@ -2862,31 +1775,6 @@ export const PeformCommentActionParams_TranslateCommentParams_Params_Comment: Me } return message; }, - - fromJSON(object: any): PeformCommentActionParams_TranslateCommentParams_Params_Comment { - return { text: isSet(object.text) ? globalThis.String(object.text) : "" }; - }, - - toJSON(message: PeformCommentActionParams_TranslateCommentParams_Params_Comment): unknown { - const obj: any = {}; - if (message.text !== "") { - obj.text = message.text; - } - return obj; - }, - - create, I>>( - base?: I, - ): PeformCommentActionParams_TranslateCommentParams_Params_Comment { - return PeformCommentActionParams_TranslateCommentParams_Params_Comment.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): PeformCommentActionParams_TranslateCommentParams_Params_Comment { - const message = createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment(); - message.text = object.text ?? ""; - return message; - }, }; function createBaseHashtag(): Hashtag { @@ -2923,29 +1811,6 @@ export const Hashtag: MessageFns = { } return message; }, - - fromJSON(object: any): Hashtag { - return { params: isSet(object.params) ? Hashtag_Params.fromJSON(object.params) : undefined }; - }, - - toJSON(message: Hashtag): unknown { - const obj: any = {}; - if (message.params !== undefined) { - obj.params = Hashtag_Params.toJSON(message.params); - } - return obj; - }, - - create, I>>(base?: I): Hashtag { - return Hashtag.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Hashtag { - const message = createBaseHashtag(); - message.params = (object.params !== undefined && object.params !== null) - ? Hashtag_Params.fromPartial(object.params) - : undefined; - return message; - }, }; function createBaseHashtag_Params(): Hashtag_Params { @@ -2992,34 +1857,6 @@ export const Hashtag_Params: MessageFns = { } return message; }, - - fromJSON(object: any): Hashtag_Params { - return { - hashtag: isSet(object.hashtag) ? globalThis.String(object.hashtag) : "", - type: isSet(object.type) ? globalThis.Number(object.type) : 0, - }; - }, - - toJSON(message: Hashtag_Params): unknown { - const obj: any = {}; - if (message.hashtag !== "") { - obj.hashtag = message.hashtag; - } - if (message.type !== 0) { - obj.type = Math.round(message.type); - } - return obj; - }, - - create, I>>(base?: I): Hashtag_Params { - return Hashtag_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): Hashtag_Params { - const message = createBaseHashtag_Params(); - message.hashtag = object.hashtag ?? ""; - message.type = object.type ?? 0; - return message; - }, }; function createBaseReelSequence(): ReelSequence { @@ -3086,46 +1923,6 @@ export const ReelSequence: MessageFns = { } return message; }, - - fromJSON(object: any): ReelSequence { - return { - shortId: isSet(object.shortId) ? globalThis.String(object.shortId) : "", - params: isSet(object.params) ? ReelSequence_Params.fromJSON(object.params) : undefined, - feature2: isSet(object.feature2) ? globalThis.Number(object.feature2) : 0, - feature3: isSet(object.feature3) ? globalThis.Number(object.feature3) : 0, - }; - }, - - toJSON(message: ReelSequence): unknown { - const obj: any = {}; - if (message.shortId !== "") { - obj.shortId = message.shortId; - } - if (message.params !== undefined) { - obj.params = ReelSequence_Params.toJSON(message.params); - } - if (message.feature2 !== 0) { - obj.feature2 = Math.round(message.feature2); - } - if (message.feature3 !== 0) { - obj.feature3 = Math.round(message.feature3); - } - return obj; - }, - - create, I>>(base?: I): ReelSequence { - return ReelSequence.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ReelSequence { - const message = createBaseReelSequence(); - message.shortId = object.shortId ?? ""; - message.params = (object.params !== undefined && object.params !== null) - ? ReelSequence_Params.fromPartial(object.params) - : undefined; - message.feature2 = object.feature2 ?? 0; - message.feature3 = object.feature3 ?? 0; - return message; - }, }; function createBaseReelSequence_Params(): ReelSequence_Params { @@ -3162,27 +1959,6 @@ export const ReelSequence_Params: MessageFns = { } return message; }, - - fromJSON(object: any): ReelSequence_Params { - return { number: isSet(object.number) ? globalThis.Number(object.number) : 0 }; - }, - - toJSON(message: ReelSequence_Params): unknown { - const obj: any = {}; - if (message.number !== 0) { - obj.number = Math.round(message.number); - } - return obj; - }, - - create, I>>(base?: I): ReelSequence_Params { - return ReelSequence_Params.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ReelSequence_Params { - const message = createBaseReelSequence_Params(); - message.number = object.number ?? 0; - return message; - }, }; function createBaseShortsParam(): ShortsParam { @@ -3229,36 +2005,6 @@ export const ShortsParam: MessageFns = { } return message; }, - - fromJSON(object: any): ShortsParam { - return { - f1: isSet(object.f1) ? ShortsParam_Field1.fromJSON(object.f1) : undefined, - p59: isSet(object.p59) ? globalThis.Number(object.p59) : undefined, - }; - }, - - toJSON(message: ShortsParam): unknown { - const obj: any = {}; - if (message.f1 !== undefined) { - obj.f1 = ShortsParam_Field1.toJSON(message.f1); - } - if (message.p59 !== undefined) { - obj.p59 = Math.round(message.p59); - } - return obj; - }, - - create, I>>(base?: I): ShortsParam { - return ShortsParam.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ShortsParam { - const message = createBaseShortsParam(); - message.f1 = (object.f1 !== undefined && object.f1 !== null) - ? ShortsParam_Field1.fromPartial(object.f1) - : undefined; - message.p59 = object.p59 ?? undefined; - return message; - }, }; function createBaseShortsParam_Field1(): ShortsParam_Field1 { @@ -3295,27 +2041,6 @@ export const ShortsParam_Field1: MessageFns = { } return message; }, - - fromJSON(object: any): ShortsParam_Field1 { - return { p1: isSet(object.p1) ? globalThis.Number(object.p1) : undefined }; - }, - - toJSON(message: ShortsParam_Field1): unknown { - const obj: any = {}; - if (message.p1 !== undefined) { - obj.p1 = Math.round(message.p1); - } - return obj; - }, - - create, I>>(base?: I): ShortsParam_Field1 { - return ShortsParam_Field1.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ShortsParam_Field1 { - const message = createBaseShortsParam_Field1(); - message.p1 = object.p1 ?? undefined; - return message; - }, }; function createBaseNextParams(): NextParams { @@ -3352,52 +2077,9 @@ export const NextParams: MessageFns = { } return message; }, - - fromJSON(object: any): NextParams { - return { - videoId: globalThis.Array.isArray(object?.videoId) ? object.videoId.map((e: any) => globalThis.String(e)) : [], - }; - }, - - toJSON(message: NextParams): unknown { - const obj: any = {}; - if (message.videoId?.length) { - obj.videoId = message.videoId; - } - return obj; - }, - - create, I>>(base?: I): NextParams { - return NextParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): NextParams { - const message = createBaseNextParams(); - message.videoId = object.videoId?.map((e) => e) || []; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/attestation_response_data.ts b/protos/generated/youtube/api/pfiinnertube/attestation_response_data.ts index 69079977..f394f814 100644 --- a/protos/generated/youtube/api/pfiinnertube/attestation_response_data.ts +++ b/protos/generated/youtube/api/pfiinnertube/attestation_response_data.ts @@ -114,58 +114,6 @@ export const AttestationResponseData: MessageFns = { } return message; }, - - fromJSON(object: any): AttestationResponseData { - return { - challenge: isSet(object.challenge) ? globalThis.String(object.challenge) : undefined, - webResponse: isSet(object.webResponse) ? globalThis.String(object.webResponse) : undefined, - androidResponse: isSet(object.androidResponse) ? globalThis.String(object.androidResponse) : undefined, - iosResponse: isSet(object.iosResponse) ? bytesFromBase64(object.iosResponse) : undefined, - error: isSet(object.error) ? globalThis.Number(object.error) : undefined, - adblockReporting: isSet(object.adblockReporting) - ? AttestationResponseData_AdblockReporting.fromJSON(object.adblockReporting) - : undefined, - }; - }, - - toJSON(message: AttestationResponseData): unknown { - const obj: any = {}; - if (message.challenge !== undefined) { - obj.challenge = message.challenge; - } - if (message.webResponse !== undefined) { - obj.webResponse = message.webResponse; - } - if (message.androidResponse !== undefined) { - obj.androidResponse = message.androidResponse; - } - if (message.iosResponse !== undefined) { - obj.iosResponse = base64FromBytes(message.iosResponse); - } - if (message.error !== undefined) { - obj.error = Math.round(message.error); - } - if (message.adblockReporting !== undefined) { - obj.adblockReporting = AttestationResponseData_AdblockReporting.toJSON(message.adblockReporting); - } - return obj; - }, - - create, I>>(base?: I): AttestationResponseData { - return AttestationResponseData.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): AttestationResponseData { - const message = createBaseAttestationResponseData(); - message.challenge = object.challenge ?? undefined; - message.webResponse = object.webResponse ?? undefined; - message.androidResponse = object.androidResponse ?? undefined; - message.iosResponse = object.iosResponse ?? undefined; - message.error = object.error ?? undefined; - message.adblockReporting = (object.adblockReporting !== undefined && object.adblockReporting !== null) - ? AttestationResponseData_AdblockReporting.fromPartial(object.adblockReporting) - : undefined; - return message; - }, }; function createBaseAttestationResponseData_AdblockReporting(): AttestationResponseData_AdblockReporting { @@ -212,71 +160,8 @@ export const AttestationResponseData_AdblockReporting: MessageFns, I>>( - base?: I, - ): AttestationResponseData_AdblockReporting { - return AttestationResponseData_AdblockReporting.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): AttestationResponseData_AdblockReporting { - const message = createBaseAttestationResponseData_AdblockReporting(); - message.reportingStatus = object.reportingStatus ?? undefined; - message.broadSpectrumDetectionResult = object.broadSpectrumDetectionResult ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - function longToNumber(int64: { toString(): string }): number { const num = globalThis.Number(int64.toString()); if (num > globalThis.Number.MAX_SAFE_INTEGER) { @@ -288,15 +173,7 @@ function longToNumber(int64: { toString(): string }): number { return num; } -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/capability_info.ts b/protos/generated/youtube/api/pfiinnertube/capability_info.ts index 7ee15989..522ec96d 100644 --- a/protos/generated/youtube/api/pfiinnertube/capability_info.ts +++ b/protos/generated/youtube/api/pfiinnertube/capability_info.ts @@ -86,48 +86,6 @@ export const CapabilityInfo: MessageFns = { } return message; }, - - fromJSON(object: any): CapabilityInfo { - return { - profile: isSet(object.profile) ? globalThis.String(object.profile) : undefined, - supportedCapabilities: globalThis.Array.isArray(object?.supportedCapabilities) - ? object.supportedCapabilities.map((e: any) => InnerTubeCapability.fromJSON(e)) - : [], - disabledCapabilities: globalThis.Array.isArray(object?.disabledCapabilities) - ? object.disabledCapabilities.map((e: any) => InnerTubeCapability.fromJSON(e)) - : [], - snapshot: isSet(object.snapshot) ? globalThis.String(object.snapshot) : undefined, - }; - }, - - toJSON(message: CapabilityInfo): unknown { - const obj: any = {}; - if (message.profile !== undefined) { - obj.profile = message.profile; - } - if (message.supportedCapabilities?.length) { - obj.supportedCapabilities = message.supportedCapabilities.map((e) => InnerTubeCapability.toJSON(e)); - } - if (message.disabledCapabilities?.length) { - obj.disabledCapabilities = message.disabledCapabilities.map((e) => InnerTubeCapability.toJSON(e)); - } - if (message.snapshot !== undefined) { - obj.snapshot = message.snapshot; - } - return obj; - }, - - create, I>>(base?: I): CapabilityInfo { - return CapabilityInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): CapabilityInfo { - const message = createBaseCapabilityInfo(); - message.profile = object.profile ?? undefined; - message.supportedCapabilities = object.supportedCapabilities?.map((e) => InnerTubeCapability.fromPartial(e)) || []; - message.disabledCapabilities = object.disabledCapabilities?.map((e) => InnerTubeCapability.fromPartial(e)) || []; - message.snapshot = object.snapshot ?? undefined; - return message; - }, }; function createBaseInnerTubeCapability(): InnerTubeCapability { @@ -184,62 +142,9 @@ export const InnerTubeCapability: MessageFns = { } return message; }, - - fromJSON(object: any): InnerTubeCapability { - return { - capability: isSet(object.capability) ? globalThis.Number(object.capability) : undefined, - features: isSet(object.features) ? globalThis.Number(object.features) : undefined, - experimentFlags: isSet(object.experimentFlags) ? globalThis.String(object.experimentFlags) : undefined, - }; - }, - - toJSON(message: InnerTubeCapability): unknown { - const obj: any = {}; - if (message.capability !== undefined) { - obj.capability = Math.round(message.capability); - } - if (message.features !== undefined) { - obj.features = Math.round(message.features); - } - if (message.experimentFlags !== undefined) { - obj.experimentFlags = message.experimentFlags; - } - return obj; - }, - - create, I>>(base?: I): InnerTubeCapability { - return InnerTubeCapability.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): InnerTubeCapability { - const message = createBaseInnerTubeCapability(); - message.capability = object.capability ?? undefined; - message.features = object.features ?? undefined; - message.experimentFlags = object.experimentFlags ?? undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/client_info.ts b/protos/generated/youtube/api/pfiinnertube/client_info.ts index b9102fd9..43a6613b 100644 --- a/protos/generated/youtube/api/pfiinnertube/client_info.ts +++ b/protos/generated/youtube/api/pfiinnertube/client_info.ts @@ -105,98 +105,17 @@ export enum ClientInfo_ClientFormFactor { UNRECOGNIZED = -1, } -export function clientInfo_ClientFormFactorFromJSON(object: any): ClientInfo_ClientFormFactor { - switch (object) { - case 0: - case "UNKNOWN_FORM_FACTOR": - return ClientInfo_ClientFormFactor.UNKNOWN_FORM_FACTOR; - case 1: - case "FORM_FACTOR_VAL1": - return ClientInfo_ClientFormFactor.FORM_FACTOR_VAL1; - case 2: - case "FORM_FACTOR_VAL2": - return ClientInfo_ClientFormFactor.FORM_FACTOR_VAL2; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_ClientFormFactor.UNRECOGNIZED; - } -} - -export function clientInfo_ClientFormFactorToJSON(object: ClientInfo_ClientFormFactor): string { - switch (object) { - case ClientInfo_ClientFormFactor.UNKNOWN_FORM_FACTOR: - return "UNKNOWN_FORM_FACTOR"; - case ClientInfo_ClientFormFactor.FORM_FACTOR_VAL1: - return "FORM_FACTOR_VAL1"; - case ClientInfo_ClientFormFactor.FORM_FACTOR_VAL2: - return "FORM_FACTOR_VAL2"; - case ClientInfo_ClientFormFactor.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_CameraType { UNKNOWN_CAMERA_TYPE = 0, UNRECOGNIZED = -1, } -export function clientInfo_CameraTypeFromJSON(object: any): ClientInfo_CameraType { - switch (object) { - case 0: - case "UNKNOWN_CAMERA_TYPE": - return ClientInfo_CameraType.UNKNOWN_CAMERA_TYPE; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_CameraType.UNRECOGNIZED; - } -} - -export function clientInfo_CameraTypeToJSON(object: ClientInfo_CameraType): string { - switch (object) { - case ClientInfo_CameraType.UNKNOWN_CAMERA_TYPE: - return "UNKNOWN_CAMERA_TYPE"; - case ClientInfo_CameraType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_UserInterfaceTheme { USER_INTERFACE_THEME_DARK = 0, USER_INTERFACE_THEME_LIGHT = 1, UNRECOGNIZED = -1, } -export function clientInfo_UserInterfaceThemeFromJSON(object: any): ClientInfo_UserInterfaceTheme { - switch (object) { - case 0: - case "USER_INTERFACE_THEME_DARK": - return ClientInfo_UserInterfaceTheme.USER_INTERFACE_THEME_DARK; - case 1: - case "USER_INTERFACE_THEME_LIGHT": - return ClientInfo_UserInterfaceTheme.USER_INTERFACE_THEME_LIGHT; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_UserInterfaceTheme.UNRECOGNIZED; - } -} - -export function clientInfo_UserInterfaceThemeToJSON(object: ClientInfo_UserInterfaceTheme): string { - switch (object) { - case ClientInfo_UserInterfaceTheme.USER_INTERFACE_THEME_DARK: - return "USER_INTERFACE_THEME_DARK"; - case ClientInfo_UserInterfaceTheme.USER_INTERFACE_THEME_LIGHT: - return "USER_INTERFACE_THEME_LIGHT"; - case ClientInfo_UserInterfaceTheme.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_MainAppWebInfo { graftUrl?: string | undefined; pwaInstallabilityStatus?: ClientInfo_MainAppWebInfo_PwaInstallabilityStatus | undefined; @@ -210,94 +129,16 @@ export enum ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus { UNRECOGNIZED = -1, } -export function clientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatusFromJSON( - object: any, -): ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus { - switch (object) { - case 0: - case "STORE_DIGITAL_GOODS_API_SUPPORT_STATUS_VAL0": - return ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus.STORE_DIGITAL_GOODS_API_SUPPORT_STATUS_VAL0; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus.UNRECOGNIZED; - } -} - -export function clientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatusToJSON( - object: ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus, -): string { - switch (object) { - case ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus.STORE_DIGITAL_GOODS_API_SUPPORT_STATUS_VAL0: - return "STORE_DIGITAL_GOODS_API_SUPPORT_STATUS_VAL0"; - case ClientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MainAppWebInfo_PwaInstallabilityStatus { PWA_INSTALLABILITY_STATUS_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MainAppWebInfo_PwaInstallabilityStatusFromJSON( - object: any, -): ClientInfo_MainAppWebInfo_PwaInstallabilityStatus { - switch (object) { - case 0: - case "PWA_INSTALLABILITY_STATUS_UNKNOWN": - return ClientInfo_MainAppWebInfo_PwaInstallabilityStatus.PWA_INSTALLABILITY_STATUS_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MainAppWebInfo_PwaInstallabilityStatus.UNRECOGNIZED; - } -} - -export function clientInfo_MainAppWebInfo_PwaInstallabilityStatusToJSON( - object: ClientInfo_MainAppWebInfo_PwaInstallabilityStatus, -): string { - switch (object) { - case ClientInfo_MainAppWebInfo_PwaInstallabilityStatus.PWA_INSTALLABILITY_STATUS_UNKNOWN: - return "PWA_INSTALLABILITY_STATUS_UNKNOWN"; - case ClientInfo_MainAppWebInfo_PwaInstallabilityStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MainAppWebInfo_WebDisplayMode { WEB_DISPLAY_MODE_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MainAppWebInfo_WebDisplayModeFromJSON( - object: any, -): ClientInfo_MainAppWebInfo_WebDisplayMode { - switch (object) { - case 0: - case "WEB_DISPLAY_MODE_UNKNOWN": - return ClientInfo_MainAppWebInfo_WebDisplayMode.WEB_DISPLAY_MODE_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MainAppWebInfo_WebDisplayMode.UNRECOGNIZED; - } -} - -export function clientInfo_MainAppWebInfo_WebDisplayModeToJSON( - object: ClientInfo_MainAppWebInfo_WebDisplayMode, -): string { - switch (object) { - case ClientInfo_MainAppWebInfo_WebDisplayMode.WEB_DISPLAY_MODE_UNKNOWN: - return "WEB_DISPLAY_MODE_UNKNOWN"; - case ClientInfo_MainAppWebInfo_WebDisplayMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_NotificationPermissionInfo { notificationsSetting?: ClientInfo_NotificationPermissionInfo_NotificationsSetting | undefined; lastDeviceOptInChangeTimeAgoSec?: number | undefined; @@ -308,32 +149,6 @@ export enum ClientInfo_NotificationPermissionInfo_NotificationsSetting { UNRECOGNIZED = -1, } -export function clientInfo_NotificationPermissionInfo_NotificationsSettingFromJSON( - object: any, -): ClientInfo_NotificationPermissionInfo_NotificationsSetting { - switch (object) { - case 0: - case "NOTIFICATIONS_SETTING_UNKNOWN": - return ClientInfo_NotificationPermissionInfo_NotificationsSetting.NOTIFICATIONS_SETTING_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_NotificationPermissionInfo_NotificationsSetting.UNRECOGNIZED; - } -} - -export function clientInfo_NotificationPermissionInfo_NotificationsSettingToJSON( - object: ClientInfo_NotificationPermissionInfo_NotificationsSetting, -): string { - switch (object) { - case ClientInfo_NotificationPermissionInfo_NotificationsSetting.NOTIFICATIONS_SETTING_UNKNOWN: - return "NOTIFICATIONS_SETTING_UNKNOWN"; - case ClientInfo_NotificationPermissionInfo_NotificationsSetting.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_GLDeviceInfo { glRenderer?: string | undefined; glEsVersionMajor?: number | undefined; @@ -350,32 +165,6 @@ export enum ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel { UNRECOGNIZED = -1, } -export function clientInfo_SpacecastClientInfo_SpacecastInteractionLevelFromJSON( - object: any, -): ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel { - switch (object) { - case 0: - case "UNKNOWN": - return ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel.UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel.UNRECOGNIZED; - } -} - -export function clientInfo_SpacecastClientInfo_SpacecastInteractionLevelToJSON( - object: ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel, -): string { - switch (object) { - case ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel.UNKNOWN: - return "UNKNOWN"; - case ClientInfo_SpacecastClientInfo_SpacecastInteractionLevel.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_SpacecastClientInfo_SpacecastAppliance { contentProfileToken?: Uint8Array | undefined; status?: ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus | undefined; @@ -389,32 +178,6 @@ export enum ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus UNRECOGNIZED = -1, } -export function clientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatusFromJSON( - object: any, -): ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus { - switch (object) { - case 0: - case "UNKNOWN": - return ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus.UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus.UNRECOGNIZED; - } -} - -export function clientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatusToJSON( - object: ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus, -): string { - switch (object) { - case ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus.UNKNOWN: - return "UNKNOWN"; - case ClientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_MobileDataPlanInfo { cpid?: string | undefined; serializedDataPlanStatus?: string | undefined; @@ -455,32 +218,6 @@ export enum ClientInfo_KidsAppInfo_KidsParentCurationMode { UNRECOGNIZED = -1, } -export function clientInfo_KidsAppInfo_KidsParentCurationModeFromJSON( - object: any, -): ClientInfo_KidsAppInfo_KidsParentCurationMode { - switch (object) { - case 0: - case "KPCM_UNKNOWN": - return ClientInfo_KidsAppInfo_KidsParentCurationMode.KPCM_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_KidsAppInfo_KidsParentCurationMode.UNRECOGNIZED; - } -} - -export function clientInfo_KidsAppInfo_KidsParentCurationModeToJSON( - object: ClientInfo_KidsAppInfo_KidsParentCurationMode, -): string { - switch (object) { - case ClientInfo_KidsAppInfo_KidsParentCurationMode.KPCM_UNKNOWN: - return "KPCM_UNKNOWN"; - case ClientInfo_KidsAppInfo_KidsParentCurationMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_KidsAppInfo_KidsContentSettings { kidsNoSearchMode?: ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode | undefined; ageUpMode?: ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode | undefined; @@ -493,74 +230,12 @@ export enum ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode { UNRECOGNIZED = -1, } -export function clientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchModeFromJSON( - object: any, -): ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode { - switch (object) { - case 0: - case "YT_KIDS_NO_SEARCH_MODE_OFF": - return ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode.YT_KIDS_NO_SEARCH_MODE_OFF; - case 1: - case "YT_KIDS_NO_SEARCH_MODE_ON": - return ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode.YT_KIDS_NO_SEARCH_MODE_ON; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode.UNRECOGNIZED; - } -} - -export function clientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchModeToJSON( - object: ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode, -): string { - switch (object) { - case ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode.YT_KIDS_NO_SEARCH_MODE_OFF: - return "YT_KIDS_NO_SEARCH_MODE_OFF"; - case ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode.YT_KIDS_NO_SEARCH_MODE_ON: - return "YT_KIDS_NO_SEARCH_MODE_ON"; - case ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsNoSearchMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode { YT_KIDS_AGE_UP_MODE_OFF = 0, YT_KIDS_AGE_UP_MODE_ON = 1, UNRECOGNIZED = -1, } -export function clientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpModeFromJSON( - object: any, -): ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode { - switch (object) { - case 0: - case "YT_KIDS_AGE_UP_MODE_OFF": - return ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode.YT_KIDS_AGE_UP_MODE_OFF; - case 1: - case "YT_KIDS_AGE_UP_MODE_ON": - return ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode.YT_KIDS_AGE_UP_MODE_ON; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode.UNRECOGNIZED; - } -} - -export function clientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpModeToJSON( - object: ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode, -): string { - switch (object) { - case ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode.YT_KIDS_AGE_UP_MODE_OFF: - return "YT_KIDS_AGE_UP_MODE_OFF"; - case ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode.YT_KIDS_AGE_UP_MODE_ON: - return "YT_KIDS_AGE_UP_MODE_ON"; - case ClientInfo_KidsAppInfo_KidsContentSettings_YTKidsAgeUpMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity { /** YT_KIDS_CONTENT_DENSITY_VAL1 - @TODO: Check these. */ YT_KIDS_CONTENT_DENSITY_VAL1 = 0, @@ -569,42 +244,6 @@ export enum ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity { UNRECOGNIZED = -1, } -export function clientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensityFromJSON( - object: any, -): ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity { - switch (object) { - case 0: - case "YT_KIDS_CONTENT_DENSITY_VAL1": - return ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.YT_KIDS_CONTENT_DENSITY_VAL1; - case 1: - case "YT_KIDS_CONTENT_DENSITY_VAL2": - return ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.YT_KIDS_CONTENT_DENSITY_VAL2; - case 2: - case "YT_KIDS_CONTENT_DENSITY_VAL3": - return ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.YT_KIDS_CONTENT_DENSITY_VAL3; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.UNRECOGNIZED; - } -} - -export function clientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensityToJSON( - object: ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity, -): string { - switch (object) { - case ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.YT_KIDS_CONTENT_DENSITY_VAL1: - return "YT_KIDS_CONTENT_DENSITY_VAL1"; - case ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.YT_KIDS_CONTENT_DENSITY_VAL2: - return "YT_KIDS_CONTENT_DENSITY_VAL2"; - case ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.YT_KIDS_CONTENT_DENSITY_VAL3: - return "YT_KIDS_CONTENT_DENSITY_VAL3"; - case ClientInfo_KidsAppInfo_KidsContentSettings_KidsContentDensity.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_KidsAppInfo_KidsCategorySettings { enabledCategories?: string | undefined; } @@ -636,241 +275,41 @@ export enum ClientInfo_MusicAppInfo_MusicPlayBackMode { UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_MusicPlayBackModeFromJSON( - object: any, -): ClientInfo_MusicAppInfo_MusicPlayBackMode { - switch (object) { - case 0: - case "MPBM_UNKNOWN": - return ClientInfo_MusicAppInfo_MusicPlayBackMode.MPBM_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_MusicPlayBackMode.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_MusicPlayBackModeToJSON( - object: ClientInfo_MusicAppInfo_MusicPlayBackMode, -): string { - switch (object) { - case ClientInfo_MusicAppInfo_MusicPlayBackMode.MPBM_UNKNOWN: - return "MPBM_UNKNOWN"; - case ClientInfo_MusicAppInfo_MusicPlayBackMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_MusicLocationMasterSwitch { MLMS_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_MusicLocationMasterSwitchFromJSON( - object: any, -): ClientInfo_MusicAppInfo_MusicLocationMasterSwitch { - switch (object) { - case 0: - case "MLMS_UNKNOWN": - return ClientInfo_MusicAppInfo_MusicLocationMasterSwitch.MLMS_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_MusicLocationMasterSwitch.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_MusicLocationMasterSwitchToJSON( - object: ClientInfo_MusicAppInfo_MusicLocationMasterSwitch, -): string { - switch (object) { - case ClientInfo_MusicAppInfo_MusicLocationMasterSwitch.MLMS_UNKNOWN: - return "MLMS_UNKNOWN"; - case ClientInfo_MusicAppInfo_MusicLocationMasterSwitch.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_MusicActivityMasterSwitch { MAMS_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_MusicActivityMasterSwitchFromJSON( - object: any, -): ClientInfo_MusicAppInfo_MusicActivityMasterSwitch { - switch (object) { - case 0: - case "MAMS_UNKNOWN": - return ClientInfo_MusicAppInfo_MusicActivityMasterSwitch.MAMS_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_MusicActivityMasterSwitch.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_MusicActivityMasterSwitchToJSON( - object: ClientInfo_MusicAppInfo_MusicActivityMasterSwitch, -): string { - switch (object) { - case ClientInfo_MusicAppInfo_MusicActivityMasterSwitch.MAMS_UNKNOWN: - return "MAMS_UNKNOWN"; - case ClientInfo_MusicAppInfo_MusicActivityMasterSwitch.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus { UNKNOWN_STATUS = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_IosBackgroundRefreshStatusFromJSON( - object: any, -): ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus { - switch (object) { - case 0: - case "UNKNOWN_STATUS": - return ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus.UNKNOWN_STATUS; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_IosBackgroundRefreshStatusToJSON( - object: ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus, -): string { - switch (object) { - case ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus.UNKNOWN_STATUS: - return "UNKNOWN_STATUS"; - case ClientInfo_MusicAppInfo_IosBackgroundRefreshStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_PwaInstallabilityStatus { PIS_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_PwaInstallabilityStatusFromJSON( - object: any, -): ClientInfo_MusicAppInfo_PwaInstallabilityStatus { - switch (object) { - case 0: - case "PIS_UNKNOWN": - return ClientInfo_MusicAppInfo_PwaInstallabilityStatus.PIS_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_PwaInstallabilityStatus.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_PwaInstallabilityStatusToJSON( - object: ClientInfo_MusicAppInfo_PwaInstallabilityStatus, -): string { - switch (object) { - case ClientInfo_MusicAppInfo_PwaInstallabilityStatus.PIS_UNKNOWN: - return "PIS_UNKNOWN"; - case ClientInfo_MusicAppInfo_PwaInstallabilityStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_WebDisplayMode { WDM_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_WebDisplayModeFromJSON(object: any): ClientInfo_MusicAppInfo_WebDisplayMode { - switch (object) { - case 0: - case "WDM_UNKNOWN": - return ClientInfo_MusicAppInfo_WebDisplayMode.WDM_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_WebDisplayMode.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_WebDisplayModeToJSON(object: ClientInfo_MusicAppInfo_WebDisplayMode): string { - switch (object) { - case ClientInfo_MusicAppInfo_WebDisplayMode.WDM_UNKNOWN: - return "WDM_UNKNOWN"; - case ClientInfo_MusicAppInfo_WebDisplayMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_MusicTier { UNKNOWN_TIER = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_MusicTierFromJSON(object: any): ClientInfo_MusicAppInfo_MusicTier { - switch (object) { - case 0: - case "UNKNOWN_TIER": - return ClientInfo_MusicAppInfo_MusicTier.UNKNOWN_TIER; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_MusicTier.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_MusicTierToJSON(object: ClientInfo_MusicAppInfo_MusicTier): string { - switch (object) { - case ClientInfo_MusicAppInfo_MusicTier.UNKNOWN_TIER: - return "UNKNOWN_TIER"; - case ClientInfo_MusicAppInfo_MusicTier.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export enum ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus { SDGAS_UNKNOWN = 0, UNRECOGNIZED = -1, } -export function clientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatusFromJSON( - object: any, -): ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus { - switch (object) { - case 0: - case "SDGAS_UNKNOWN": - return ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus.SDGAS_UNKNOWN; - case -1: - case "UNRECOGNIZED": - default: - return ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus.UNRECOGNIZED; - } -} - -export function clientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatusToJSON( - object: ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus, -): string { - switch (object) { - case ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus.SDGAS_UNKNOWN: - return "SDGAS_UNKNOWN"; - case ClientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface ClientInfo_TvAppInfo { mdxImpactedSessionsServerEvents?: string | undefined; enablePrivacyFilter?: boolean | undefined; @@ -1708,425 +1147,6 @@ export const ClientInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo { - return { - hl: isSet(object.hl) ? globalThis.String(object.hl) : undefined, - gl: isSet(object.gl) ? globalThis.String(object.gl) : undefined, - remoteHost: isSet(object.remoteHost) ? globalThis.String(object.remoteHost) : undefined, - deviceId: isSet(object.deviceId) ? globalThis.String(object.deviceId) : undefined, - debugDeviceIdOverride: isSet(object.debugDeviceIdOverride) - ? globalThis.String(object.debugDeviceIdOverride) - : undefined, - carrierGeo: isSet(object.carrierGeo) ? globalThis.String(object.carrierGeo) : undefined, - crackedHl: isSet(object.crackedHl) ? globalThis.Boolean(object.crackedHl) : undefined, - deviceMake: isSet(object.deviceMake) ? globalThis.String(object.deviceMake) : undefined, - deviceModel: isSet(object.deviceModel) ? globalThis.String(object.deviceModel) : undefined, - visitorData: isSet(object.visitorData) ? globalThis.String(object.visitorData) : undefined, - userAgent: isSet(object.userAgent) ? globalThis.String(object.userAgent) : undefined, - clientName: isSet(object.clientName) ? globalThis.Number(object.clientName) : undefined, - clientVersion: isSet(object.clientVersion) ? globalThis.String(object.clientVersion) : undefined, - osName: isSet(object.osName) ? globalThis.String(object.osName) : undefined, - osVersion: isSet(object.osVersion) ? globalThis.String(object.osVersion) : undefined, - projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : undefined, - acceptLanguage: isSet(object.acceptLanguage) ? globalThis.String(object.acceptLanguage) : undefined, - acceptRegion: isSet(object.acceptRegion) ? globalThis.String(object.acceptRegion) : undefined, - originalUrl: isSet(object.originalUrl) ? globalThis.String(object.originalUrl) : undefined, - rawDeviceId: isSet(object.rawDeviceId) ? globalThis.String(object.rawDeviceId) : undefined, - configData: isSet(object.configData) ? globalThis.String(object.configData) : undefined, - spacecastToken: isSet(object.spacecastToken) ? globalThis.String(object.spacecastToken) : undefined, - internalGeo: isSet(object.internalGeo) ? globalThis.String(object.internalGeo) : undefined, - screenWidthPoints: isSet(object.screenWidthPoints) ? globalThis.Number(object.screenWidthPoints) : undefined, - screenHeightPoints: isSet(object.screenHeightPoints) ? globalThis.Number(object.screenHeightPoints) : undefined, - screenWidthInches: isSet(object.screenWidthInches) ? globalThis.Number(object.screenWidthInches) : undefined, - screenHeightInches: isSet(object.screenHeightInches) ? globalThis.Number(object.screenHeightInches) : undefined, - screenPixelDensity: isSet(object.screenPixelDensity) ? globalThis.Number(object.screenPixelDensity) : undefined, - platform: isSet(object.platform) ? globalThis.Number(object.platform) : undefined, - spacecastClientInfo: isSet(object.spacecastClientInfo) - ? ClientInfo_SpacecastClientInfo.fromJSON(object.spacecastClientInfo) - : undefined, - clientFormFactor: isSet(object.clientFormFactor) - ? clientInfo_ClientFormFactorFromJSON(object.clientFormFactor) - : undefined, - forwardedFor: isSet(object.forwardedFor) ? globalThis.String(object.forwardedFor) : undefined, - mobileDataPlanInfo: isSet(object.mobileDataPlanInfo) - ? ClientInfo_MobileDataPlanInfo.fromJSON(object.mobileDataPlanInfo) - : undefined, - gmscoreVersionCode: isSet(object.gmscoreVersionCode) ? globalThis.Number(object.gmscoreVersionCode) : undefined, - webpSupport: isSet(object.webpSupport) ? globalThis.Boolean(object.webpSupport) : undefined, - cameraType: isSet(object.cameraType) ? clientInfo_CameraTypeFromJSON(object.cameraType) : undefined, - experimentsToken: isSet(object.experimentsToken) ? globalThis.String(object.experimentsToken) : undefined, - windowWidthPoints: isSet(object.windowWidthPoints) ? globalThis.Number(object.windowWidthPoints) : undefined, - windowHeightPoints: isSet(object.windowHeightPoints) ? globalThis.Number(object.windowHeightPoints) : undefined, - configInfo: isSet(object.configInfo) ? ClientInfo_ConfigGroupsClientInfo.fromJSON(object.configInfo) : undefined, - unpluggedLocationInfo: isSet(object.unpluggedLocationInfo) - ? ClientInfo_UnpluggedLocationInfo.fromJSON(object.unpluggedLocationInfo) - : undefined, - androidSdkVersion: isSet(object.androidSdkVersion) ? globalThis.Number(object.androidSdkVersion) : undefined, - screenDensityFloat: isSet(object.screenDensityFloat) ? globalThis.Number(object.screenDensityFloat) : undefined, - firstTimeSignInExperimentIds: isSet(object.firstTimeSignInExperimentIds) - ? globalThis.Number(object.firstTimeSignInExperimentIds) - : undefined, - utcOffsetMinutes: isSet(object.utcOffsetMinutes) ? globalThis.Number(object.utcOffsetMinutes) : undefined, - animatedWebpSupport: isSet(object.animatedWebpSupport) - ? globalThis.Boolean(object.animatedWebpSupport) - : undefined, - kidsAppInfo: isSet(object.kidsAppInfo) ? ClientInfo_KidsAppInfo.fromJSON(object.kidsAppInfo) : undefined, - musicAppInfo: isSet(object.musicAppInfo) ? ClientInfo_MusicAppInfo.fromJSON(object.musicAppInfo) : undefined, - tvAppInfo: isSet(object.tvAppInfo) ? ClientInfo_TvAppInfo.fromJSON(object.tvAppInfo) : undefined, - internalGeoIp: isSet(object.internalGeoIp) ? globalThis.String(object.internalGeoIp) : undefined, - unpluggedAppInfo: isSet(object.unpluggedAppInfo) - ? ClientInfo_UnpluggedAppInfo.fromJSON(object.unpluggedAppInfo) - : undefined, - locationInfo: isSet(object.locationInfo) ? ClientInfo_LocationInfo.fromJSON(object.locationInfo) : undefined, - contentSizeCategory: isSet(object.contentSizeCategory) - ? globalThis.String(object.contentSizeCategory) - : undefined, - fontScale: isSet(object.fontScale) ? globalThis.Number(object.fontScale) : undefined, - userInterfaceTheme: isSet(object.userInterfaceTheme) - ? clientInfo_UserInterfaceThemeFromJSON(object.userInterfaceTheme) - : undefined, - timeZone: isSet(object.timeZone) ? globalThis.String(object.timeZone) : undefined, - homeGroupInfo: isSet(object.homeGroupInfo) ? ClientInfo_HomeGroupInfo.fromJSON(object.homeGroupInfo) : undefined, - emlTemplateContext: isSet(object.emlTemplateContext) ? bytesFromBase64(object.emlTemplateContext) : undefined, - coldAppBundleConfigData: isSet(object.coldAppBundleConfigData) - ? bytesFromBase64(object.coldAppBundleConfigData) - : undefined, - browserName: isSet(object.browserName) ? globalThis.String(object.browserName) : undefined, - browserVersion: isSet(object.browserVersion) ? globalThis.String(object.browserVersion) : undefined, - locationPlayabilityToken: isSet(object.locationPlayabilityToken) - ? globalThis.String(object.locationPlayabilityToken) - : undefined, - chipset: isSet(object.chipset) ? globalThis.String(object.chipset) : undefined, - firmwareVersion: isSet(object.firmwareVersion) ? globalThis.String(object.firmwareVersion) : undefined, - memoryTotalKbytes: isSet(object.memoryTotalKbytes) ? globalThis.Number(object.memoryTotalKbytes) : undefined, - mainAppWebInfo: isSet(object.mainAppWebInfo) - ? ClientInfo_MainAppWebInfo.fromJSON(object.mainAppWebInfo) - : undefined, - notificationPermissionInfo: isSet(object.notificationPermissionInfo) - ? ClientInfo_NotificationPermissionInfo.fromJSON(object.notificationPermissionInfo) - : undefined, - deviceBrand: isSet(object.deviceBrand) ? globalThis.String(object.deviceBrand) : undefined, - glDeviceInfo: isSet(object.glDeviceInfo) ? ClientInfo_GLDeviceInfo.fromJSON(object.glDeviceInfo) : undefined, - }; - }, - - toJSON(message: ClientInfo): unknown { - const obj: any = {}; - if (message.hl !== undefined) { - obj.hl = message.hl; - } - if (message.gl !== undefined) { - obj.gl = message.gl; - } - if (message.remoteHost !== undefined) { - obj.remoteHost = message.remoteHost; - } - if (message.deviceId !== undefined) { - obj.deviceId = message.deviceId; - } - if (message.debugDeviceIdOverride !== undefined) { - obj.debugDeviceIdOverride = message.debugDeviceIdOverride; - } - if (message.carrierGeo !== undefined) { - obj.carrierGeo = message.carrierGeo; - } - if (message.crackedHl !== undefined) { - obj.crackedHl = message.crackedHl; - } - if (message.deviceMake !== undefined) { - obj.deviceMake = message.deviceMake; - } - if (message.deviceModel !== undefined) { - obj.deviceModel = message.deviceModel; - } - if (message.visitorData !== undefined) { - obj.visitorData = message.visitorData; - } - if (message.userAgent !== undefined) { - obj.userAgent = message.userAgent; - } - if (message.clientName !== undefined) { - obj.clientName = Math.round(message.clientName); - } - if (message.clientVersion !== undefined) { - obj.clientVersion = message.clientVersion; - } - if (message.osName !== undefined) { - obj.osName = message.osName; - } - if (message.osVersion !== undefined) { - obj.osVersion = message.osVersion; - } - if (message.projectId !== undefined) { - obj.projectId = message.projectId; - } - if (message.acceptLanguage !== undefined) { - obj.acceptLanguage = message.acceptLanguage; - } - if (message.acceptRegion !== undefined) { - obj.acceptRegion = message.acceptRegion; - } - if (message.originalUrl !== undefined) { - obj.originalUrl = message.originalUrl; - } - if (message.rawDeviceId !== undefined) { - obj.rawDeviceId = message.rawDeviceId; - } - if (message.configData !== undefined) { - obj.configData = message.configData; - } - if (message.spacecastToken !== undefined) { - obj.spacecastToken = message.spacecastToken; - } - if (message.internalGeo !== undefined) { - obj.internalGeo = message.internalGeo; - } - if (message.screenWidthPoints !== undefined) { - obj.screenWidthPoints = Math.round(message.screenWidthPoints); - } - if (message.screenHeightPoints !== undefined) { - obj.screenHeightPoints = Math.round(message.screenHeightPoints); - } - if (message.screenWidthInches !== undefined) { - obj.screenWidthInches = message.screenWidthInches; - } - if (message.screenHeightInches !== undefined) { - obj.screenHeightInches = message.screenHeightInches; - } - if (message.screenPixelDensity !== undefined) { - obj.screenPixelDensity = Math.round(message.screenPixelDensity); - } - if (message.platform !== undefined) { - obj.platform = Math.round(message.platform); - } - if (message.spacecastClientInfo !== undefined) { - obj.spacecastClientInfo = ClientInfo_SpacecastClientInfo.toJSON(message.spacecastClientInfo); - } - if (message.clientFormFactor !== undefined) { - obj.clientFormFactor = clientInfo_ClientFormFactorToJSON(message.clientFormFactor); - } - if (message.forwardedFor !== undefined) { - obj.forwardedFor = message.forwardedFor; - } - if (message.mobileDataPlanInfo !== undefined) { - obj.mobileDataPlanInfo = ClientInfo_MobileDataPlanInfo.toJSON(message.mobileDataPlanInfo); - } - if (message.gmscoreVersionCode !== undefined) { - obj.gmscoreVersionCode = Math.round(message.gmscoreVersionCode); - } - if (message.webpSupport !== undefined) { - obj.webpSupport = message.webpSupport; - } - if (message.cameraType !== undefined) { - obj.cameraType = clientInfo_CameraTypeToJSON(message.cameraType); - } - if (message.experimentsToken !== undefined) { - obj.experimentsToken = message.experimentsToken; - } - if (message.windowWidthPoints !== undefined) { - obj.windowWidthPoints = Math.round(message.windowWidthPoints); - } - if (message.windowHeightPoints !== undefined) { - obj.windowHeightPoints = Math.round(message.windowHeightPoints); - } - if (message.configInfo !== undefined) { - obj.configInfo = ClientInfo_ConfigGroupsClientInfo.toJSON(message.configInfo); - } - if (message.unpluggedLocationInfo !== undefined) { - obj.unpluggedLocationInfo = ClientInfo_UnpluggedLocationInfo.toJSON(message.unpluggedLocationInfo); - } - if (message.androidSdkVersion !== undefined) { - obj.androidSdkVersion = Math.round(message.androidSdkVersion); - } - if (message.screenDensityFloat !== undefined) { - obj.screenDensityFloat = message.screenDensityFloat; - } - if (message.firstTimeSignInExperimentIds !== undefined) { - obj.firstTimeSignInExperimentIds = Math.round(message.firstTimeSignInExperimentIds); - } - if (message.utcOffsetMinutes !== undefined) { - obj.utcOffsetMinutes = Math.round(message.utcOffsetMinutes); - } - if (message.animatedWebpSupport !== undefined) { - obj.animatedWebpSupport = message.animatedWebpSupport; - } - if (message.kidsAppInfo !== undefined) { - obj.kidsAppInfo = ClientInfo_KidsAppInfo.toJSON(message.kidsAppInfo); - } - if (message.musicAppInfo !== undefined) { - obj.musicAppInfo = ClientInfo_MusicAppInfo.toJSON(message.musicAppInfo); - } - if (message.tvAppInfo !== undefined) { - obj.tvAppInfo = ClientInfo_TvAppInfo.toJSON(message.tvAppInfo); - } - if (message.internalGeoIp !== undefined) { - obj.internalGeoIp = message.internalGeoIp; - } - if (message.unpluggedAppInfo !== undefined) { - obj.unpluggedAppInfo = ClientInfo_UnpluggedAppInfo.toJSON(message.unpluggedAppInfo); - } - if (message.locationInfo !== undefined) { - obj.locationInfo = ClientInfo_LocationInfo.toJSON(message.locationInfo); - } - if (message.contentSizeCategory !== undefined) { - obj.contentSizeCategory = message.contentSizeCategory; - } - if (message.fontScale !== undefined) { - obj.fontScale = message.fontScale; - } - if (message.userInterfaceTheme !== undefined) { - obj.userInterfaceTheme = clientInfo_UserInterfaceThemeToJSON(message.userInterfaceTheme); - } - if (message.timeZone !== undefined) { - obj.timeZone = message.timeZone; - } - if (message.homeGroupInfo !== undefined) { - obj.homeGroupInfo = ClientInfo_HomeGroupInfo.toJSON(message.homeGroupInfo); - } - if (message.emlTemplateContext !== undefined) { - obj.emlTemplateContext = base64FromBytes(message.emlTemplateContext); - } - if (message.coldAppBundleConfigData !== undefined) { - obj.coldAppBundleConfigData = base64FromBytes(message.coldAppBundleConfigData); - } - if (message.browserName !== undefined) { - obj.browserName = message.browserName; - } - if (message.browserVersion !== undefined) { - obj.browserVersion = message.browserVersion; - } - if (message.locationPlayabilityToken !== undefined) { - obj.locationPlayabilityToken = message.locationPlayabilityToken; - } - if (message.chipset !== undefined) { - obj.chipset = message.chipset; - } - if (message.firmwareVersion !== undefined) { - obj.firmwareVersion = message.firmwareVersion; - } - if (message.memoryTotalKbytes !== undefined) { - obj.memoryTotalKbytes = Math.round(message.memoryTotalKbytes); - } - if (message.mainAppWebInfo !== undefined) { - obj.mainAppWebInfo = ClientInfo_MainAppWebInfo.toJSON(message.mainAppWebInfo); - } - if (message.notificationPermissionInfo !== undefined) { - obj.notificationPermissionInfo = ClientInfo_NotificationPermissionInfo.toJSON(message.notificationPermissionInfo); - } - if (message.deviceBrand !== undefined) { - obj.deviceBrand = message.deviceBrand; - } - if (message.glDeviceInfo !== undefined) { - obj.glDeviceInfo = ClientInfo_GLDeviceInfo.toJSON(message.glDeviceInfo); - } - return obj; - }, - - create, I>>(base?: I): ClientInfo { - return ClientInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo { - const message = createBaseClientInfo(); - message.hl = object.hl ?? undefined; - message.gl = object.gl ?? undefined; - message.remoteHost = object.remoteHost ?? undefined; - message.deviceId = object.deviceId ?? undefined; - message.debugDeviceIdOverride = object.debugDeviceIdOverride ?? undefined; - message.carrierGeo = object.carrierGeo ?? undefined; - message.crackedHl = object.crackedHl ?? undefined; - message.deviceMake = object.deviceMake ?? undefined; - message.deviceModel = object.deviceModel ?? undefined; - message.visitorData = object.visitorData ?? undefined; - message.userAgent = object.userAgent ?? undefined; - message.clientName = object.clientName ?? undefined; - message.clientVersion = object.clientVersion ?? undefined; - message.osName = object.osName ?? undefined; - message.osVersion = object.osVersion ?? undefined; - message.projectId = object.projectId ?? undefined; - message.acceptLanguage = object.acceptLanguage ?? undefined; - message.acceptRegion = object.acceptRegion ?? undefined; - message.originalUrl = object.originalUrl ?? undefined; - message.rawDeviceId = object.rawDeviceId ?? undefined; - message.configData = object.configData ?? undefined; - message.spacecastToken = object.spacecastToken ?? undefined; - message.internalGeo = object.internalGeo ?? undefined; - message.screenWidthPoints = object.screenWidthPoints ?? undefined; - message.screenHeightPoints = object.screenHeightPoints ?? undefined; - message.screenWidthInches = object.screenWidthInches ?? undefined; - message.screenHeightInches = object.screenHeightInches ?? undefined; - message.screenPixelDensity = object.screenPixelDensity ?? undefined; - message.platform = object.platform ?? undefined; - message.spacecastClientInfo = (object.spacecastClientInfo !== undefined && object.spacecastClientInfo !== null) - ? ClientInfo_SpacecastClientInfo.fromPartial(object.spacecastClientInfo) - : undefined; - message.clientFormFactor = object.clientFormFactor ?? undefined; - message.forwardedFor = object.forwardedFor ?? undefined; - message.mobileDataPlanInfo = (object.mobileDataPlanInfo !== undefined && object.mobileDataPlanInfo !== null) - ? ClientInfo_MobileDataPlanInfo.fromPartial(object.mobileDataPlanInfo) - : undefined; - message.gmscoreVersionCode = object.gmscoreVersionCode ?? undefined; - message.webpSupport = object.webpSupport ?? undefined; - message.cameraType = object.cameraType ?? undefined; - message.experimentsToken = object.experimentsToken ?? undefined; - message.windowWidthPoints = object.windowWidthPoints ?? undefined; - message.windowHeightPoints = object.windowHeightPoints ?? undefined; - message.configInfo = (object.configInfo !== undefined && object.configInfo !== null) - ? ClientInfo_ConfigGroupsClientInfo.fromPartial(object.configInfo) - : undefined; - message.unpluggedLocationInfo = - (object.unpluggedLocationInfo !== undefined && object.unpluggedLocationInfo !== null) - ? ClientInfo_UnpluggedLocationInfo.fromPartial(object.unpluggedLocationInfo) - : undefined; - message.androidSdkVersion = object.androidSdkVersion ?? undefined; - message.screenDensityFloat = object.screenDensityFloat ?? undefined; - message.firstTimeSignInExperimentIds = object.firstTimeSignInExperimentIds ?? undefined; - message.utcOffsetMinutes = object.utcOffsetMinutes ?? undefined; - message.animatedWebpSupport = object.animatedWebpSupport ?? undefined; - message.kidsAppInfo = (object.kidsAppInfo !== undefined && object.kidsAppInfo !== null) - ? ClientInfo_KidsAppInfo.fromPartial(object.kidsAppInfo) - : undefined; - message.musicAppInfo = (object.musicAppInfo !== undefined && object.musicAppInfo !== null) - ? ClientInfo_MusicAppInfo.fromPartial(object.musicAppInfo) - : undefined; - message.tvAppInfo = (object.tvAppInfo !== undefined && object.tvAppInfo !== null) - ? ClientInfo_TvAppInfo.fromPartial(object.tvAppInfo) - : undefined; - message.internalGeoIp = object.internalGeoIp ?? undefined; - message.unpluggedAppInfo = (object.unpluggedAppInfo !== undefined && object.unpluggedAppInfo !== null) - ? ClientInfo_UnpluggedAppInfo.fromPartial(object.unpluggedAppInfo) - : undefined; - message.locationInfo = (object.locationInfo !== undefined && object.locationInfo !== null) - ? ClientInfo_LocationInfo.fromPartial(object.locationInfo) - : undefined; - message.contentSizeCategory = object.contentSizeCategory ?? undefined; - message.fontScale = object.fontScale ?? undefined; - message.userInterfaceTheme = object.userInterfaceTheme ?? undefined; - message.timeZone = object.timeZone ?? undefined; - message.homeGroupInfo = (object.homeGroupInfo !== undefined && object.homeGroupInfo !== null) - ? ClientInfo_HomeGroupInfo.fromPartial(object.homeGroupInfo) - : undefined; - message.emlTemplateContext = object.emlTemplateContext ?? undefined; - message.coldAppBundleConfigData = object.coldAppBundleConfigData ?? undefined; - message.browserName = object.browserName ?? undefined; - message.browserVersion = object.browserVersion ?? undefined; - message.locationPlayabilityToken = object.locationPlayabilityToken ?? undefined; - message.chipset = object.chipset ?? undefined; - message.firmwareVersion = object.firmwareVersion ?? undefined; - message.memoryTotalKbytes = object.memoryTotalKbytes ?? undefined; - message.mainAppWebInfo = (object.mainAppWebInfo !== undefined && object.mainAppWebInfo !== null) - ? ClientInfo_MainAppWebInfo.fromPartial(object.mainAppWebInfo) - : undefined; - message.notificationPermissionInfo = - (object.notificationPermissionInfo !== undefined && object.notificationPermissionInfo !== null) - ? ClientInfo_NotificationPermissionInfo.fromPartial(object.notificationPermissionInfo) - : undefined; - message.deviceBrand = object.deviceBrand ?? undefined; - message.glDeviceInfo = (object.glDeviceInfo !== undefined && object.glDeviceInfo !== null) - ? ClientInfo_GLDeviceInfo.fromPartial(object.glDeviceInfo) - : undefined; - return message; - }, }; function createBaseClientInfo_MainAppWebInfo(): ClientInfo_MainAppWebInfo { @@ -2209,61 +1229,6 @@ export const ClientInfo_MainAppWebInfo: MessageFns = } return message; }, - - fromJSON(object: any): ClientInfo_MainAppWebInfo { - return { - graftUrl: isSet(object.graftUrl) ? globalThis.String(object.graftUrl) : undefined, - pwaInstallabilityStatus: isSet(object.pwaInstallabilityStatus) - ? clientInfo_MainAppWebInfo_PwaInstallabilityStatusFromJSON(object.pwaInstallabilityStatus) - : undefined, - webDisplayMode: isSet(object.webDisplayMode) - ? clientInfo_MainAppWebInfo_WebDisplayModeFromJSON(object.webDisplayMode) - : undefined, - isWebNativeShareAvailable: isSet(object.isWebNativeShareAvailable) - ? globalThis.Boolean(object.isWebNativeShareAvailable) - : undefined, - storeDigitalGoodsApiSupportStatus: isSet(object.storeDigitalGoodsApiSupportStatus) - ? clientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatusFromJSON(object.storeDigitalGoodsApiSupportStatus) - : undefined, - }; - }, - - toJSON(message: ClientInfo_MainAppWebInfo): unknown { - const obj: any = {}; - if (message.graftUrl !== undefined) { - obj.graftUrl = message.graftUrl; - } - if (message.pwaInstallabilityStatus !== undefined) { - obj.pwaInstallabilityStatus = clientInfo_MainAppWebInfo_PwaInstallabilityStatusToJSON( - message.pwaInstallabilityStatus, - ); - } - if (message.webDisplayMode !== undefined) { - obj.webDisplayMode = clientInfo_MainAppWebInfo_WebDisplayModeToJSON(message.webDisplayMode); - } - if (message.isWebNativeShareAvailable !== undefined) { - obj.isWebNativeShareAvailable = message.isWebNativeShareAvailable; - } - if (message.storeDigitalGoodsApiSupportStatus !== undefined) { - obj.storeDigitalGoodsApiSupportStatus = clientInfo_MainAppWebInfo_StoreDigitalGoodsApiSupportStatusToJSON( - message.storeDigitalGoodsApiSupportStatus, - ); - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_MainAppWebInfo { - return ClientInfo_MainAppWebInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_MainAppWebInfo { - const message = createBaseClientInfo_MainAppWebInfo(); - message.graftUrl = object.graftUrl ?? undefined; - message.pwaInstallabilityStatus = object.pwaInstallabilityStatus ?? undefined; - message.webDisplayMode = object.webDisplayMode ?? undefined; - message.isWebNativeShareAvailable = object.isWebNativeShareAvailable ?? undefined; - message.storeDigitalGoodsApiSupportStatus = object.storeDigitalGoodsApiSupportStatus ?? undefined; - return message; - }, }; function createBaseClientInfo_NotificationPermissionInfo(): ClientInfo_NotificationPermissionInfo { @@ -2310,44 +1275,6 @@ export const ClientInfo_NotificationPermissionInfo: MessageFns, I>>( - base?: I, - ): ClientInfo_NotificationPermissionInfo { - return ClientInfo_NotificationPermissionInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_NotificationPermissionInfo { - const message = createBaseClientInfo_NotificationPermissionInfo(); - message.notificationsSetting = object.notificationsSetting ?? undefined; - message.lastDeviceOptInChangeTimeAgoSec = object.lastDeviceOptInChangeTimeAgoSec ?? undefined; - return message; - }, }; function createBaseClientInfo_GLDeviceInfo(): ClientInfo_GLDeviceInfo { @@ -2404,39 +1331,6 @@ export const ClientInfo_GLDeviceInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo_GLDeviceInfo { - return { - glRenderer: isSet(object.glRenderer) ? globalThis.String(object.glRenderer) : undefined, - glEsVersionMajor: isSet(object.glEsVersionMajor) ? globalThis.Number(object.glEsVersionMajor) : undefined, - glEsVersionMinor: isSet(object.glEsVersionMinor) ? globalThis.Number(object.glEsVersionMinor) : undefined, - }; - }, - - toJSON(message: ClientInfo_GLDeviceInfo): unknown { - const obj: any = {}; - if (message.glRenderer !== undefined) { - obj.glRenderer = message.glRenderer; - } - if (message.glEsVersionMajor !== undefined) { - obj.glEsVersionMajor = Math.round(message.glEsVersionMajor); - } - if (message.glEsVersionMinor !== undefined) { - obj.glEsVersionMinor = Math.round(message.glEsVersionMinor); - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_GLDeviceInfo { - return ClientInfo_GLDeviceInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_GLDeviceInfo { - const message = createBaseClientInfo_GLDeviceInfo(); - message.glRenderer = object.glRenderer ?? undefined; - message.glEsVersionMajor = object.glEsVersionMajor ?? undefined; - message.glEsVersionMinor = object.glEsVersionMinor ?? undefined; - return message; - }, }; function createBaseClientInfo_SpacecastClientInfo(): ClientInfo_SpacecastClientInfo { @@ -2483,42 +1377,6 @@ export const ClientInfo_SpacecastClientInfo: MessageFns, I>>(base?: I): ClientInfo_SpacecastClientInfo { - return ClientInfo_SpacecastClientInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_SpacecastClientInfo { - const message = createBaseClientInfo_SpacecastClientInfo(); - message.appliances = (object.appliances !== undefined && object.appliances !== null) - ? ClientInfo_SpacecastClientInfo_SpacecastAppliance.fromPartial(object.appliances) - : undefined; - message.interactionLevel = object.interactionLevel ?? undefined; - return message; - }, }; function createBaseClientInfo_SpacecastClientInfo_SpacecastAppliance(): ClientInfo_SpacecastClientInfo_SpacecastAppliance { @@ -2606,55 +1464,6 @@ export const ClientInfo_SpacecastClientInfo_SpacecastAppliance: MessageFns< } return message; }, - - fromJSON(object: any): ClientInfo_SpacecastClientInfo_SpacecastAppliance { - return { - contentProfileToken: isSet(object.contentProfileToken) ? bytesFromBase64(object.contentProfileToken) : undefined, - status: isSet(object.status) - ? clientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatusFromJSON(object.status) - : undefined, - hostname: isSet(object.hostname) ? globalThis.String(object.hostname) : undefined, - active: isSet(object.active) ? globalThis.Boolean(object.active) : undefined, - deviceId: isSet(object.deviceId) ? globalThis.String(object.deviceId) : undefined, - }; - }, - - toJSON(message: ClientInfo_SpacecastClientInfo_SpacecastAppliance): unknown { - const obj: any = {}; - if (message.contentProfileToken !== undefined) { - obj.contentProfileToken = base64FromBytes(message.contentProfileToken); - } - if (message.status !== undefined) { - obj.status = clientInfo_SpacecastClientInfo_SpacecastAppliance_OperationalStatusToJSON(message.status); - } - if (message.hostname !== undefined) { - obj.hostname = message.hostname; - } - if (message.active !== undefined) { - obj.active = message.active; - } - if (message.deviceId !== undefined) { - obj.deviceId = message.deviceId; - } - return obj; - }, - - create, I>>( - base?: I, - ): ClientInfo_SpacecastClientInfo_SpacecastAppliance { - return ClientInfo_SpacecastClientInfo_SpacecastAppliance.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_SpacecastClientInfo_SpacecastAppliance { - const message = createBaseClientInfo_SpacecastClientInfo_SpacecastAppliance(); - message.contentProfileToken = object.contentProfileToken ?? undefined; - message.status = object.status ?? undefined; - message.hostname = object.hostname ?? undefined; - message.active = object.active ?? undefined; - message.deviceId = object.deviceId ?? undefined; - return message; - }, }; function createBaseClientInfo_MobileDataPlanInfo(): ClientInfo_MobileDataPlanInfo { @@ -2726,50 +1535,6 @@ export const ClientInfo_MobileDataPlanInfo: MessageFns, I>>(base?: I): ClientInfo_MobileDataPlanInfo { - return ClientInfo_MobileDataPlanInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_MobileDataPlanInfo { - const message = createBaseClientInfo_MobileDataPlanInfo(); - message.cpid = object.cpid ?? undefined; - message.serializedDataPlanStatus = object.serializedDataPlanStatus ?? undefined; - message.dataSavingQualityPickerEnabled = object.dataSavingQualityPickerEnabled ?? undefined; - message.mccmnc = object.mccmnc ?? undefined; - return message; - }, }; function createBaseClientInfo_ConfigGroupsClientInfo(): ClientInfo_ConfigGroupsClientInfo { @@ -2836,48 +1601,6 @@ export const ClientInfo_ConfigGroupsClientInfo: MessageFns, I>>( - base?: I, - ): ClientInfo_ConfigGroupsClientInfo { - return ClientInfo_ConfigGroupsClientInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_ConfigGroupsClientInfo { - const message = createBaseClientInfo_ConfigGroupsClientInfo(); - message.coldConfigData = object.coldConfigData ?? undefined; - message.coldHashData = object.coldHashData ?? undefined; - message.hotHashData = object.hotHashData ?? undefined; - message.appInstallData = object.appInstallData ?? undefined; - return message; - }, }; function createBaseClientInfo_UnpluggedLocationInfo(): ClientInfo_UnpluggedLocationInfo { @@ -3026,91 +1749,6 @@ export const ClientInfo_UnpluggedLocationInfo: MessageFns, I>>( - base?: I, - ): ClientInfo_UnpluggedLocationInfo { - return ClientInfo_UnpluggedLocationInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_UnpluggedLocationInfo { - const message = createBaseClientInfo_UnpluggedLocationInfo(); - message.latitudeE7 = object.latitudeE7 ?? undefined; - message.longitudeE7 = object.longitudeE7 ?? undefined; - message.localTimestampMs = object.localTimestampMs ?? undefined; - message.ipAddress = object.ipAddress ?? undefined; - message.timezone = object.timezone ?? undefined; - message.prefer24HourTime = object.prefer24HourTime ?? undefined; - message.locationRadiusMeters = object.locationRadiusMeters ?? undefined; - message.isInitialLoad = object.isInitialLoad ?? undefined; - message.browserPermissionGranted = object.browserPermissionGranted ?? undefined; - message.clientPermissionState = object.clientPermissionState ?? undefined; - message.locationOverrideToken = object.locationOverrideToken ?? undefined; - return message; - }, }; function createBaseClientInfo_KidsAppInfo(): ClientInfo_KidsAppInfo { @@ -3186,61 +1824,6 @@ export const ClientInfo_KidsAppInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo_KidsAppInfo { - return { - contentSettings: isSet(object.contentSettings) - ? ClientInfo_KidsAppInfo_KidsContentSettings.fromJSON(object.contentSettings) - : undefined, - parentCurationMode: isSet(object.parentCurationMode) - ? clientInfo_KidsAppInfo_KidsParentCurationModeFromJSON(object.parentCurationMode) - : undefined, - categorySettings: isSet(object.categorySettings) - ? ClientInfo_KidsAppInfo_KidsCategorySettings.fromJSON(object.categorySettings) - : undefined, - userEducationSettings: isSet(object.userEducationSettings) - ? ClientInfo_KidsAppInfo_KidsUserEducationSettings.fromJSON(object.userEducationSettings) - : undefined, - }; - }, - - toJSON(message: ClientInfo_KidsAppInfo): unknown { - const obj: any = {}; - if (message.contentSettings !== undefined) { - obj.contentSettings = ClientInfo_KidsAppInfo_KidsContentSettings.toJSON(message.contentSettings); - } - if (message.parentCurationMode !== undefined) { - obj.parentCurationMode = clientInfo_KidsAppInfo_KidsParentCurationModeToJSON(message.parentCurationMode); - } - if (message.categorySettings !== undefined) { - obj.categorySettings = ClientInfo_KidsAppInfo_KidsCategorySettings.toJSON(message.categorySettings); - } - if (message.userEducationSettings !== undefined) { - obj.userEducationSettings = ClientInfo_KidsAppInfo_KidsUserEducationSettings.toJSON( - message.userEducationSettings, - ); - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_KidsAppInfo { - return ClientInfo_KidsAppInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_KidsAppInfo { - const message = createBaseClientInfo_KidsAppInfo(); - message.contentSettings = (object.contentSettings !== undefined && object.contentSettings !== null) - ? ClientInfo_KidsAppInfo_KidsContentSettings.fromPartial(object.contentSettings) - : undefined; - message.parentCurationMode = object.parentCurationMode ?? undefined; - message.categorySettings = (object.categorySettings !== undefined && object.categorySettings !== null) - ? ClientInfo_KidsAppInfo_KidsCategorySettings.fromPartial(object.categorySettings) - : undefined; - message.userEducationSettings = - (object.userEducationSettings !== undefined && object.userEducationSettings !== null) - ? ClientInfo_KidsAppInfo_KidsUserEducationSettings.fromPartial(object.userEducationSettings) - : undefined; - return message; - }, }; function createBaseClientInfo_KidsAppInfo_KidsContentSettings(): ClientInfo_KidsAppInfo_KidsContentSettings { @@ -3297,51 +1880,6 @@ export const ClientInfo_KidsAppInfo_KidsContentSettings: MessageFns, I>>( - base?: I, - ): ClientInfo_KidsAppInfo_KidsContentSettings { - return ClientInfo_KidsAppInfo_KidsContentSettings.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_KidsAppInfo_KidsContentSettings { - const message = createBaseClientInfo_KidsAppInfo_KidsContentSettings(); - message.kidsNoSearchMode = object.kidsNoSearchMode ?? undefined; - message.ageUpMode = object.ageUpMode ?? undefined; - message.contentDensity = object.contentDensity ?? undefined; - return message; - }, }; function createBaseClientInfo_KidsAppInfo_KidsCategorySettings(): ClientInfo_KidsAppInfo_KidsCategorySettings { @@ -3381,33 +1919,6 @@ export const ClientInfo_KidsAppInfo_KidsCategorySettings: MessageFns, I>>( - base?: I, - ): ClientInfo_KidsAppInfo_KidsCategorySettings { - return ClientInfo_KidsAppInfo_KidsCategorySettings.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_KidsAppInfo_KidsCategorySettings { - const message = createBaseClientInfo_KidsAppInfo_KidsCategorySettings(); - message.enabledCategories = object.enabledCategories ?? undefined; - return message; - }, }; function createBaseClientInfo_KidsAppInfo_KidsUserEducationSettings(): ClientInfo_KidsAppInfo_KidsUserEducationSettings { @@ -3473,49 +1984,6 @@ export const ClientInfo_KidsAppInfo_KidsUserEducationSettings: MessageFns< } return message; }, - - fromJSON(object: any): ClientInfo_KidsAppInfo_KidsUserEducationSettings { - return { - hasSeenHomeChipBarUserEducation: isSet(object.hasSeenHomeChipBarUserEducation) - ? globalThis.Boolean(object.hasSeenHomeChipBarUserEducation) - : undefined, - hasSeenHomePivotBarUserEducation: isSet(object.hasSeenHomePivotBarUserEducation) - ? globalThis.Boolean(object.hasSeenHomePivotBarUserEducation) - : undefined, - hasSeenParentMuirUserEducation: isSet(object.hasSeenParentMuirUserEducation) - ? globalThis.Boolean(object.hasSeenParentMuirUserEducation) - : undefined, - }; - }, - - toJSON(message: ClientInfo_KidsAppInfo_KidsUserEducationSettings): unknown { - const obj: any = {}; - if (message.hasSeenHomeChipBarUserEducation !== undefined) { - obj.hasSeenHomeChipBarUserEducation = message.hasSeenHomeChipBarUserEducation; - } - if (message.hasSeenHomePivotBarUserEducation !== undefined) { - obj.hasSeenHomePivotBarUserEducation = message.hasSeenHomePivotBarUserEducation; - } - if (message.hasSeenParentMuirUserEducation !== undefined) { - obj.hasSeenParentMuirUserEducation = message.hasSeenParentMuirUserEducation; - } - return obj; - }, - - create, I>>( - base?: I, - ): ClientInfo_KidsAppInfo_KidsUserEducationSettings { - return ClientInfo_KidsAppInfo_KidsUserEducationSettings.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_KidsAppInfo_KidsUserEducationSettings { - const message = createBaseClientInfo_KidsAppInfo_KidsUserEducationSettings(); - message.hasSeenHomeChipBarUserEducation = object.hasSeenHomeChipBarUserEducation ?? undefined; - message.hasSeenHomePivotBarUserEducation = object.hasSeenHomePivotBarUserEducation ?? undefined; - message.hasSeenParentMuirUserEducation = object.hasSeenParentMuirUserEducation ?? undefined; - return message; - }, }; function createBaseClientInfo_MusicAppInfo(): ClientInfo_MusicAppInfo { @@ -3686,121 +2154,6 @@ export const ClientInfo_MusicAppInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo_MusicAppInfo { - return { - playBackMode: isSet(object.playBackMode) - ? clientInfo_MusicAppInfo_MusicPlayBackModeFromJSON(object.playBackMode) - : undefined, - musicLocationMasterSwitch: isSet(object.musicLocationMasterSwitch) - ? clientInfo_MusicAppInfo_MusicLocationMasterSwitchFromJSON(object.musicLocationMasterSwitch) - : undefined, - musicActivityMasterSwitch: isSet(object.musicActivityMasterSwitch) - ? clientInfo_MusicAppInfo_MusicActivityMasterSwitchFromJSON(object.musicActivityMasterSwitch) - : undefined, - offlineMixtapeEnabled: isSet(object.offlineMixtapeEnabled) - ? globalThis.Boolean(object.offlineMixtapeEnabled) - : undefined, - autoOfflineEnabled: isSet(object.autoOfflineEnabled) ? globalThis.Boolean(object.autoOfflineEnabled) : undefined, - iosBackgroundRefreshStatus: isSet(object.iosBackgroundRefreshStatus) - ? clientInfo_MusicAppInfo_IosBackgroundRefreshStatusFromJSON(object.iosBackgroundRefreshStatus) - : undefined, - smartDownloadsSongLimit: isSet(object.smartDownloadsSongLimit) - ? globalThis.Number(object.smartDownloadsSongLimit) - : undefined, - transitionedFromMixtapeToSmartDownloads: isSet(object.transitionedFromMixtapeToSmartDownloads) - ? globalThis.Boolean(object.transitionedFromMixtapeToSmartDownloads) - : undefined, - pwaInstallabilityStatus: isSet(object.pwaInstallabilityStatus) - ? clientInfo_MusicAppInfo_PwaInstallabilityStatusFromJSON(object.pwaInstallabilityStatus) - : undefined, - webDisplayMode: isSet(object.webDisplayMode) - ? clientInfo_MusicAppInfo_WebDisplayModeFromJSON(object.webDisplayMode) - : undefined, - musicTier: isSet(object.musicTier) ? clientInfo_MusicAppInfo_MusicTierFromJSON(object.musicTier) : undefined, - storeDigitalGoodsApiSupportStatus: isSet(object.storeDigitalGoodsApiSupportStatus) - ? clientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatusFromJSON(object.storeDigitalGoodsApiSupportStatus) - : undefined, - smartDownloadsTimeSinceLastOptOutSec: isSet(object.smartDownloadsTimeSinceLastOptOutSec) - ? globalThis.Number(object.smartDownloadsTimeSinceLastOptOutSec) - : undefined, - }; - }, - - toJSON(message: ClientInfo_MusicAppInfo): unknown { - const obj: any = {}; - if (message.playBackMode !== undefined) { - obj.playBackMode = clientInfo_MusicAppInfo_MusicPlayBackModeToJSON(message.playBackMode); - } - if (message.musicLocationMasterSwitch !== undefined) { - obj.musicLocationMasterSwitch = clientInfo_MusicAppInfo_MusicLocationMasterSwitchToJSON( - message.musicLocationMasterSwitch, - ); - } - if (message.musicActivityMasterSwitch !== undefined) { - obj.musicActivityMasterSwitch = clientInfo_MusicAppInfo_MusicActivityMasterSwitchToJSON( - message.musicActivityMasterSwitch, - ); - } - if (message.offlineMixtapeEnabled !== undefined) { - obj.offlineMixtapeEnabled = message.offlineMixtapeEnabled; - } - if (message.autoOfflineEnabled !== undefined) { - obj.autoOfflineEnabled = message.autoOfflineEnabled; - } - if (message.iosBackgroundRefreshStatus !== undefined) { - obj.iosBackgroundRefreshStatus = clientInfo_MusicAppInfo_IosBackgroundRefreshStatusToJSON( - message.iosBackgroundRefreshStatus, - ); - } - if (message.smartDownloadsSongLimit !== undefined) { - obj.smartDownloadsSongLimit = Math.round(message.smartDownloadsSongLimit); - } - if (message.transitionedFromMixtapeToSmartDownloads !== undefined) { - obj.transitionedFromMixtapeToSmartDownloads = message.transitionedFromMixtapeToSmartDownloads; - } - if (message.pwaInstallabilityStatus !== undefined) { - obj.pwaInstallabilityStatus = clientInfo_MusicAppInfo_PwaInstallabilityStatusToJSON( - message.pwaInstallabilityStatus, - ); - } - if (message.webDisplayMode !== undefined) { - obj.webDisplayMode = clientInfo_MusicAppInfo_WebDisplayModeToJSON(message.webDisplayMode); - } - if (message.musicTier !== undefined) { - obj.musicTier = clientInfo_MusicAppInfo_MusicTierToJSON(message.musicTier); - } - if (message.storeDigitalGoodsApiSupportStatus !== undefined) { - obj.storeDigitalGoodsApiSupportStatus = clientInfo_MusicAppInfo_StoreDigitalGoodsApiSupportStatusToJSON( - message.storeDigitalGoodsApiSupportStatus, - ); - } - if (message.smartDownloadsTimeSinceLastOptOutSec !== undefined) { - obj.smartDownloadsTimeSinceLastOptOutSec = Math.round(message.smartDownloadsTimeSinceLastOptOutSec); - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_MusicAppInfo { - return ClientInfo_MusicAppInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_MusicAppInfo { - const message = createBaseClientInfo_MusicAppInfo(); - message.playBackMode = object.playBackMode ?? undefined; - message.musicLocationMasterSwitch = object.musicLocationMasterSwitch ?? undefined; - message.musicActivityMasterSwitch = object.musicActivityMasterSwitch ?? undefined; - message.offlineMixtapeEnabled = object.offlineMixtapeEnabled ?? undefined; - message.autoOfflineEnabled = object.autoOfflineEnabled ?? undefined; - message.iosBackgroundRefreshStatus = object.iosBackgroundRefreshStatus ?? undefined; - message.smartDownloadsSongLimit = object.smartDownloadsSongLimit ?? undefined; - message.transitionedFromMixtapeToSmartDownloads = object.transitionedFromMixtapeToSmartDownloads ?? undefined; - message.pwaInstallabilityStatus = object.pwaInstallabilityStatus ?? undefined; - message.webDisplayMode = object.webDisplayMode ?? undefined; - message.musicTier = object.musicTier ?? undefined; - message.storeDigitalGoodsApiSupportStatus = object.storeDigitalGoodsApiSupportStatus ?? undefined; - message.smartDownloadsTimeSinceLastOptOutSec = object.smartDownloadsTimeSinceLastOptOutSec ?? undefined; - return message; - }, }; function createBaseClientInfo_TvAppInfo(): ClientInfo_TvAppInfo { @@ -3982,114 +2335,6 @@ export const ClientInfo_TvAppInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo_TvAppInfo { - return { - mdxImpactedSessionsServerEvents: isSet(object.mdxImpactedSessionsServerEvents) - ? globalThis.String(object.mdxImpactedSessionsServerEvents) - : undefined, - enablePrivacyFilter: isSet(object.enablePrivacyFilter) - ? globalThis.Boolean(object.enablePrivacyFilter) - : undefined, - zylonLeftNav: isSet(object.zylonLeftNav) ? globalThis.Boolean(object.zylonLeftNav) : undefined, - certificationScope: isSet(object.certificationScope) ? globalThis.String(object.certificationScope) : undefined, - livingRoomPoTokenId: isSet(object.livingRoomPoTokenId) - ? globalThis.String(object.livingRoomPoTokenId) - : undefined, - jsEngineString: isSet(object.jsEngineString) ? globalThis.String(object.jsEngineString) : undefined, - voiceCapability: isSet(object.voiceCapability) - ? ClientInfo_TvAppInfo_VoiceCapability.fromJSON(object.voiceCapability) - : undefined, - systemIntegrator: isSet(object.systemIntegrator) ? globalThis.String(object.systemIntegrator) : undefined, - androidBuildFingerprint: isSet(object.androidBuildFingerprint) - ? globalThis.String(object.androidBuildFingerprint) - : undefined, - cobaltAppVersion: isSet(object.cobaltAppVersion) ? globalThis.String(object.cobaltAppVersion) : undefined, - cobaltStarboardVersion: isSet(object.cobaltStarboardVersion) - ? globalThis.String(object.cobaltStarboardVersion) - : undefined, - useStartPlaybackPreviewCommand: isSet(object.useStartPlaybackPreviewCommand) - ? globalThis.Boolean(object.useStartPlaybackPreviewCommand) - : undefined, - shouldShowPersistentSigninOnHome: isSet(object.shouldShowPersistentSigninOnHome) - ? globalThis.Boolean(object.shouldShowPersistentSigninOnHome) - : undefined, - androidPlayServicesVersion: isSet(object.androidPlayServicesVersion) - ? globalThis.String(object.androidPlayServicesVersion) - : undefined, - }; - }, - - toJSON(message: ClientInfo_TvAppInfo): unknown { - const obj: any = {}; - if (message.mdxImpactedSessionsServerEvents !== undefined) { - obj.mdxImpactedSessionsServerEvents = message.mdxImpactedSessionsServerEvents; - } - if (message.enablePrivacyFilter !== undefined) { - obj.enablePrivacyFilter = message.enablePrivacyFilter; - } - if (message.zylonLeftNav !== undefined) { - obj.zylonLeftNav = message.zylonLeftNav; - } - if (message.certificationScope !== undefined) { - obj.certificationScope = message.certificationScope; - } - if (message.livingRoomPoTokenId !== undefined) { - obj.livingRoomPoTokenId = message.livingRoomPoTokenId; - } - if (message.jsEngineString !== undefined) { - obj.jsEngineString = message.jsEngineString; - } - if (message.voiceCapability !== undefined) { - obj.voiceCapability = ClientInfo_TvAppInfo_VoiceCapability.toJSON(message.voiceCapability); - } - if (message.systemIntegrator !== undefined) { - obj.systemIntegrator = message.systemIntegrator; - } - if (message.androidBuildFingerprint !== undefined) { - obj.androidBuildFingerprint = message.androidBuildFingerprint; - } - if (message.cobaltAppVersion !== undefined) { - obj.cobaltAppVersion = message.cobaltAppVersion; - } - if (message.cobaltStarboardVersion !== undefined) { - obj.cobaltStarboardVersion = message.cobaltStarboardVersion; - } - if (message.useStartPlaybackPreviewCommand !== undefined) { - obj.useStartPlaybackPreviewCommand = message.useStartPlaybackPreviewCommand; - } - if (message.shouldShowPersistentSigninOnHome !== undefined) { - obj.shouldShowPersistentSigninOnHome = message.shouldShowPersistentSigninOnHome; - } - if (message.androidPlayServicesVersion !== undefined) { - obj.androidPlayServicesVersion = message.androidPlayServicesVersion; - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_TvAppInfo { - return ClientInfo_TvAppInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_TvAppInfo { - const message = createBaseClientInfo_TvAppInfo(); - message.mdxImpactedSessionsServerEvents = object.mdxImpactedSessionsServerEvents ?? undefined; - message.enablePrivacyFilter = object.enablePrivacyFilter ?? undefined; - message.zylonLeftNav = object.zylonLeftNav ?? undefined; - message.certificationScope = object.certificationScope ?? undefined; - message.livingRoomPoTokenId = object.livingRoomPoTokenId ?? undefined; - message.jsEngineString = object.jsEngineString ?? undefined; - message.voiceCapability = (object.voiceCapability !== undefined && object.voiceCapability !== null) - ? ClientInfo_TvAppInfo_VoiceCapability.fromPartial(object.voiceCapability) - : undefined; - message.systemIntegrator = object.systemIntegrator ?? undefined; - message.androidBuildFingerprint = object.androidBuildFingerprint ?? undefined; - message.cobaltAppVersion = object.cobaltAppVersion ?? undefined; - message.cobaltStarboardVersion = object.cobaltStarboardVersion ?? undefined; - message.useStartPlaybackPreviewCommand = object.useStartPlaybackPreviewCommand ?? undefined; - message.shouldShowPersistentSigninOnHome = object.shouldShowPersistentSigninOnHome ?? undefined; - message.androidPlayServicesVersion = object.androidPlayServicesVersion ?? undefined; - return message; - }, }; function createBaseClientInfo_TvAppInfo_VoiceCapability(): ClientInfo_TvAppInfo_VoiceCapability { @@ -4136,38 +2381,6 @@ export const ClientInfo_TvAppInfo_VoiceCapability: MessageFns, I>>( - base?: I, - ): ClientInfo_TvAppInfo_VoiceCapability { - return ClientInfo_TvAppInfo_VoiceCapability.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_TvAppInfo_VoiceCapability { - const message = createBaseClientInfo_TvAppInfo_VoiceCapability(); - message.hasSoftMicSupport = object.hasSoftMicSupport ?? undefined; - message.hasHardMicSupport = object.hasHardMicSupport ?? undefined; - return message; - }, }; function createBaseClientInfo_UnpluggedAppInfo(): ClientInfo_UnpluggedAppInfo { @@ -4224,41 +2437,6 @@ export const ClientInfo_UnpluggedAppInfo: MessageFns, I>>(base?: I): ClientInfo_UnpluggedAppInfo { - return ClientInfo_UnpluggedAppInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_UnpluggedAppInfo { - const message = createBaseClientInfo_UnpluggedAppInfo(); - message.enableFilterMode = object.enableFilterMode ?? undefined; - message.iosNotificationPermission = object.iosNotificationPermission ?? undefined; - message.forceEnableEpg3 = object.forceEnableEpg3 ?? undefined; - return message; - }, }; function createBaseClientInfo_LocationInfo(): ClientInfo_LocationInfo { @@ -4385,81 +2563,6 @@ export const ClientInfo_LocationInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo_LocationInfo { - return { - locationInfoStatus: isSet(object.locationInfoStatus) ? globalThis.Number(object.locationInfoStatus) : undefined, - ulrStatus: isSet(object.ulrStatus) ? ClientInfo_LocationInfo_UrlStatus.fromJSON(object.ulrStatus) : undefined, - latitudeE7: isSet(object.latitudeE7) ? globalThis.String(object.latitudeE7) : undefined, - longitudeE7: isSet(object.longitudeE7) ? globalThis.String(object.longitudeE7) : undefined, - horizontalAccuracyMeters: isSet(object.horizontalAccuracyMeters) - ? globalThis.String(object.horizontalAccuracyMeters) - : undefined, - locationFreshnessMs: isSet(object.locationFreshnessMs) - ? globalThis.String(object.locationFreshnessMs) - : undefined, - locationPermissionAuthorizationStatus: isSet(object.locationPermissionAuthorizationStatus) - ? globalThis.Number(object.locationPermissionAuthorizationStatus) - : undefined, - locationOverrideToken: isSet(object.locationOverrideToken) - ? globalThis.String(object.locationOverrideToken) - : undefined, - forceLocationPlayabilityTokenRefresh: isSet(object.forceLocationPlayabilityTokenRefresh) - ? globalThis.Boolean(object.forceLocationPlayabilityTokenRefresh) - : undefined, - }; - }, - - toJSON(message: ClientInfo_LocationInfo): unknown { - const obj: any = {}; - if (message.locationInfoStatus !== undefined) { - obj.locationInfoStatus = Math.round(message.locationInfoStatus); - } - if (message.ulrStatus !== undefined) { - obj.ulrStatus = ClientInfo_LocationInfo_UrlStatus.toJSON(message.ulrStatus); - } - if (message.latitudeE7 !== undefined) { - obj.latitudeE7 = message.latitudeE7; - } - if (message.longitudeE7 !== undefined) { - obj.longitudeE7 = message.longitudeE7; - } - if (message.horizontalAccuracyMeters !== undefined) { - obj.horizontalAccuracyMeters = message.horizontalAccuracyMeters; - } - if (message.locationFreshnessMs !== undefined) { - obj.locationFreshnessMs = message.locationFreshnessMs; - } - if (message.locationPermissionAuthorizationStatus !== undefined) { - obj.locationPermissionAuthorizationStatus = Math.round(message.locationPermissionAuthorizationStatus); - } - if (message.locationOverrideToken !== undefined) { - obj.locationOverrideToken = message.locationOverrideToken; - } - if (message.forceLocationPlayabilityTokenRefresh !== undefined) { - obj.forceLocationPlayabilityTokenRefresh = message.forceLocationPlayabilityTokenRefresh; - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_LocationInfo { - return ClientInfo_LocationInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_LocationInfo { - const message = createBaseClientInfo_LocationInfo(); - message.locationInfoStatus = object.locationInfoStatus ?? undefined; - message.ulrStatus = (object.ulrStatus !== undefined && object.ulrStatus !== null) - ? ClientInfo_LocationInfo_UrlStatus.fromPartial(object.ulrStatus) - : undefined; - message.latitudeE7 = object.latitudeE7 ?? undefined; - message.longitudeE7 = object.longitudeE7 ?? undefined; - message.horizontalAccuracyMeters = object.horizontalAccuracyMeters ?? undefined; - message.locationFreshnessMs = object.locationFreshnessMs ?? undefined; - message.locationPermissionAuthorizationStatus = object.locationPermissionAuthorizationStatus ?? undefined; - message.locationOverrideToken = object.locationOverrideToken ?? undefined; - message.forceLocationPlayabilityTokenRefresh = object.forceLocationPlayabilityTokenRefresh ?? undefined; - return message; - }, }; function createBaseClientInfo_LocationInfo_UrlStatus(): ClientInfo_LocationInfo_UrlStatus { @@ -4531,52 +2634,6 @@ export const ClientInfo_LocationInfo_UrlStatus: MessageFns, I>>( - base?: I, - ): ClientInfo_LocationInfo_UrlStatus { - return ClientInfo_LocationInfo_UrlStatus.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ClientInfo_LocationInfo_UrlStatus { - const message = createBaseClientInfo_LocationInfo_UrlStatus(); - message.reportingEnabledSetting = object.reportingEnabledSetting ?? undefined; - message.historyEnabledSetting = object.historyEnabledSetting ?? undefined; - message.isAllowed = object.isAllowed ?? undefined; - message.isActive = object.isActive ?? undefined; - return message; - }, }; function createBaseClientInfo_HomeGroupInfo(): ClientInfo_HomeGroupInfo { @@ -4623,65 +2680,8 @@ export const ClientInfo_HomeGroupInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ClientInfo_HomeGroupInfo { - return { - isPartOfGroup: isSet(object.isPartOfGroup) ? globalThis.Boolean(object.isPartOfGroup) : undefined, - isGroup: isSet(object.isGroup) ? globalThis.Boolean(object.isGroup) : undefined, - }; - }, - - toJSON(message: ClientInfo_HomeGroupInfo): unknown { - const obj: any = {}; - if (message.isPartOfGroup !== undefined) { - obj.isPartOfGroup = message.isPartOfGroup; - } - if (message.isGroup !== undefined) { - obj.isGroup = message.isGroup; - } - return obj; - }, - - create, I>>(base?: I): ClientInfo_HomeGroupInfo { - return ClientInfo_HomeGroupInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ClientInfo_HomeGroupInfo { - const message = createBaseClientInfo_HomeGroupInfo(); - message.isPartOfGroup = object.isPartOfGroup ?? undefined; - message.isGroup = object.isGroup ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - function longToNumber(int64: { toString(): string }): number { const num = globalThis.Number(int64.toString()); if (num > globalThis.Number.MAX_SAFE_INTEGER) { @@ -4693,15 +2693,7 @@ function longToNumber(int64: { toString(): string }): number { return num; } -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/get_watch_request.ts b/protos/generated/youtube/api/pfiinnertube/get_watch_request.ts index 30ad1fbf..7e5096ad 100644 --- a/protos/generated/youtube/api/pfiinnertube/get_watch_request.ts +++ b/protos/generated/youtube/api/pfiinnertube/get_watch_request.ts @@ -84,77 +84,9 @@ export const GetWatchRequest: MessageFns = { } return message; }, - - fromJSON(object: any): GetWatchRequest { - return { - context: isSet(object.context) ? InnerTubeContext.fromJSON(object.context) : undefined, - playerRequest: isSet(object.playerRequest) ? PlayerRequest.fromJSON(object.playerRequest) : undefined, - watchNextRequest: isSet(object.watchNextRequest) ? WatchNextRequest.fromJSON(object.watchNextRequest) : undefined, - reelItemWatchRequest: isSet(object.reelItemWatchRequest) - ? ReelItemWatchRequest.fromJSON(object.reelItemWatchRequest) - : undefined, - }; - }, - - toJSON(message: GetWatchRequest): unknown { - const obj: any = {}; - if (message.context !== undefined) { - obj.context = InnerTubeContext.toJSON(message.context); - } - if (message.playerRequest !== undefined) { - obj.playerRequest = PlayerRequest.toJSON(message.playerRequest); - } - if (message.watchNextRequest !== undefined) { - obj.watchNextRequest = WatchNextRequest.toJSON(message.watchNextRequest); - } - if (message.reelItemWatchRequest !== undefined) { - obj.reelItemWatchRequest = ReelItemWatchRequest.toJSON(message.reelItemWatchRequest); - } - return obj; - }, - - create, I>>(base?: I): GetWatchRequest { - return GetWatchRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GetWatchRequest { - const message = createBaseGetWatchRequest(); - message.context = (object.context !== undefined && object.context !== null) - ? InnerTubeContext.fromPartial(object.context) - : undefined; - message.playerRequest = (object.playerRequest !== undefined && object.playerRequest !== null) - ? PlayerRequest.fromPartial(object.playerRequest) - : undefined; - message.watchNextRequest = (object.watchNextRequest !== undefined && object.watchNextRequest !== null) - ? WatchNextRequest.fromPartial(object.watchNextRequest) - : undefined; - message.reelItemWatchRequest = (object.reelItemWatchRequest !== undefined && object.reelItemWatchRequest !== null) - ? ReelItemWatchRequest.fromPartial(object.reelItemWatchRequest) - : undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/innertube_context.ts b/protos/generated/youtube/api/pfiinnertube/innertube_context.ts index 370014d9..6c76b225 100644 --- a/protos/generated/youtube/api/pfiinnertube/innertube_context.ts +++ b/protos/generated/youtube/api/pfiinnertube/innertube_context.ts @@ -197,103 +197,6 @@ export const InnerTubeContext: MessageFns = { } return message; }, - - fromJSON(object: any): InnerTubeContext { - return { - client: isSet(object.client) ? ClientInfo.fromJSON(object.client) : undefined, - user: isSet(object.user) ? UserInfo.fromJSON(object.user) : undefined, - capabilities: isSet(object.capabilities) ? CapabilityInfo.fromJSON(object.capabilities) : undefined, - request: isSet(object.request) ? RequestInfo.fromJSON(object.request) : undefined, - clickTracking: isSet(object.clickTracking) - ? InnerTubeContext_ClickTrackingInfo.fromJSON(object.clickTracking) - : undefined, - thirdParty: isSet(object.thirdParty) ? ThirdPartyInfo.fromJSON(object.thirdParty) : undefined, - remoteClient: isSet(object.remoteClient) ? ClientInfo.fromJSON(object.remoteClient) : undefined, - adSignalsInfo: isSet(object.adSignalsInfo) - ? InnerTubeContext_AdSignalsInfo.fromJSON(object.adSignalsInfo) - : undefined, - experimentalData: isSet(object.experimentalData) - ? InnerTubeContext_ExperimentalData.fromJSON(object.experimentalData) - : undefined, - clientScreenNonce: isSet(object.clientScreenNonce) ? globalThis.String(object.clientScreenNonce) : undefined, - activePlayers: globalThis.Array.isArray(object?.activePlayers) - ? object.activePlayers.map((e: any) => InnerTubeContext_ActivePlayerInfo.fromJSON(e)) - : [], - }; - }, - - toJSON(message: InnerTubeContext): unknown { - const obj: any = {}; - if (message.client !== undefined) { - obj.client = ClientInfo.toJSON(message.client); - } - if (message.user !== undefined) { - obj.user = UserInfo.toJSON(message.user); - } - if (message.capabilities !== undefined) { - obj.capabilities = CapabilityInfo.toJSON(message.capabilities); - } - if (message.request !== undefined) { - obj.request = RequestInfo.toJSON(message.request); - } - if (message.clickTracking !== undefined) { - obj.clickTracking = InnerTubeContext_ClickTrackingInfo.toJSON(message.clickTracking); - } - if (message.thirdParty !== undefined) { - obj.thirdParty = ThirdPartyInfo.toJSON(message.thirdParty); - } - if (message.remoteClient !== undefined) { - obj.remoteClient = ClientInfo.toJSON(message.remoteClient); - } - if (message.adSignalsInfo !== undefined) { - obj.adSignalsInfo = InnerTubeContext_AdSignalsInfo.toJSON(message.adSignalsInfo); - } - if (message.experimentalData !== undefined) { - obj.experimentalData = InnerTubeContext_ExperimentalData.toJSON(message.experimentalData); - } - if (message.clientScreenNonce !== undefined) { - obj.clientScreenNonce = message.clientScreenNonce; - } - if (message.activePlayers?.length) { - obj.activePlayers = message.activePlayers.map((e) => InnerTubeContext_ActivePlayerInfo.toJSON(e)); - } - return obj; - }, - - create, I>>(base?: I): InnerTubeContext { - return InnerTubeContext.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): InnerTubeContext { - const message = createBaseInnerTubeContext(); - message.client = (object.client !== undefined && object.client !== null) - ? ClientInfo.fromPartial(object.client) - : undefined; - message.user = (object.user !== undefined && object.user !== null) ? UserInfo.fromPartial(object.user) : undefined; - message.capabilities = (object.capabilities !== undefined && object.capabilities !== null) - ? CapabilityInfo.fromPartial(object.capabilities) - : undefined; - message.request = (object.request !== undefined && object.request !== null) - ? RequestInfo.fromPartial(object.request) - : undefined; - message.clickTracking = (object.clickTracking !== undefined && object.clickTracking !== null) - ? InnerTubeContext_ClickTrackingInfo.fromPartial(object.clickTracking) - : undefined; - message.thirdParty = (object.thirdParty !== undefined && object.thirdParty !== null) - ? ThirdPartyInfo.fromPartial(object.thirdParty) - : undefined; - message.remoteClient = (object.remoteClient !== undefined && object.remoteClient !== null) - ? ClientInfo.fromPartial(object.remoteClient) - : undefined; - message.adSignalsInfo = (object.adSignalsInfo !== undefined && object.adSignalsInfo !== null) - ? InnerTubeContext_AdSignalsInfo.fromPartial(object.adSignalsInfo) - : undefined; - message.experimentalData = (object.experimentalData !== undefined && object.experimentalData !== null) - ? InnerTubeContext_ExperimentalData.fromPartial(object.experimentalData) - : undefined; - message.clientScreenNonce = object.clientScreenNonce ?? undefined; - message.activePlayers = object.activePlayers?.map((e) => InnerTubeContext_ActivePlayerInfo.fromPartial(e)) || []; - return message; - }, }; function createBaseInnerTubeContext_ExperimentalData(): InnerTubeContext_ExperimentalData { @@ -330,33 +233,6 @@ export const InnerTubeContext_ExperimentalData: MessageFns KeyValuePair.fromJSON(e)) : [], - }; - }, - - toJSON(message: InnerTubeContext_ExperimentalData): unknown { - const obj: any = {}; - if (message.params?.length) { - obj.params = message.params.map((e) => KeyValuePair.toJSON(e)); - } - return obj; - }, - - create, I>>( - base?: I, - ): InnerTubeContext_ExperimentalData { - return InnerTubeContext_ExperimentalData.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): InnerTubeContext_ExperimentalData { - const message = createBaseInnerTubeContext_ExperimentalData(); - message.params = object.params?.map((e) => KeyValuePair.fromPartial(e)) || []; - return message; - }, }; function createBaseInnerTubeContext_ActivePlayerInfo(): InnerTubeContext_ActivePlayerInfo { @@ -393,33 +269,6 @@ export const InnerTubeContext_ActivePlayerInfo: MessageFns, I>>( - base?: I, - ): InnerTubeContext_ActivePlayerInfo { - return InnerTubeContext_ActivePlayerInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): InnerTubeContext_ActivePlayerInfo { - const message = createBaseInnerTubeContext_ActivePlayerInfo(); - message.playerContextParams = object.playerContextParams ?? undefined; - return message; - }, }; function createBaseInnerTubeContext_ClickTrackingInfo(): InnerTubeContext_ClickTrackingInfo { @@ -456,33 +305,6 @@ export const InnerTubeContext_ClickTrackingInfo: MessageFns, I>>( - base?: I, - ): InnerTubeContext_ClickTrackingInfo { - return InnerTubeContext_ClickTrackingInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): InnerTubeContext_ClickTrackingInfo { - const message = createBaseInnerTubeContext_ClickTrackingInfo(); - message.clickTrackingParams = object.clickTrackingParams ?? undefined; - return message; - }, }; function createBaseInnerTubeContext_AdSignalsInfo(): InnerTubeContext_AdSignalsInfo { @@ -587,103 +409,9 @@ export const InnerTubeContext_AdSignalsInfo: MessageFns KeyValuePair.fromJSON(e)) : [], - bid: isSet(object.bid) ? globalThis.String(object.bid) : undefined, - mutsuId: isSet(object.mutsuId) ? globalThis.String(object.mutsuId) : undefined, - consentBumpState: isSet(object.consentBumpState) ? globalThis.String(object.consentBumpState) : undefined, - advertisingId: isSet(object.advertisingId) ? globalThis.String(object.advertisingId) : undefined, - limitAdTracking: isSet(object.limitAdTracking) ? globalThis.Boolean(object.limitAdTracking) : undefined, - attributionOsSupportedVersion: isSet(object.attributionOsSupportedVersion) - ? globalThis.String(object.attributionOsSupportedVersion) - : undefined, - }; - }, - - toJSON(message: InnerTubeContext_AdSignalsInfo): unknown { - const obj: any = {}; - if (message.params?.length) { - obj.params = message.params.map((e) => KeyValuePair.toJSON(e)); - } - if (message.bid !== undefined) { - obj.bid = message.bid; - } - if (message.mutsuId !== undefined) { - obj.mutsuId = message.mutsuId; - } - if (message.consentBumpState !== undefined) { - obj.consentBumpState = message.consentBumpState; - } - if (message.advertisingId !== undefined) { - obj.advertisingId = message.advertisingId; - } - if (message.limitAdTracking !== undefined) { - obj.limitAdTracking = message.limitAdTracking; - } - if (message.attributionOsSupportedVersion !== undefined) { - obj.attributionOsSupportedVersion = message.attributionOsSupportedVersion; - } - return obj; - }, - - create, I>>(base?: I): InnerTubeContext_AdSignalsInfo { - return InnerTubeContext_AdSignalsInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): InnerTubeContext_AdSignalsInfo { - const message = createBaseInnerTubeContext_AdSignalsInfo(); - message.params = object.params?.map((e) => KeyValuePair.fromPartial(e)) || []; - message.bid = object.bid ?? undefined; - message.mutsuId = object.mutsuId ?? undefined; - message.consentBumpState = object.consentBumpState ?? undefined; - message.advertisingId = object.advertisingId ?? undefined; - message.limitAdTracking = object.limitAdTracking ?? undefined; - message.attributionOsSupportedVersion = object.attributionOsSupportedVersion ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/metadata_update_request.ts b/protos/generated/youtube/api/pfiinnertube/metadata_update_request.ts index a4aa2f39..ad8c7201 100644 --- a/protos/generated/youtube/api/pfiinnertube/metadata_update_request.ts +++ b/protos/generated/youtube/api/pfiinnertube/metadata_update_request.ts @@ -242,120 +242,6 @@ export const MetadataUpdateRequest: MessageFns = { } return message; }, - - fromJSON(object: any): MetadataUpdateRequest { - return { - context: isSet(object.context) ? InnerTubeContext.fromJSON(object.context) : undefined, - encryptedVideoId: isSet(object.encryptedVideoId) ? globalThis.String(object.encryptedVideoId) : undefined, - title: isSet(object.title) ? MetadataUpdateRequest_MdeTitleUpdateRequest.fromJSON(object.title) : undefined, - description: isSet(object.description) - ? MetadataUpdateRequest_MdeDescriptionUpdateRequest.fromJSON(object.description) - : undefined, - privacy: isSet(object.privacy) - ? MetadataUpdateRequest_MdePrivacyUpdateRequest.fromJSON(object.privacy) - : undefined, - tags: isSet(object.tags) ? MetadataUpdateRequest_MdeTagsUpdateRequest.fromJSON(object.tags) : undefined, - category: isSet(object.category) - ? MetadataUpdateRequest_MdeCategoryUpdateRequest.fromJSON(object.category) - : undefined, - license: isSet(object.license) - ? MetadataUpdateRequest_MdeLicenseUpdateRequest.fromJSON(object.license) - : undefined, - ageRestriction: isSet(object.ageRestriction) - ? MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.fromJSON(object.ageRestriction) - : undefined, - videoStill: isSet(object.videoStill) - ? MetadataUpdateRequest_MdeVideoStillRequestParams.fromJSON(object.videoStill) - : undefined, - madeForKids: isSet(object.madeForKids) - ? MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.fromJSON(object.madeForKids) - : undefined, - racy: isSet(object.racy) ? MetadataUpdateRequest_MdeRacyRequestParams.fromJSON(object.racy) : undefined, - }; - }, - - toJSON(message: MetadataUpdateRequest): unknown { - const obj: any = {}; - if (message.context !== undefined) { - obj.context = InnerTubeContext.toJSON(message.context); - } - if (message.encryptedVideoId !== undefined) { - obj.encryptedVideoId = message.encryptedVideoId; - } - if (message.title !== undefined) { - obj.title = MetadataUpdateRequest_MdeTitleUpdateRequest.toJSON(message.title); - } - if (message.description !== undefined) { - obj.description = MetadataUpdateRequest_MdeDescriptionUpdateRequest.toJSON(message.description); - } - if (message.privacy !== undefined) { - obj.privacy = MetadataUpdateRequest_MdePrivacyUpdateRequest.toJSON(message.privacy); - } - if (message.tags !== undefined) { - obj.tags = MetadataUpdateRequest_MdeTagsUpdateRequest.toJSON(message.tags); - } - if (message.category !== undefined) { - obj.category = MetadataUpdateRequest_MdeCategoryUpdateRequest.toJSON(message.category); - } - if (message.license !== undefined) { - obj.license = MetadataUpdateRequest_MdeLicenseUpdateRequest.toJSON(message.license); - } - if (message.ageRestriction !== undefined) { - obj.ageRestriction = MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.toJSON(message.ageRestriction); - } - if (message.videoStill !== undefined) { - obj.videoStill = MetadataUpdateRequest_MdeVideoStillRequestParams.toJSON(message.videoStill); - } - if (message.madeForKids !== undefined) { - obj.madeForKids = MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.toJSON(message.madeForKids); - } - if (message.racy !== undefined) { - obj.racy = MetadataUpdateRequest_MdeRacyRequestParams.toJSON(message.racy); - } - return obj; - }, - - create, I>>(base?: I): MetadataUpdateRequest { - return MetadataUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): MetadataUpdateRequest { - const message = createBaseMetadataUpdateRequest(); - message.context = (object.context !== undefined && object.context !== null) - ? InnerTubeContext.fromPartial(object.context) - : undefined; - message.encryptedVideoId = object.encryptedVideoId ?? undefined; - message.title = (object.title !== undefined && object.title !== null) - ? MetadataUpdateRequest_MdeTitleUpdateRequest.fromPartial(object.title) - : undefined; - message.description = (object.description !== undefined && object.description !== null) - ? MetadataUpdateRequest_MdeDescriptionUpdateRequest.fromPartial(object.description) - : undefined; - message.privacy = (object.privacy !== undefined && object.privacy !== null) - ? MetadataUpdateRequest_MdePrivacyUpdateRequest.fromPartial(object.privacy) - : undefined; - message.tags = (object.tags !== undefined && object.tags !== null) - ? MetadataUpdateRequest_MdeTagsUpdateRequest.fromPartial(object.tags) - : undefined; - message.category = (object.category !== undefined && object.category !== null) - ? MetadataUpdateRequest_MdeCategoryUpdateRequest.fromPartial(object.category) - : undefined; - message.license = (object.license !== undefined && object.license !== null) - ? MetadataUpdateRequest_MdeLicenseUpdateRequest.fromPartial(object.license) - : undefined; - message.ageRestriction = (object.ageRestriction !== undefined && object.ageRestriction !== null) - ? MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.fromPartial(object.ageRestriction) - : undefined; - message.videoStill = (object.videoStill !== undefined && object.videoStill !== null) - ? MetadataUpdateRequest_MdeVideoStillRequestParams.fromPartial(object.videoStill) - : undefined; - message.madeForKids = (object.madeForKids !== undefined && object.madeForKids !== null) - ? MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.fromPartial(object.madeForKids) - : undefined; - message.racy = (object.racy !== undefined && object.racy !== null) - ? MetadataUpdateRequest_MdeRacyRequestParams.fromPartial(object.racy) - : undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeTitleUpdateRequest(): MetadataUpdateRequest_MdeTitleUpdateRequest { @@ -395,31 +281,6 @@ export const MetadataUpdateRequest_MdeTitleUpdateRequest: MessageFns, I>>( - base?: I, - ): MetadataUpdateRequest_MdeTitleUpdateRequest { - return MetadataUpdateRequest_MdeTitleUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeTitleUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdeTitleUpdateRequest(); - message.newTitle = object.newTitle ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest(): MetadataUpdateRequest_MdeDescriptionUpdateRequest { @@ -461,31 +322,6 @@ export const MetadataUpdateRequest_MdeDescriptionUpdateRequest: MessageFns< } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeDescriptionUpdateRequest { - return { newDescription: isSet(object.newDescription) ? globalThis.String(object.newDescription) : undefined }; - }, - - toJSON(message: MetadataUpdateRequest_MdeDescriptionUpdateRequest): unknown { - const obj: any = {}; - if (message.newDescription !== undefined) { - obj.newDescription = message.newDescription; - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeDescriptionUpdateRequest { - return MetadataUpdateRequest_MdeDescriptionUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeDescriptionUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdeDescriptionUpdateRequest(); - message.newDescription = object.newDescription ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest(): MetadataUpdateRequest_MdePrivacyUpdateRequest { @@ -536,38 +372,6 @@ export const MetadataUpdateRequest_MdePrivacyUpdateRequest: MessageFns, I>>( - base?: I, - ): MetadataUpdateRequest_MdePrivacyUpdateRequest { - return MetadataUpdateRequest_MdePrivacyUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdePrivacyUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdePrivacyUpdateRequest(); - message.newPrivacy = object.newPrivacy ?? undefined; - message.clearPrivacyDraft = object.clearPrivacyDraft ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeTagsUpdateRequest(): MetadataUpdateRequest_MdeTagsUpdateRequest { @@ -604,33 +408,6 @@ export const MetadataUpdateRequest_MdeTagsUpdateRequest: MessageFns globalThis.String(e)) : [], - }; - }, - - toJSON(message: MetadataUpdateRequest_MdeTagsUpdateRequest): unknown { - const obj: any = {}; - if (message.newTags?.length) { - obj.newTags = message.newTags; - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeTagsUpdateRequest { - return MetadataUpdateRequest_MdeTagsUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeTagsUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdeTagsUpdateRequest(); - message.newTags = object.newTags?.map((e) => e) || []; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest(): MetadataUpdateRequest_MdeCategoryUpdateRequest { @@ -672,31 +449,6 @@ export const MetadataUpdateRequest_MdeCategoryUpdateRequest: MessageFns< } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeCategoryUpdateRequest { - return { newCategoryId: isSet(object.newCategoryId) ? globalThis.Number(object.newCategoryId) : undefined }; - }, - - toJSON(message: MetadataUpdateRequest_MdeCategoryUpdateRequest): unknown { - const obj: any = {}; - if (message.newCategoryId !== undefined) { - obj.newCategoryId = Math.round(message.newCategoryId); - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeCategoryUpdateRequest { - return MetadataUpdateRequest_MdeCategoryUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeCategoryUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdeCategoryUpdateRequest(); - message.newCategoryId = object.newCategoryId ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest(): MetadataUpdateRequest_MdeLicenseUpdateRequest { @@ -737,31 +489,6 @@ export const MetadataUpdateRequest_MdeLicenseUpdateRequest: MessageFns, I>>( - base?: I, - ): MetadataUpdateRequest_MdeLicenseUpdateRequest { - return MetadataUpdateRequest_MdeLicenseUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeLicenseUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdeLicenseUpdateRequest(); - message.newLicenseId = object.newLicenseId ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams(): MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams { @@ -813,38 +540,6 @@ export const MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams: MessageFns } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams { - return { - operation: isSet(object.operation) ? globalThis.Number(object.operation) : undefined, - newMfk: isSet(object.newMfk) ? globalThis.Number(object.newMfk) : undefined, - }; - }, - - toJSON(message: MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams): unknown { - const obj: any = {}; - if (message.operation !== undefined) { - obj.operation = Math.round(message.operation); - } - if (message.newMfk !== undefined) { - obj.newMfk = Math.round(message.newMfk); - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams { - return MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams { - const message = createBaseMetadataUpdateRequest_MdeMadeForKidsUpdateRequestParams(); - message.operation = object.operation ?? undefined; - message.newMfk = object.newMfk ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeRacyRequestParams(): MetadataUpdateRequest_MdeRacyRequestParams { @@ -891,38 +586,6 @@ export const MetadataUpdateRequest_MdeRacyRequestParams: MessageFns, I>>( - base?: I, - ): MetadataUpdateRequest_MdeRacyRequestParams { - return MetadataUpdateRequest_MdeRacyRequestParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeRacyRequestParams { - const message = createBaseMetadataUpdateRequest_MdeRacyRequestParams(); - message.operation = object.operation ?? undefined; - message.newRacy = object.newRacy ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest(): MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest { @@ -964,33 +627,6 @@ export const MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest: MessageFns< } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest { - return { - newIsAgeRestricted: isSet(object.newIsAgeRestricted) ? globalThis.Boolean(object.newIsAgeRestricted) : undefined, - }; - }, - - toJSON(message: MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest): unknown { - const obj: any = {}; - if (message.newIsAgeRestricted !== undefined) { - obj.newIsAgeRestricted = message.newIsAgeRestricted; - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest { - return MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeAgeRestrictionUpdateRequest { - const message = createBaseMetadataUpdateRequest_MdeAgeRestrictionUpdateRequest(); - message.newIsAgeRestricted = object.newIsAgeRestricted ?? undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams(): MetadataUpdateRequest_MdeVideoStillRequestParams { @@ -1090,70 +726,6 @@ export const MetadataUpdateRequest_MdeVideoStillRequestParams: MessageFns< } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeVideoStillRequestParams { - return { - operation: isSet(object.operation) ? globalThis.Number(object.operation) : undefined, - newStillId: isSet(object.newStillId) ? globalThis.Number(object.newStillId) : undefined, - image: isSet(object.image) - ? MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromJSON(object.image) - : undefined, - testImage: isSet(object.testImage) - ? MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromJSON(object.testImage) - : undefined, - experimentImage: globalThis.Array.isArray(object?.experimentImage) - ? object.experimentImage.map((e: any) => - MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: MetadataUpdateRequest_MdeVideoStillRequestParams): unknown { - const obj: any = {}; - if (message.operation !== undefined) { - obj.operation = Math.round(message.operation); - } - if (message.newStillId !== undefined) { - obj.newStillId = Math.round(message.newStillId); - } - if (message.image !== undefined) { - obj.image = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.toJSON(message.image); - } - if (message.testImage !== undefined) { - obj.testImage = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.toJSON(message.testImage); - } - if (message.experimentImage?.length) { - obj.experimentImage = message.experimentImage.map((e) => - MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.toJSON(e) - ); - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeVideoStillRequestParams { - return MetadataUpdateRequest_MdeVideoStillRequestParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeVideoStillRequestParams { - const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams(); - message.operation = object.operation ?? undefined; - message.newStillId = object.newStillId ?? undefined; - message.image = (object.image !== undefined && object.image !== null) - ? MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromPartial(object.image) - : undefined; - message.testImage = (object.testImage !== undefined && object.testImage !== null) - ? MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromPartial(object.testImage) - : undefined; - message.experimentImage = - object.experimentImage?.map((e) => - MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.fromPartial(e) - ) || []; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData(): MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData { @@ -1204,39 +776,6 @@ export const MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimen } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData { - return { - image: isSet(object.image) - ? MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromJSON(object.image) - : undefined, - }; - }, - - toJSON(message: MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData): unknown { - const obj: any = {}; - if (message.image !== undefined) { - obj.image = MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.toJSON(message.image); - } - return obj; - }, - - create< - I extends Exact, I>, - >(base?: I): MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData { - return MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData.fromPartial( - base ?? ({} as any), - ); - }, - fromPartial< - I extends Exact, I>, - >(object: I): MetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData { - const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_ThumbnailExperimentImageData(); - message.image = (object.image !== undefined && object.image !== null) - ? MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromPartial(object.image) - : undefined; - return message; - }, }; function createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage(): MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage { @@ -1311,79 +850,8 @@ export const MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailIma } return message; }, - - fromJSON(object: any): MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage { - return { - rawBytes: isSet(object.rawBytes) ? bytesFromBase64(object.rawBytes) : undefined, - dataUri: isSet(object.dataUri) ? globalThis.String(object.dataUri) : undefined, - frameTimestampUs: isSet(object.frameTimestampUs) ? globalThis.Number(object.frameTimestampUs) : undefined, - isVertical: isSet(object.isVertical) ? globalThis.Boolean(object.isVertical) : undefined, - }; - }, - - toJSON(message: MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage): unknown { - const obj: any = {}; - if (message.rawBytes !== undefined) { - obj.rawBytes = base64FromBytes(message.rawBytes); - } - if (message.dataUri !== undefined) { - obj.dataUri = message.dataUri; - } - if (message.frameTimestampUs !== undefined) { - obj.frameTimestampUs = Math.round(message.frameTimestampUs); - } - if (message.isVertical !== undefined) { - obj.isVertical = message.isVertical; - } - return obj; - }, - - create, I>>( - base?: I, - ): MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage { - return MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): MetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage { - const message = createBaseMetadataUpdateRequest_MdeVideoStillRequestParams_CustomThumbnailImage(); - message.rawBytes = object.rawBytes ?? undefined; - message.dataUri = object.dataUri ?? undefined; - message.frameTimestampUs = object.frameTimestampUs ?? undefined; - message.isVertical = object.isVertical ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - function longToNumber(int64: { toString(): string }): number { const num = globalThis.Number(int64.toString()); if (num > globalThis.Number.MAX_SAFE_INTEGER) { @@ -1395,15 +863,7 @@ function longToNumber(int64: { toString(): string }): number { return num; } -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/playback_context.ts b/protos/generated/youtube/api/pfiinnertube/playback_context.ts index dea76cde..14685ec1 100644 --- a/protos/generated/youtube/api/pfiinnertube/playback_context.ts +++ b/protos/generated/youtube/api/pfiinnertube/playback_context.ts @@ -114,34 +114,6 @@ export const PlaybackContext: MessageFns = { } return message; }, - - fromJSON(object: any): PlaybackContext { - return { - contentPlaybackContext: isSet(object.contentPlaybackContext) - ? PlaybackContext_ContentPlaybackContext.fromJSON(object.contentPlaybackContext) - : undefined, - }; - }, - - toJSON(message: PlaybackContext): unknown { - const obj: any = {}; - if (message.contentPlaybackContext !== undefined) { - obj.contentPlaybackContext = PlaybackContext_ContentPlaybackContext.toJSON(message.contentPlaybackContext); - } - return obj; - }, - - create, I>>(base?: I): PlaybackContext { - return PlaybackContext.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): PlaybackContext { - const message = createBasePlaybackContext(); - message.contentPlaybackContext = - (object.contentPlaybackContext !== undefined && object.contentPlaybackContext !== null) - ? PlaybackContext_ContentPlaybackContext.fromPartial(object.contentPlaybackContext) - : undefined; - return message; - }, }; function createBasePlaybackContext_ContentPlaybackContext(): PlaybackContext_ContentPlaybackContext { @@ -499,210 +471,8 @@ export const PlaybackContext_ContentPlaybackContext: MessageFns, I>>( - base?: I, - ): PlaybackContext_ContentPlaybackContext { - return PlaybackContext_ContentPlaybackContext.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): PlaybackContext_ContentPlaybackContext { - const message = createBasePlaybackContext_ContentPlaybackContext(); - message.deviceSignals = object.deviceSignals ?? undefined; - message.revShareClientId = object.revShareClientId ?? undefined; - message.timeSinceLastAdSeconds = object.timeSinceLastAdSeconds ?? undefined; - message.lactMilliseconds = object.lactMilliseconds ?? undefined; - message.autoplaysSinceLastAd = object.autoplaysSinceLastAd ?? undefined; - message.vis = object.vis ?? undefined; - message.fling = object.fling ?? undefined; - message.splay = object.splay ?? undefined; - message.autoplay = object.autoplay ?? undefined; - message.timeOfLastInstreamPrerollAd = object.timeOfLastInstreamPrerollAd ?? undefined; - message.currentUrl = object.currentUrl ?? undefined; - message.referer = object.referer ?? undefined; - message.loadAnnotationsByDemand = object.loadAnnotationsByDemand ?? undefined; - message.autoCaptionsDefaultOn = object.autoCaptionsDefaultOn ?? undefined; - message.slicedBread = object.slicedBread ?? undefined; - message.autonav = object.autonav ?? undefined; - message.trailer = object.trailer ?? undefined; - message.playerWidthPixels = object.playerWidthPixels ?? undefined; - message.playerHeightPixels = object.playerHeightPixels ?? undefined; - message.snd = object.snd ?? undefined; - message.vnd = object.vnd ?? undefined; - message.uao = object.uao ?? undefined; - message.mutedAutoplay = object.mutedAutoplay ?? undefined; - message.enablePrivacyFilter = object.enablePrivacyFilter ?? undefined; - message.isLivingRoomDeeplink = object.isLivingRoomDeeplink ?? undefined; - message.signatureTimestamp = object.signatureTimestamp ?? undefined; - message.isInlinePlaybackNoAd = object.isInlinePlaybackNoAd ?? undefined; - message.isInlineUnmutedPlayback = object.isInlineUnmutedPlayback ?? undefined; - message.playPackageVersion = object.playPackageVersion ?? undefined; - message.isSequenceEntry = object.isSequenceEntry ?? undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - function longToNumber(int64: { toString(): string }): number { const num = globalThis.Number(int64.toString()); if (num > globalThis.Number.MAX_SAFE_INTEGER) { @@ -714,15 +484,7 @@ function longToNumber(int64: { toString(): string }): number { return num; } -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/player_attestation_request_data.ts b/protos/generated/youtube/api/pfiinnertube/player_attestation_request_data.ts index a783fafe..6313e40d 100644 --- a/protos/generated/youtube/api/pfiinnertube/player_attestation_request_data.ts +++ b/protos/generated/youtube/api/pfiinnertube/player_attestation_request_data.ts @@ -68,38 +68,6 @@ export const PlayerAttestationRequestData: MessageFns, I>>(base?: I): PlayerAttestationRequestData { - return PlayerAttestationRequestData.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): PlayerAttestationRequestData { - const message = createBasePlayerAttestationRequestData(); - message.iosguardRequest = (object.iosguardRequest !== undefined && object.iosguardRequest !== null) - ? PlayerAttestationRequestData_IosguardChallengeRequestData.fromPartial(object.iosguardRequest) - : undefined; - message.omitBotguardData = object.omitBotguardData ?? undefined; - return message; - }, }; function createBasePlayerAttestationRequestData_IosguardChallengeRequestData(): PlayerAttestationRequestData_IosguardChallengeRequestData { @@ -141,71 +109,9 @@ export const PlayerAttestationRequestData_IosguardChallengeRequestData: MessageF } return message; }, - - fromJSON(object: any): PlayerAttestationRequestData_IosguardChallengeRequestData { - return { challengeRequest: isSet(object.challengeRequest) ? bytesFromBase64(object.challengeRequest) : undefined }; - }, - - toJSON(message: PlayerAttestationRequestData_IosguardChallengeRequestData): unknown { - const obj: any = {}; - if (message.challengeRequest !== undefined) { - obj.challengeRequest = base64FromBytes(message.challengeRequest); - } - return obj; - }, - - create, I>>( - base?: I, - ): PlayerAttestationRequestData_IosguardChallengeRequestData { - return PlayerAttestationRequestData_IosguardChallengeRequestData.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): PlayerAttestationRequestData_IosguardChallengeRequestData { - const message = createBasePlayerAttestationRequestData_IosguardChallengeRequestData(); - message.challengeRequest = object.challengeRequest ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/player_request.ts b/protos/generated/youtube/api/pfiinnertube/player_request.ts index 358ebe4a..c56744eb 100644 --- a/protos/generated/youtube/api/pfiinnertube/player_request.ts +++ b/protos/generated/youtube/api/pfiinnertube/player_request.ts @@ -333,207 +333,9 @@ export const PlayerRequest: MessageFns = { } return message; }, - - fromJSON(object: any): PlayerRequest { - return { - context: isSet(object.context) ? InnerTubeContext.fromJSON(object.context) : undefined, - videoId: isSet(object.videoId) ? globalThis.String(object.videoId) : undefined, - contentCheckOk: isSet(object.contentCheckOk) ? globalThis.Boolean(object.contentCheckOk) : undefined, - playbackContext: isSet(object.playbackContext) ? PlaybackContext.fromJSON(object.playbackContext) : undefined, - racyCheckOk: isSet(object.racyCheckOk) ? globalThis.Boolean(object.racyCheckOk) : undefined, - id: isSet(object.id) ? globalThis.String(object.id) : undefined, - t: isSet(object.t) ? globalThis.String(object.t) : undefined, - forOffline: isSet(object.forOffline) ? globalThis.Boolean(object.forOffline) : undefined, - playlistId: isSet(object.playlistId) ? globalThis.String(object.playlistId) : undefined, - playlistIndex: isSet(object.playlistIndex) ? globalThis.Number(object.playlistIndex) : undefined, - startTimeSecs: isSet(object.startTimeSecs) ? globalThis.Number(object.startTimeSecs) : undefined, - params: isSet(object.params) ? globalThis.String(object.params) : undefined, - offlineSharingWrappedKey: isSet(object.offlineSharingWrappedKey) - ? bytesFromBase64(object.offlineSharingWrappedKey) - : undefined, - attestationRequest: isSet(object.attestationRequest) - ? PlayerAttestationRequestData.fromJSON(object.attestationRequest) - : undefined, - referringApp: isSet(object.referringApp) ? globalThis.String(object.referringApp) : undefined, - referrer: isSet(object.referrer) ? globalThis.String(object.referrer) : undefined, - serializedThirdPartyEmbedConfig: isSet(object.serializedThirdPartyEmbedConfig) - ? globalThis.String(object.serializedThirdPartyEmbedConfig) - : undefined, - proxiedByOnesie: isSet(object.proxiedByOnesie) ? globalThis.Boolean(object.proxiedByOnesie) : undefined, - hostAppToken: isSet(object.hostAppToken) ? globalThis.String(object.hostAppToken) : undefined, - cpn: isSet(object.cpn) ? globalThis.String(object.cpn) : undefined, - overrideMutedAtStart: isSet(object.overrideMutedAtStart) - ? globalThis.Boolean(object.overrideMutedAtStart) - : undefined, - captionParams: isSet(object.captionParams) - ? PlayerRequestCaptionParams.fromJSON(object.captionParams) - : undefined, - serviceIntegrityDimensions: isSet(object.serviceIntegrityDimensions) - ? ServiceIntegrityDimensions.fromJSON(object.serviceIntegrityDimensions) - : undefined, - deferredPlayerToken: isSet(object.deferredPlayerToken) ? bytesFromBase64(object.deferredPlayerToken) : undefined, - }; - }, - - toJSON(message: PlayerRequest): unknown { - const obj: any = {}; - if (message.context !== undefined) { - obj.context = InnerTubeContext.toJSON(message.context); - } - if (message.videoId !== undefined) { - obj.videoId = message.videoId; - } - if (message.contentCheckOk !== undefined) { - obj.contentCheckOk = message.contentCheckOk; - } - if (message.playbackContext !== undefined) { - obj.playbackContext = PlaybackContext.toJSON(message.playbackContext); - } - if (message.racyCheckOk !== undefined) { - obj.racyCheckOk = message.racyCheckOk; - } - if (message.id !== undefined) { - obj.id = message.id; - } - if (message.t !== undefined) { - obj.t = message.t; - } - if (message.forOffline !== undefined) { - obj.forOffline = message.forOffline; - } - if (message.playlistId !== undefined) { - obj.playlistId = message.playlistId; - } - if (message.playlistIndex !== undefined) { - obj.playlistIndex = Math.round(message.playlistIndex); - } - if (message.startTimeSecs !== undefined) { - obj.startTimeSecs = Math.round(message.startTimeSecs); - } - if (message.params !== undefined) { - obj.params = message.params; - } - if (message.offlineSharingWrappedKey !== undefined) { - obj.offlineSharingWrappedKey = base64FromBytes(message.offlineSharingWrappedKey); - } - if (message.attestationRequest !== undefined) { - obj.attestationRequest = PlayerAttestationRequestData.toJSON(message.attestationRequest); - } - if (message.referringApp !== undefined) { - obj.referringApp = message.referringApp; - } - if (message.referrer !== undefined) { - obj.referrer = message.referrer; - } - if (message.serializedThirdPartyEmbedConfig !== undefined) { - obj.serializedThirdPartyEmbedConfig = message.serializedThirdPartyEmbedConfig; - } - if (message.proxiedByOnesie !== undefined) { - obj.proxiedByOnesie = message.proxiedByOnesie; - } - if (message.hostAppToken !== undefined) { - obj.hostAppToken = message.hostAppToken; - } - if (message.cpn !== undefined) { - obj.cpn = message.cpn; - } - if (message.overrideMutedAtStart !== undefined) { - obj.overrideMutedAtStart = message.overrideMutedAtStart; - } - if (message.captionParams !== undefined) { - obj.captionParams = PlayerRequestCaptionParams.toJSON(message.captionParams); - } - if (message.serviceIntegrityDimensions !== undefined) { - obj.serviceIntegrityDimensions = ServiceIntegrityDimensions.toJSON(message.serviceIntegrityDimensions); - } - if (message.deferredPlayerToken !== undefined) { - obj.deferredPlayerToken = base64FromBytes(message.deferredPlayerToken); - } - return obj; - }, - - create, I>>(base?: I): PlayerRequest { - return PlayerRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): PlayerRequest { - const message = createBasePlayerRequest(); - message.context = (object.context !== undefined && object.context !== null) - ? InnerTubeContext.fromPartial(object.context) - : undefined; - message.videoId = object.videoId ?? undefined; - message.contentCheckOk = object.contentCheckOk ?? undefined; - message.playbackContext = (object.playbackContext !== undefined && object.playbackContext !== null) - ? PlaybackContext.fromPartial(object.playbackContext) - : undefined; - message.racyCheckOk = object.racyCheckOk ?? undefined; - message.id = object.id ?? undefined; - message.t = object.t ?? undefined; - message.forOffline = object.forOffline ?? undefined; - message.playlistId = object.playlistId ?? undefined; - message.playlistIndex = object.playlistIndex ?? undefined; - message.startTimeSecs = object.startTimeSecs ?? undefined; - message.params = object.params ?? undefined; - message.offlineSharingWrappedKey = object.offlineSharingWrappedKey ?? undefined; - message.attestationRequest = (object.attestationRequest !== undefined && object.attestationRequest !== null) - ? PlayerAttestationRequestData.fromPartial(object.attestationRequest) - : undefined; - message.referringApp = object.referringApp ?? undefined; - message.referrer = object.referrer ?? undefined; - message.serializedThirdPartyEmbedConfig = object.serializedThirdPartyEmbedConfig ?? undefined; - message.proxiedByOnesie = object.proxiedByOnesie ?? undefined; - message.hostAppToken = object.hostAppToken ?? undefined; - message.cpn = object.cpn ?? undefined; - message.overrideMutedAtStart = object.overrideMutedAtStart ?? undefined; - message.captionParams = (object.captionParams !== undefined && object.captionParams !== null) - ? PlayerRequestCaptionParams.fromPartial(object.captionParams) - : undefined; - message.serviceIntegrityDimensions = - (object.serviceIntegrityDimensions !== undefined && object.serviceIntegrityDimensions !== null) - ? ServiceIntegrityDimensions.fromPartial(object.serviceIntegrityDimensions) - : undefined; - message.deferredPlayerToken = object.deferredPlayerToken ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/player_request_caption_params.ts b/protos/generated/youtube/api/pfiinnertube/player_request_caption_params.ts index 9dcab3ad..8ad5ec2f 100644 --- a/protos/generated/youtube/api/pfiinnertube/player_request_caption_params.ts +++ b/protos/generated/youtube/api/pfiinnertube/player_request_caption_params.ts @@ -97,76 +97,9 @@ export const PlayerRequestCaptionParams: MessageFns } return message; }, - - fromJSON(object: any): PlayerRequestCaptionParams { - return { - deviceCaptionsOn: isSet(object.deviceCaptionsOn) ? globalThis.Boolean(object.deviceCaptionsOn) : undefined, - deviceCaptionsLangPref: isSet(object.deviceCaptionsLangPref) - ? globalThis.String(object.deviceCaptionsLangPref) - : undefined, - viewerSelectedCaptionLangs: isSet(object.viewerSelectedCaptionLangs) - ? globalThis.String(object.viewerSelectedCaptionLangs) - : undefined, - ccLangPref: isSet(object.ccLangPref) ? globalThis.String(object.ccLangPref) : undefined, - ccLoadPolicyOn: isSet(object.ccLoadPolicyOn) ? globalThis.Boolean(object.ccLoadPolicyOn) : undefined, - }; - }, - - toJSON(message: PlayerRequestCaptionParams): unknown { - const obj: any = {}; - if (message.deviceCaptionsOn !== undefined) { - obj.deviceCaptionsOn = message.deviceCaptionsOn; - } - if (message.deviceCaptionsLangPref !== undefined) { - obj.deviceCaptionsLangPref = message.deviceCaptionsLangPref; - } - if (message.viewerSelectedCaptionLangs !== undefined) { - obj.viewerSelectedCaptionLangs = message.viewerSelectedCaptionLangs; - } - if (message.ccLangPref !== undefined) { - obj.ccLangPref = message.ccLangPref; - } - if (message.ccLoadPolicyOn !== undefined) { - obj.ccLoadPolicyOn = message.ccLoadPolicyOn; - } - return obj; - }, - - create, I>>(base?: I): PlayerRequestCaptionParams { - return PlayerRequestCaptionParams.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): PlayerRequestCaptionParams { - const message = createBasePlayerRequestCaptionParams(); - message.deviceCaptionsOn = object.deviceCaptionsOn ?? undefined; - message.deviceCaptionsLangPref = object.deviceCaptionsLangPref ?? undefined; - message.viewerSelectedCaptionLangs = object.viewerSelectedCaptionLangs ?? undefined; - message.ccLangPref = object.ccLangPref ?? undefined; - message.ccLoadPolicyOn = object.ccLoadPolicyOn ?? undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/reel_item_watch_request.ts b/protos/generated/youtube/api/pfiinnertube/reel_item_watch_request.ts index 637fcda4..63560e61 100644 --- a/protos/generated/youtube/api/pfiinnertube/reel_item_watch_request.ts +++ b/protos/generated/youtube/api/pfiinnertube/reel_item_watch_request.ts @@ -82,73 +82,9 @@ export const ReelItemWatchRequest: MessageFns = { } return message; }, - - fromJSON(object: any): ReelItemWatchRequest { - return { - context: isSet(object.context) ? InnerTubeContext.fromJSON(object.context) : undefined, - playerRequest: isSet(object.playerRequest) ? PlayerRequest.fromJSON(object.playerRequest) : undefined, - params: isSet(object.params) ? globalThis.String(object.params) : undefined, - disablePlayerResponse: isSet(object.disablePlayerResponse) - ? globalThis.Boolean(object.disablePlayerResponse) - : undefined, - }; - }, - - toJSON(message: ReelItemWatchRequest): unknown { - const obj: any = {}; - if (message.context !== undefined) { - obj.context = InnerTubeContext.toJSON(message.context); - } - if (message.playerRequest !== undefined) { - obj.playerRequest = PlayerRequest.toJSON(message.playerRequest); - } - if (message.params !== undefined) { - obj.params = message.params; - } - if (message.disablePlayerResponse !== undefined) { - obj.disablePlayerResponse = message.disablePlayerResponse; - } - return obj; - }, - - create, I>>(base?: I): ReelItemWatchRequest { - return ReelItemWatchRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ReelItemWatchRequest { - const message = createBaseReelItemWatchRequest(); - message.context = (object.context !== undefined && object.context !== null) - ? InnerTubeContext.fromPartial(object.context) - : undefined; - message.playerRequest = (object.playerRequest !== undefined && object.playerRequest !== null) - ? PlayerRequest.fromPartial(object.playerRequest) - : undefined; - message.params = object.params ?? undefined; - message.disablePlayerResponse = object.disablePlayerResponse ?? undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/request_info.ts b/protos/generated/youtube/api/pfiinnertube/request_info.ts index bb9767e0..2195352f 100644 --- a/protos/generated/youtube/api/pfiinnertube/request_info.ts +++ b/protos/generated/youtube/api/pfiinnertube/request_info.ts @@ -55,38 +55,6 @@ export enum RequestInfo_Criticality { UNRECOGNIZED = -1, } -export function requestInfo_CriticalityFromJSON(object: any): RequestInfo_Criticality { - switch (object) { - case 0: - case "CRITICALITY_UNSPECIFIED": - return RequestInfo_Criticality.CRITICALITY_UNSPECIFIED; - case 1: - case "CRITICALITY_CRITICAL": - return RequestInfo_Criticality.CRITICALITY_CRITICAL; - case 2: - case "CRITICALITY_NON_CRITICAL": - return RequestInfo_Criticality.CRITICALITY_NON_CRITICAL; - case -1: - case "UNRECOGNIZED": - default: - return RequestInfo_Criticality.UNRECOGNIZED; - } -} - -export function requestInfo_CriticalityToJSON(object: RequestInfo_Criticality): string { - switch (object) { - case RequestInfo_Criticality.CRITICALITY_UNSPECIFIED: - return "CRITICALITY_UNSPECIFIED"; - case RequestInfo_Criticality.CRITICALITY_CRITICAL: - return "CRITICALITY_CRITICAL"; - case RequestInfo_Criticality.CRITICALITY_NON_CRITICAL: - return "CRITICALITY_NON_CRITICAL"; - case RequestInfo_Criticality.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - /** Quality of Service? */ export interface RequestInfo_RequestQoS { criticality?: RequestInfo_Criticality | undefined; @@ -334,138 +302,6 @@ export const RequestInfo: MessageFns = { } return message; }, - - fromJSON(object: any): RequestInfo { - return { - thirdPartyDigest: isSet(object.thirdPartyDigest) ? globalThis.String(object.thirdPartyDigest) : undefined, - useSsl: isSet(object.useSsl) ? globalThis.Boolean(object.useSsl) : undefined, - returnErrorDetail: isSet(object.returnErrorDetail) ? globalThis.Boolean(object.returnErrorDetail) : undefined, - ifNoneMatch: isSet(object.ifNoneMatch) ? globalThis.String(object.ifNoneMatch) : undefined, - returnLogEntry: isSet(object.returnLogEntry) ? globalThis.Boolean(object.returnLogEntry) : undefined, - isPrefetch: isSet(object.isPrefetch) ? globalThis.Boolean(object.isPrefetch) : undefined, - internalExperimentFlags: globalThis.Array.isArray(object?.internalExperimentFlags) - ? object.internalExperimentFlags.map((e: any) => KeyValuePair.fromJSON(e)) - : [], - returnDebugData: isSet(object.returnDebugData) ? globalThis.Boolean(object.returnDebugData) : undefined, - innertubez: isSet(object.innertubez) ? globalThis.String(object.innertubez) : undefined, - traceProto: isSet(object.traceProto) ? globalThis.Boolean(object.traceProto) : undefined, - returnLogEntryJson: isSet(object.returnLogEntryJson) ? globalThis.Boolean(object.returnLogEntryJson) : undefined, - sherlogUsername: isSet(object.sherlogUsername) ? globalThis.String(object.sherlogUsername) : undefined, - reauthRequestInfo: isSet(object.reauthRequestInfo) - ? RequestInfo_ReauthRequestInfo.fromJSON(object.reauthRequestInfo) - : undefined, - sessionInfo: isSet(object.sessionInfo) ? RequestInfo_SessionInfo.fromJSON(object.sessionInfo) : undefined, - returnLogEntryProto: isSet(object.returnLogEntryProto) - ? globalThis.Boolean(object.returnLogEntryProto) - : undefined, - externalPrequestContext: isSet(object.externalPrequestContext) - ? globalThis.String(object.externalPrequestContext) - : undefined, - attestationResponseData: isSet(object.attestationResponseData) - ? AttestationResponseData.fromJSON(object.attestationResponseData) - : undefined, - eats: isSet(object.eats) ? bytesFromBase64(object.eats) : undefined, - requestQos: isSet(object.requestQos) ? RequestInfo_RequestQoS.fromJSON(object.requestQos) : undefined, - }; - }, - - toJSON(message: RequestInfo): unknown { - const obj: any = {}; - if (message.thirdPartyDigest !== undefined) { - obj.thirdPartyDigest = message.thirdPartyDigest; - } - if (message.useSsl !== undefined) { - obj.useSsl = message.useSsl; - } - if (message.returnErrorDetail !== undefined) { - obj.returnErrorDetail = message.returnErrorDetail; - } - if (message.ifNoneMatch !== undefined) { - obj.ifNoneMatch = message.ifNoneMatch; - } - if (message.returnLogEntry !== undefined) { - obj.returnLogEntry = message.returnLogEntry; - } - if (message.isPrefetch !== undefined) { - obj.isPrefetch = message.isPrefetch; - } - if (message.internalExperimentFlags?.length) { - obj.internalExperimentFlags = message.internalExperimentFlags.map((e) => KeyValuePair.toJSON(e)); - } - if (message.returnDebugData !== undefined) { - obj.returnDebugData = message.returnDebugData; - } - if (message.innertubez !== undefined) { - obj.innertubez = message.innertubez; - } - if (message.traceProto !== undefined) { - obj.traceProto = message.traceProto; - } - if (message.returnLogEntryJson !== undefined) { - obj.returnLogEntryJson = message.returnLogEntryJson; - } - if (message.sherlogUsername !== undefined) { - obj.sherlogUsername = message.sherlogUsername; - } - if (message.reauthRequestInfo !== undefined) { - obj.reauthRequestInfo = RequestInfo_ReauthRequestInfo.toJSON(message.reauthRequestInfo); - } - if (message.sessionInfo !== undefined) { - obj.sessionInfo = RequestInfo_SessionInfo.toJSON(message.sessionInfo); - } - if (message.returnLogEntryProto !== undefined) { - obj.returnLogEntryProto = message.returnLogEntryProto; - } - if (message.externalPrequestContext !== undefined) { - obj.externalPrequestContext = message.externalPrequestContext; - } - if (message.attestationResponseData !== undefined) { - obj.attestationResponseData = AttestationResponseData.toJSON(message.attestationResponseData); - } - if (message.eats !== undefined) { - obj.eats = base64FromBytes(message.eats); - } - if (message.requestQos !== undefined) { - obj.requestQos = RequestInfo_RequestQoS.toJSON(message.requestQos); - } - return obj; - }, - - create, I>>(base?: I): RequestInfo { - return RequestInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RequestInfo { - const message = createBaseRequestInfo(); - message.thirdPartyDigest = object.thirdPartyDigest ?? undefined; - message.useSsl = object.useSsl ?? undefined; - message.returnErrorDetail = object.returnErrorDetail ?? undefined; - message.ifNoneMatch = object.ifNoneMatch ?? undefined; - message.returnLogEntry = object.returnLogEntry ?? undefined; - message.isPrefetch = object.isPrefetch ?? undefined; - message.internalExperimentFlags = object.internalExperimentFlags?.map((e) => KeyValuePair.fromPartial(e)) || []; - message.returnDebugData = object.returnDebugData ?? undefined; - message.innertubez = object.innertubez ?? undefined; - message.traceProto = object.traceProto ?? undefined; - message.returnLogEntryJson = object.returnLogEntryJson ?? undefined; - message.sherlogUsername = object.sherlogUsername ?? undefined; - message.reauthRequestInfo = (object.reauthRequestInfo !== undefined && object.reauthRequestInfo !== null) - ? RequestInfo_ReauthRequestInfo.fromPartial(object.reauthRequestInfo) - : undefined; - message.sessionInfo = (object.sessionInfo !== undefined && object.sessionInfo !== null) - ? RequestInfo_SessionInfo.fromPartial(object.sessionInfo) - : undefined; - message.returnLogEntryProto = object.returnLogEntryProto ?? undefined; - message.externalPrequestContext = object.externalPrequestContext ?? undefined; - message.attestationResponseData = - (object.attestationResponseData !== undefined && object.attestationResponseData !== null) - ? AttestationResponseData.fromPartial(object.attestationResponseData) - : undefined; - message.eats = object.eats ?? undefined; - message.requestQos = (object.requestQos !== undefined && object.requestQos !== null) - ? RequestInfo_RequestQoS.fromPartial(object.requestQos) - : undefined; - return message; - }, }; function createBaseRequestInfo_RequestQoS(): RequestInfo_RequestQoS { @@ -502,27 +338,6 @@ export const RequestInfo_RequestQoS: MessageFns = { } return message; }, - - fromJSON(object: any): RequestInfo_RequestQoS { - return { criticality: isSet(object.criticality) ? requestInfo_CriticalityFromJSON(object.criticality) : undefined }; - }, - - toJSON(message: RequestInfo_RequestQoS): unknown { - const obj: any = {}; - if (message.criticality !== undefined) { - obj.criticality = requestInfo_CriticalityToJSON(message.criticality); - } - return obj; - }, - - create, I>>(base?: I): RequestInfo_RequestQoS { - return RequestInfo_RequestQoS.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RequestInfo_RequestQoS { - const message = createBaseRequestInfo_RequestQoS(); - message.criticality = object.criticality ?? undefined; - return message; - }, }; function createBaseRequestInfo_SessionInfo(): RequestInfo_SessionInfo { @@ -559,27 +374,6 @@ export const RequestInfo_SessionInfo: MessageFns = { } return message; }, - - fromJSON(object: any): RequestInfo_SessionInfo { - return { token: isSet(object.token) ? globalThis.String(object.token) : undefined }; - }, - - toJSON(message: RequestInfo_SessionInfo): unknown { - const obj: any = {}; - if (message.token !== undefined) { - obj.token = message.token; - } - return obj; - }, - - create, I>>(base?: I): RequestInfo_SessionInfo { - return RequestInfo_SessionInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): RequestInfo_SessionInfo { - const message = createBaseRequestInfo_SessionInfo(); - message.token = object.token ?? undefined; - return message; - }, }; function createBaseRequestInfo_ReauthRequestInfo(): RequestInfo_ReauthRequestInfo { @@ -616,73 +410,9 @@ export const RequestInfo_ReauthRequestInfo: MessageFns, I>>(base?: I): RequestInfo_ReauthRequestInfo { - return RequestInfo_ReauthRequestInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): RequestInfo_ReauthRequestInfo { - const message = createBaseRequestInfo_ReauthRequestInfo(); - message.encodedReauthProofToken = object.encodedReauthProofToken ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/service_integrity_dimensions.ts b/protos/generated/youtube/api/pfiinnertube/service_integrity_dimensions.ts index 077e46fa..84616fec 100644 --- a/protos/generated/youtube/api/pfiinnertube/service_integrity_dimensions.ts +++ b/protos/generated/youtube/api/pfiinnertube/service_integrity_dimensions.ts @@ -47,67 +47,9 @@ export const ServiceIntegrityDimensions: MessageFns } return message; }, - - fromJSON(object: any): ServiceIntegrityDimensions { - return { poToken: isSet(object.poToken) ? bytesFromBase64(object.poToken) : undefined }; - }, - - toJSON(message: ServiceIntegrityDimensions): unknown { - const obj: any = {}; - if (message.poToken !== undefined) { - obj.poToken = base64FromBytes(message.poToken); - } - return obj; - }, - - create, I>>(base?: I): ServiceIntegrityDimensions { - return ServiceIntegrityDimensions.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ServiceIntegrityDimensions { - const message = createBaseServiceIntegrityDimensions(); - message.poToken = object.poToken ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/third_party_info.ts b/protos/generated/youtube/api/pfiinnertube/third_party_info.ts index 8d673d6b..4574738f 100644 --- a/protos/generated/youtube/api/pfiinnertube/third_party_info.ts +++ b/protos/generated/youtube/api/pfiinnertube/third_party_info.ts @@ -115,59 +115,6 @@ export const ThirdPartyInfo: MessageFns = { } return message; }, - - fromJSON(object: any): ThirdPartyInfo { - return { - developerKey: isSet(object.developerKey) ? globalThis.String(object.developerKey) : undefined, - appName: isSet(object.appName) ? globalThis.String(object.appName) : undefined, - appPublisher: isSet(object.appPublisher) ? globalThis.String(object.appPublisher) : undefined, - embedUrl: isSet(object.embedUrl) ? globalThis.String(object.embedUrl) : undefined, - appVersion: isSet(object.appVersion) ? globalThis.String(object.appVersion) : undefined, - embeddedPlayerContext: isSet(object.embeddedPlayerContext) - ? ThirdPartyInfo_EmbeddedPlayerContext.fromJSON(object.embeddedPlayerContext) - : undefined, - }; - }, - - toJSON(message: ThirdPartyInfo): unknown { - const obj: any = {}; - if (message.developerKey !== undefined) { - obj.developerKey = message.developerKey; - } - if (message.appName !== undefined) { - obj.appName = message.appName; - } - if (message.appPublisher !== undefined) { - obj.appPublisher = message.appPublisher; - } - if (message.embedUrl !== undefined) { - obj.embedUrl = message.embedUrl; - } - if (message.appVersion !== undefined) { - obj.appVersion = message.appVersion; - } - if (message.embeddedPlayerContext !== undefined) { - obj.embeddedPlayerContext = ThirdPartyInfo_EmbeddedPlayerContext.toJSON(message.embeddedPlayerContext); - } - return obj; - }, - - create, I>>(base?: I): ThirdPartyInfo { - return ThirdPartyInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): ThirdPartyInfo { - const message = createBaseThirdPartyInfo(); - message.developerKey = object.developerKey ?? undefined; - message.appName = object.appName ?? undefined; - message.appPublisher = object.appPublisher ?? undefined; - message.embedUrl = object.embedUrl ?? undefined; - message.appVersion = object.appVersion ?? undefined; - message.embeddedPlayerContext = - (object.embeddedPlayerContext !== undefined && object.embeddedPlayerContext !== null) - ? ThirdPartyInfo_EmbeddedPlayerContext.fromPartial(object.embeddedPlayerContext) - : undefined; - return message; - }, }; function createBaseThirdPartyInfo_EmbeddedPlayerContext(): ThirdPartyInfo_EmbeddedPlayerContext { @@ -224,70 +171,9 @@ export const ThirdPartyInfo_EmbeddedPlayerContext: MessageFns, I>>( - base?: I, - ): ThirdPartyInfo_EmbeddedPlayerContext { - return ThirdPartyInfo_EmbeddedPlayerContext.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): ThirdPartyInfo_EmbeddedPlayerContext { - const message = createBaseThirdPartyInfo_EmbeddedPlayerContext(); - message.ancestorOrigins = object.ancestorOrigins ?? undefined; - message.embeddedPlayerEncryptedContext = object.embeddedPlayerEncryptedContext ?? undefined; - message.ancestorOriginsSupported = object.ancestorOriginsSupported ?? undefined; - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/user_info.ts b/protos/generated/youtube/api/pfiinnertube/user_info.ts index 8cc35565..8eddbc29 100644 --- a/protos/generated/youtube/api/pfiinnertube/user_info.ts +++ b/protos/generated/youtube/api/pfiinnertube/user_info.ts @@ -157,86 +157,6 @@ export const UserInfo: MessageFns = { } return message; }, - - fromJSON(object: any): UserInfo { - return { - onBehalfOfUser: isSet(object.onBehalfOfUser) ? globalThis.String(object.onBehalfOfUser) : undefined, - enableSafetyMode: isSet(object.enableSafetyMode) ? globalThis.Boolean(object.enableSafetyMode) : undefined, - credentialTransferTokens: globalThis.Array.isArray(object?.credentialTransferTokens) - ? object.credentialTransferTokens.map((e: any) => UserInfo_CredentialTransferToken.fromJSON(e)) - : [], - delegatePurchases: isSet(object.delegatePurchases) - ? UserInfo_DelegatePurchases.fromJSON(object.delegatePurchases) - : undefined, - kidsParent: isSet(object.kidsParent) ? UserInfo_KidsParent.fromJSON(object.kidsParent) : undefined, - isIncognito: isSet(object.isIncognito) ? globalThis.Boolean(object.isIncognito) : undefined, - lockedSafetyMode: isSet(object.lockedSafetyMode) ? globalThis.Boolean(object.lockedSafetyMode) : undefined, - delegationContext: isSet(object.delegationContext) - ? UserInfo_DelegationContext.fromJSON(object.delegationContext) - : undefined, - serializedDelegationContext: isSet(object.serializedDelegationContext) - ? globalThis.String(object.serializedDelegationContext) - : undefined, - }; - }, - - toJSON(message: UserInfo): unknown { - const obj: any = {}; - if (message.onBehalfOfUser !== undefined) { - obj.onBehalfOfUser = message.onBehalfOfUser; - } - if (message.enableSafetyMode !== undefined) { - obj.enableSafetyMode = message.enableSafetyMode; - } - if (message.credentialTransferTokens?.length) { - obj.credentialTransferTokens = message.credentialTransferTokens.map((e) => - UserInfo_CredentialTransferToken.toJSON(e) - ); - } - if (message.delegatePurchases !== undefined) { - obj.delegatePurchases = UserInfo_DelegatePurchases.toJSON(message.delegatePurchases); - } - if (message.kidsParent !== undefined) { - obj.kidsParent = UserInfo_KidsParent.toJSON(message.kidsParent); - } - if (message.isIncognito !== undefined) { - obj.isIncognito = message.isIncognito; - } - if (message.lockedSafetyMode !== undefined) { - obj.lockedSafetyMode = message.lockedSafetyMode; - } - if (message.delegationContext !== undefined) { - obj.delegationContext = UserInfo_DelegationContext.toJSON(message.delegationContext); - } - if (message.serializedDelegationContext !== undefined) { - obj.serializedDelegationContext = message.serializedDelegationContext; - } - return obj; - }, - - create, I>>(base?: I): UserInfo { - return UserInfo.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UserInfo { - const message = createBaseUserInfo(); - message.onBehalfOfUser = object.onBehalfOfUser ?? undefined; - message.enableSafetyMode = object.enableSafetyMode ?? undefined; - message.credentialTransferTokens = - object.credentialTransferTokens?.map((e) => UserInfo_CredentialTransferToken.fromPartial(e)) || []; - message.delegatePurchases = (object.delegatePurchases !== undefined && object.delegatePurchases !== null) - ? UserInfo_DelegatePurchases.fromPartial(object.delegatePurchases) - : undefined; - message.kidsParent = (object.kidsParent !== undefined && object.kidsParent !== null) - ? UserInfo_KidsParent.fromPartial(object.kidsParent) - : undefined; - message.isIncognito = object.isIncognito ?? undefined; - message.lockedSafetyMode = object.lockedSafetyMode ?? undefined; - message.delegationContext = (object.delegationContext !== undefined && object.delegationContext !== null) - ? UserInfo_DelegationContext.fromPartial(object.delegationContext) - : undefined; - message.serializedDelegationContext = object.serializedDelegationContext ?? undefined; - return message; - }, }; function createBaseUserInfo_KidsParent(): UserInfo_KidsParent { @@ -263,23 +183,6 @@ export const UserInfo_KidsParent: MessageFns = { } return message; }, - - fromJSON(_: any): UserInfo_KidsParent { - return {}; - }, - - toJSON(_: UserInfo_KidsParent): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>(base?: I): UserInfo_KidsParent { - return UserInfo_KidsParent.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(_: I): UserInfo_KidsParent { - const message = createBaseUserInfo_KidsParent(); - return message; - }, }; function createBaseUserInfo_DelegatePurchases(): UserInfo_DelegatePurchases { @@ -306,23 +209,6 @@ export const UserInfo_DelegatePurchases: MessageFns } return message; }, - - fromJSON(_: any): UserInfo_DelegatePurchases { - return {}; - }, - - toJSON(_: UserInfo_DelegatePurchases): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>(base?: I): UserInfo_DelegatePurchases { - return UserInfo_DelegatePurchases.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(_: I): UserInfo_DelegatePurchases { - const message = createBaseUserInfo_DelegatePurchases(); - return message; - }, }; function createBaseUserInfo_DelegationContext(): UserInfo_DelegationContext { @@ -349,23 +235,6 @@ export const UserInfo_DelegationContext: MessageFns } return message; }, - - fromJSON(_: any): UserInfo_DelegationContext { - return {}; - }, - - toJSON(_: UserInfo_DelegationContext): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>(base?: I): UserInfo_DelegationContext { - return UserInfo_DelegationContext.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(_: I): UserInfo_DelegationContext { - const message = createBaseUserInfo_DelegationContext(); - return message; - }, }; function createBaseUserInfo_CredentialTransferToken(): UserInfo_CredentialTransferToken { @@ -392,50 +261,9 @@ export const UserInfo_CredentialTransferToken: MessageFns, I>>( - base?: I, - ): UserInfo_CredentialTransferToken { - return UserInfo_CredentialTransferToken.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - _: I, - ): UserInfo_CredentialTransferToken { - const message = createBaseUserInfo_CredentialTransferToken(); - return message; - }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; } diff --git a/protos/generated/youtube/api/pfiinnertube/watch_next_request.ts b/protos/generated/youtube/api/pfiinnertube/watch_next_request.ts index 305ae950..8a140327 100644 --- a/protos/generated/youtube/api/pfiinnertube/watch_next_request.ts +++ b/protos/generated/youtube/api/pfiinnertube/watch_next_request.ts @@ -386,227 +386,9 @@ export const WatchNextRequest: MessageFns = { } return message; }, - - fromJSON(object: any): WatchNextRequest { - return { - context: isSet(object.context) ? InnerTubeContext.fromJSON(object.context) : undefined, - videoId: isSet(object.videoId) ? globalThis.String(object.videoId) : undefined, - playlistId: isSet(object.playlistId) ? globalThis.String(object.playlistId) : undefined, - params: isSet(object.params) ? globalThis.String(object.params) : undefined, - continuation: isSet(object.continuation) ? globalThis.String(object.continuation) : undefined, - isAdPlayback: isSet(object.isAdPlayback) ? globalThis.Boolean(object.isAdPlayback) : undefined, - mdxUseDevServer: isSet(object.mdxUseDevServer) ? globalThis.Boolean(object.mdxUseDevServer) : undefined, - referrer: isSet(object.referrer) ? globalThis.String(object.referrer) : undefined, - referringApp: isSet(object.referringApp) ? globalThis.String(object.referringApp) : undefined, - adParams: isSet(object.adParams) ? globalThis.String(object.adParams) : undefined, - requestMusicSequence: isSet(object.requestMusicSequence) - ? globalThis.Boolean(object.requestMusicSequence) - : undefined, - enableMdxAutoplay: isSet(object.enableMdxAutoplay) ? globalThis.Boolean(object.enableMdxAutoplay) : undefined, - isMdxPlayback: isSet(object.isMdxPlayback) ? globalThis.Boolean(object.isMdxPlayback) : undefined, - racyCheckOk: isSet(object.racyCheckOk) ? globalThis.Boolean(object.racyCheckOk) : undefined, - contentCheckOk: isSet(object.contentCheckOk) ? globalThis.Boolean(object.contentCheckOk) : undefined, - isAudioOnly: isSet(object.isAudioOnly) ? globalThis.Boolean(object.isAudioOnly) : undefined, - autonavEnabled: isSet(object.autonavEnabled) ? globalThis.Boolean(object.autonavEnabled) : undefined, - enablePersistentPlaylistPanel: isSet(object.enablePersistentPlaylistPanel) - ? globalThis.Boolean(object.enablePersistentPlaylistPanel) - : undefined, - playlistSetVideoId: isSet(object.playlistSetVideoId) ? globalThis.String(object.playlistSetVideoId) : undefined, - showRuInvalidTokenMessage: isSet(object.showRuInvalidTokenMessage) - ? globalThis.Boolean(object.showRuInvalidTokenMessage) - : undefined, - serializedThirdPartyEmbedConfig: isSet(object.serializedThirdPartyEmbedConfig) - ? globalThis.String(object.serializedThirdPartyEmbedConfig) - : undefined, - showContentOwnerOnly: isSet(object.showContentOwnerOnly) - ? globalThis.Boolean(object.showContentOwnerOnly) - : undefined, - isEmbedPreview: isSet(object.isEmbedPreview) ? globalThis.Boolean(object.isEmbedPreview) : undefined, - lastScrubbedInlinePlaybackVideoId: isSet(object.lastScrubbedInlinePlaybackVideoId) - ? globalThis.String(object.lastScrubbedInlinePlaybackVideoId) - : undefined, - lastAudioTurnedOnInlinePlaybackVideoId: isSet(object.lastAudioTurnedOnInlinePlaybackVideoId) - ? globalThis.String(object.lastAudioTurnedOnInlinePlaybackVideoId) - : undefined, - lastAudioTurnedOffInlinePlaybackVideoId: isSet(object.lastAudioTurnedOffInlinePlaybackVideoId) - ? globalThis.String(object.lastAudioTurnedOffInlinePlaybackVideoId) - : undefined, - captionsRequested: isSet(object.captionsRequested) ? globalThis.Boolean(object.captionsRequested) : undefined, - queueContextParams: isSet(object.queueContextParams) ? bytesFromBase64(object.queueContextParams) : undefined, - showShortsOnly: isSet(object.showShortsOnly) ? globalThis.Boolean(object.showShortsOnly) : undefined, - }; - }, - - toJSON(message: WatchNextRequest): unknown { - const obj: any = {}; - if (message.context !== undefined) { - obj.context = InnerTubeContext.toJSON(message.context); - } - if (message.videoId !== undefined) { - obj.videoId = message.videoId; - } - if (message.playlistId !== undefined) { - obj.playlistId = message.playlistId; - } - if (message.params !== undefined) { - obj.params = message.params; - } - if (message.continuation !== undefined) { - obj.continuation = message.continuation; - } - if (message.isAdPlayback !== undefined) { - obj.isAdPlayback = message.isAdPlayback; - } - if (message.mdxUseDevServer !== undefined) { - obj.mdxUseDevServer = message.mdxUseDevServer; - } - if (message.referrer !== undefined) { - obj.referrer = message.referrer; - } - if (message.referringApp !== undefined) { - obj.referringApp = message.referringApp; - } - if (message.adParams !== undefined) { - obj.adParams = message.adParams; - } - if (message.requestMusicSequence !== undefined) { - obj.requestMusicSequence = message.requestMusicSequence; - } - if (message.enableMdxAutoplay !== undefined) { - obj.enableMdxAutoplay = message.enableMdxAutoplay; - } - if (message.isMdxPlayback !== undefined) { - obj.isMdxPlayback = message.isMdxPlayback; - } - if (message.racyCheckOk !== undefined) { - obj.racyCheckOk = message.racyCheckOk; - } - if (message.contentCheckOk !== undefined) { - obj.contentCheckOk = message.contentCheckOk; - } - if (message.isAudioOnly !== undefined) { - obj.isAudioOnly = message.isAudioOnly; - } - if (message.autonavEnabled !== undefined) { - obj.autonavEnabled = message.autonavEnabled; - } - if (message.enablePersistentPlaylistPanel !== undefined) { - obj.enablePersistentPlaylistPanel = message.enablePersistentPlaylistPanel; - } - if (message.playlistSetVideoId !== undefined) { - obj.playlistSetVideoId = message.playlistSetVideoId; - } - if (message.showRuInvalidTokenMessage !== undefined) { - obj.showRuInvalidTokenMessage = message.showRuInvalidTokenMessage; - } - if (message.serializedThirdPartyEmbedConfig !== undefined) { - obj.serializedThirdPartyEmbedConfig = message.serializedThirdPartyEmbedConfig; - } - if (message.showContentOwnerOnly !== undefined) { - obj.showContentOwnerOnly = message.showContentOwnerOnly; - } - if (message.isEmbedPreview !== undefined) { - obj.isEmbedPreview = message.isEmbedPreview; - } - if (message.lastScrubbedInlinePlaybackVideoId !== undefined) { - obj.lastScrubbedInlinePlaybackVideoId = message.lastScrubbedInlinePlaybackVideoId; - } - if (message.lastAudioTurnedOnInlinePlaybackVideoId !== undefined) { - obj.lastAudioTurnedOnInlinePlaybackVideoId = message.lastAudioTurnedOnInlinePlaybackVideoId; - } - if (message.lastAudioTurnedOffInlinePlaybackVideoId !== undefined) { - obj.lastAudioTurnedOffInlinePlaybackVideoId = message.lastAudioTurnedOffInlinePlaybackVideoId; - } - if (message.captionsRequested !== undefined) { - obj.captionsRequested = message.captionsRequested; - } - if (message.queueContextParams !== undefined) { - obj.queueContextParams = base64FromBytes(message.queueContextParams); - } - if (message.showShortsOnly !== undefined) { - obj.showShortsOnly = message.showShortsOnly; - } - return obj; - }, - - create, I>>(base?: I): WatchNextRequest { - return WatchNextRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): WatchNextRequest { - const message = createBaseWatchNextRequest(); - message.context = (object.context !== undefined && object.context !== null) - ? InnerTubeContext.fromPartial(object.context) - : undefined; - message.videoId = object.videoId ?? undefined; - message.playlistId = object.playlistId ?? undefined; - message.params = object.params ?? undefined; - message.continuation = object.continuation ?? undefined; - message.isAdPlayback = object.isAdPlayback ?? undefined; - message.mdxUseDevServer = object.mdxUseDevServer ?? undefined; - message.referrer = object.referrer ?? undefined; - message.referringApp = object.referringApp ?? undefined; - message.adParams = object.adParams ?? undefined; - message.requestMusicSequence = object.requestMusicSequence ?? undefined; - message.enableMdxAutoplay = object.enableMdxAutoplay ?? undefined; - message.isMdxPlayback = object.isMdxPlayback ?? undefined; - message.racyCheckOk = object.racyCheckOk ?? undefined; - message.contentCheckOk = object.contentCheckOk ?? undefined; - message.isAudioOnly = object.isAudioOnly ?? undefined; - message.autonavEnabled = object.autonavEnabled ?? undefined; - message.enablePersistentPlaylistPanel = object.enablePersistentPlaylistPanel ?? undefined; - message.playlistSetVideoId = object.playlistSetVideoId ?? undefined; - message.showRuInvalidTokenMessage = object.showRuInvalidTokenMessage ?? undefined; - message.serializedThirdPartyEmbedConfig = object.serializedThirdPartyEmbedConfig ?? undefined; - message.showContentOwnerOnly = object.showContentOwnerOnly ?? undefined; - message.isEmbedPreview = object.isEmbedPreview ?? undefined; - message.lastScrubbedInlinePlaybackVideoId = object.lastScrubbedInlinePlaybackVideoId ?? undefined; - message.lastAudioTurnedOnInlinePlaybackVideoId = object.lastAudioTurnedOnInlinePlaybackVideoId ?? undefined; - message.lastAudioTurnedOffInlinePlaybackVideoId = object.lastAudioTurnedOffInlinePlaybackVideoId ?? undefined; - message.captionsRequested = object.captionsRequested ?? undefined; - message.queueContextParams = object.queueContextParams ?? undefined; - message.showShortsOnly = object.showShortsOnly ?? undefined; - return message; - }, }; -function bytesFromBase64(b64: string): Uint8Array { - const bin = globalThis.atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); - } - return arr; -} - -function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(globalThis.String.fromCharCode(byte)); - }); - return globalThis.btoa(bin.join("")); -} - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; - fromJSON(object: any): T; - toJSON(message: T): unknown; - create, I>>(base?: I): T; - fromPartial, I>>(object: I): T; }