// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.2.0
//   protoc               v5.28.0
// source: youtube/api/pfiinnertube/third_party_info.proto

/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";

export const protobufPackage = "youtube.api.pfiinnertube";

export interface ThirdPartyInfo {
  developerKey?: string | undefined;
  appName?: string | undefined;
  appPublisher?: string | undefined;
  embedUrl?: string | undefined;
  appVersion?: string | undefined;
  embeddedPlayerContext?: ThirdPartyInfo_EmbeddedPlayerContext | undefined;
}

export interface ThirdPartyInfo_EmbeddedPlayerContext {
  ancestorOrigins?: string | undefined;
  embeddedPlayerEncryptedContext?: string | undefined;
  ancestorOriginsSupported?: boolean | undefined;
}

function createBaseThirdPartyInfo(): ThirdPartyInfo {
  return {
    developerKey: undefined,
    appName: undefined,
    appPublisher: undefined,
    embedUrl: undefined,
    appVersion: undefined,
    embeddedPlayerContext: undefined,
  };
}

export const ThirdPartyInfo: MessageFns<ThirdPartyInfo> = {
  encode(message: ThirdPartyInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
    if (message.developerKey !== undefined) {
      writer.uint32(10).string(message.developerKey);
    }
    if (message.appName !== undefined) {
      writer.uint32(18).string(message.appName);
    }
    if (message.appPublisher !== undefined) {
      writer.uint32(26).string(message.appPublisher);
    }
    if (message.embedUrl !== undefined) {
      writer.uint32(34).string(message.embedUrl);
    }
    if (message.appVersion !== undefined) {
      writer.uint32(50).string(message.appVersion);
    }
    if (message.embeddedPlayerContext !== undefined) {
      ThirdPartyInfo_EmbeddedPlayerContext.encode(message.embeddedPlayerContext, writer.uint32(58).fork()).join();
    }
    return writer;
  },

  decode(input: BinaryReader | Uint8Array, length?: number): ThirdPartyInfo {
    const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseThirdPartyInfo();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          if (tag !== 10) {
            break;
          }

          message.developerKey = reader.string();
          continue;
        case 2:
          if (tag !== 18) {
            break;
          }

          message.appName = reader.string();
          continue;
        case 3:
          if (tag !== 26) {
            break;
          }

          message.appPublisher = reader.string();
          continue;
        case 4:
          if (tag !== 34) {
            break;
          }

          message.embedUrl = reader.string();
          continue;
        case 6:
          if (tag !== 50) {
            break;
          }

          message.appVersion = reader.string();
          continue;
        case 7:
          if (tag !== 58) {
            break;
          }

          message.embeddedPlayerContext = ThirdPartyInfo_EmbeddedPlayerContext.decode(reader, reader.uint32());
          continue;
      }
      if ((tag & 7) === 4 || tag === 0) {
        break;
      }
      reader.skip(tag & 7);
    }
    return message;
  },
};

function createBaseThirdPartyInfo_EmbeddedPlayerContext(): ThirdPartyInfo_EmbeddedPlayerContext {
  return { ancestorOrigins: undefined, embeddedPlayerEncryptedContext: undefined, ancestorOriginsSupported: undefined };
}

export const ThirdPartyInfo_EmbeddedPlayerContext: MessageFns<ThirdPartyInfo_EmbeddedPlayerContext> = {
  encode(message: ThirdPartyInfo_EmbeddedPlayerContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
    if (message.ancestorOrigins !== undefined) {
      writer.uint32(10).string(message.ancestorOrigins);
    }
    if (message.embeddedPlayerEncryptedContext !== undefined) {
      writer.uint32(18).string(message.embeddedPlayerEncryptedContext);
    }
    if (message.ancestorOriginsSupported !== undefined) {
      writer.uint32(24).bool(message.ancestorOriginsSupported);
    }
    return writer;
  },

  decode(input: BinaryReader | Uint8Array, length?: number): ThirdPartyInfo_EmbeddedPlayerContext {
    const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseThirdPartyInfo_EmbeddedPlayerContext();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          if (tag !== 10) {
            break;
          }

          message.ancestorOrigins = reader.string();
          continue;
        case 2:
          if (tag !== 18) {
            break;
          }

          message.embeddedPlayerEncryptedContext = reader.string();
          continue;
        case 3:
          if (tag !== 24) {
            break;
          }

          message.ancestorOriginsSupported = reader.bool();
          continue;
      }
      if ((tag & 7) === 4 || tag === 0) {
        break;
      }
      reader.skip(tag & 7);
    }
    return message;
  },
};

export interface MessageFns<T> {
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
  decode(input: BinaryReader | Uint8Array, length?: number): T;
}
