// Author: fengshengxiong
// Date: 2024/6/23
// Description: next模型

import 'dart:convert';

class NextModel {
  ResponseContext? responseContext;
  Contents? contents;
  CurrentVideoEndpoint? currentVideoEndpoint;
  String? trackingParams;
  PlayerOverlays? playerOverlays;
  VideoReporting? videoReporting;
  String? queueContextParams;

  NextModel({
    this.responseContext,
    this.contents,
    this.currentVideoEndpoint,
    this.trackingParams,
    this.playerOverlays,
    this.videoReporting,
    this.queueContextParams,
  });

  factory NextModel.fromJson(String str) => NextModel.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory NextModel.fromMap(Map<String, dynamic> json) => NextModel(
    responseContext: json["responseContext"] == null ? null : ResponseContext.fromMap(json["responseContext"]),
    contents: json["contents"] == null ? null : Contents.fromMap(json["contents"]),
    currentVideoEndpoint: json["currentVideoEndpoint"] == null ? null : CurrentVideoEndpoint.fromMap(json["currentVideoEndpoint"]),
    trackingParams: json["trackingParams"],
    playerOverlays: json["playerOverlays"] == null ? null : PlayerOverlays.fromMap(json["playerOverlays"]),
    videoReporting: json["videoReporting"] == null ? null : VideoReporting.fromMap(json["videoReporting"]),
    queueContextParams: json["queueContextParams"],
  );

  Map<String, dynamic> toMap() => {
    "responseContext": responseContext?.toMap(),
    "contents": contents?.toMap(),
    "currentVideoEndpoint": currentVideoEndpoint?.toMap(),
    "trackingParams": trackingParams,
    "playerOverlays": playerOverlays?.toMap(),
    "videoReporting": videoReporting?.toMap(),
    "queueContextParams": queueContextParams,
  };
}

class Contents {
  SingleColumnMusicWatchNextResultsRenderer? singleColumnMusicWatchNextResultsRenderer;

  Contents({
    this.singleColumnMusicWatchNextResultsRenderer,
  });

  factory Contents.fromJson(String str) => Contents.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Contents.fromMap(Map<String, dynamic> json) => Contents(
    singleColumnMusicWatchNextResultsRenderer: json["singleColumnMusicWatchNextResultsRenderer"] == null ? null : SingleColumnMusicWatchNextResultsRenderer.fromMap(json["singleColumnMusicWatchNextResultsRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "singleColumnMusicWatchNextResultsRenderer": singleColumnMusicWatchNextResultsRenderer?.toMap(),
  };
}

class SingleColumnMusicWatchNextResultsRenderer {
  TabbedRenderer? tabbedRenderer;

  SingleColumnMusicWatchNextResultsRenderer({
    this.tabbedRenderer,
  });

  factory SingleColumnMusicWatchNextResultsRenderer.fromJson(String str) => SingleColumnMusicWatchNextResultsRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory SingleColumnMusicWatchNextResultsRenderer.fromMap(Map<String, dynamic> json) => SingleColumnMusicWatchNextResultsRenderer(
    tabbedRenderer: json["tabbedRenderer"] == null ? null : TabbedRenderer.fromMap(json["tabbedRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "tabbedRenderer": tabbedRenderer?.toMap(),
  };
}

class TabbedRenderer {
  WatchNextTabbedResultsRenderer? watchNextTabbedResultsRenderer;

  TabbedRenderer({
    this.watchNextTabbedResultsRenderer,
  });

  factory TabbedRenderer.fromJson(String str) => TabbedRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory TabbedRenderer.fromMap(Map<String, dynamic> json) => TabbedRenderer(
    watchNextTabbedResultsRenderer: json["watchNextTabbedResultsRenderer"] == null ? null : WatchNextTabbedResultsRenderer.fromMap(json["watchNextTabbedResultsRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "watchNextTabbedResultsRenderer": watchNextTabbedResultsRenderer?.toMap(),
  };
}

class WatchNextTabbedResultsRenderer {
  List<Tab>? tabs;

  WatchNextTabbedResultsRenderer({
    this.tabs,
  });

  factory WatchNextTabbedResultsRenderer.fromJson(String str) => WatchNextTabbedResultsRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory WatchNextTabbedResultsRenderer.fromMap(Map<String, dynamic> json) => WatchNextTabbedResultsRenderer(
    tabs: json["tabs"] == null ? [] : List<Tab>.from(json["tabs"]!.map((x) => Tab.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "tabs": tabs == null ? [] : List<dynamic>.from(tabs!.map((x) => x.toMap())),
  };
}

class Tab {
  TabRenderer? tabRenderer;

  Tab({
    this.tabRenderer,
  });

  factory Tab.fromJson(String str) => Tab.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Tab.fromMap(Map<String, dynamic> json) => Tab(
    tabRenderer: json["tabRenderer"] == null ? null : TabRenderer.fromMap(json["tabRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "tabRenderer": tabRenderer?.toMap(),
  };
}

class TabRenderer {
  String? title;
  TabRendererContent? content;
  String? trackingParams;
  Endpoint? endpoint;

  TabRenderer({
    this.title,
    this.content,
    this.trackingParams,
    this.endpoint,
  });

  factory TabRenderer.fromJson(String str) => TabRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory TabRenderer.fromMap(Map<String, dynamic> json) => TabRenderer(
    title: json["title"],
    content: json["content"] == null ? null : TabRendererContent.fromMap(json["content"]),
    trackingParams: json["trackingParams"],
    endpoint: json["endpoint"] == null ? null : Endpoint.fromMap(json["endpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "title": title,
    "content": content?.toMap(),
    "trackingParams": trackingParams,
    "endpoint": endpoint?.toMap(),
  };
}

class TabRendererContent {
  MusicQueueRenderer? musicQueueRenderer;

  TabRendererContent({
    this.musicQueueRenderer,
  });

  factory TabRendererContent.fromJson(String str) => TabRendererContent.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory TabRendererContent.fromMap(Map<String, dynamic> json) => TabRendererContent(
    musicQueueRenderer: json["musicQueueRenderer"] == null ? null : MusicQueueRenderer.fromMap(json["musicQueueRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "musicQueueRenderer": musicQueueRenderer?.toMap(),
  };
}

class MusicQueueRenderer {
  MusicQueueRendererContent? content;
  bool? hack;
  Header? header;
  SubHeaderChipCloud? subHeaderChipCloud;

  MusicQueueRenderer({
    this.content,
    this.hack,
    this.header,
    this.subHeaderChipCloud,
  });

  factory MusicQueueRenderer.fromJson(String str) => MusicQueueRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MusicQueueRenderer.fromMap(Map<String, dynamic> json) => MusicQueueRenderer(
    content: json["content"] == null ? null : MusicQueueRendererContent.fromMap(json["content"]),
    hack: json["hack"],
    header: json["header"] == null ? null : Header.fromMap(json["header"]),
    subHeaderChipCloud: json["subHeaderChipCloud"] == null ? null : SubHeaderChipCloud.fromMap(json["subHeaderChipCloud"]),
  );

  Map<String, dynamic> toMap() => {
    "content": content?.toMap(),
    "hack": hack,
    "header": header?.toMap(),
    "subHeaderChipCloud": subHeaderChipCloud?.toMap(),
  };
}

class MusicQueueRendererContent {
  PlaylistPanelRenderer? playlistPanelRenderer;

  MusicQueueRendererContent({
    this.playlistPanelRenderer,
  });

  factory MusicQueueRendererContent.fromJson(String str) => MusicQueueRendererContent.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MusicQueueRendererContent.fromMap(Map<String, dynamic> json) => MusicQueueRendererContent(
    playlistPanelRenderer: json["playlistPanelRenderer"] == null ? null : PlaylistPanelRenderer.fromMap(json["playlistPanelRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "playlistPanelRenderer": playlistPanelRenderer?.toMap(),
  };
}

class PlaylistPanelRenderer {
  String? title;
  List<ContentElement>? contents;
  String? playlistId;
  bool? isInfinite;
  List<Continuation>? continuations;
  Title? shortBylineText;
  String? trackingParams;
  Title? titleText;
  PreviewDescription? previewDescription;
  int? numItemsToShow;

  PlaylistPanelRenderer({
    this.title,
    this.contents,
    this.playlistId,
    this.isInfinite,
    this.continuations,
    this.shortBylineText,
    this.trackingParams,
    this.titleText,
    this.previewDescription,
    this.numItemsToShow,
  });

  factory PlaylistPanelRenderer.fromJson(String str) => PlaylistPanelRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PlaylistPanelRenderer.fromMap(Map<String, dynamic> json) => PlaylistPanelRenderer(
    title: json["title"],
    contents: json["contents"] == null ? [] : List<ContentElement>.from(json["contents"]!.map((x) => ContentElement.fromMap(x))),
    playlistId: json["playlistId"],
    isInfinite: json["isInfinite"],
    continuations: json["continuations"] == null ? [] : List<Continuation>.from(json["continuations"]!.map((x) => Continuation.fromMap(x))),
    shortBylineText: json["shortBylineText"] == null ? null : Title.fromMap(json["shortBylineText"]),
    trackingParams: json["trackingParams"],
    titleText: json["titleText"] == null ? null : Title.fromMap(json["titleText"]),
    previewDescription: json["previewDescription"] == null ? null : PreviewDescription.fromMap(json["previewDescription"]),
    numItemsToShow: json["numItemsToShow"],
  );

  Map<String, dynamic> toMap() => {
    "title": title,
    "contents": contents == null ? [] : List<dynamic>.from(contents!.map((x) => x.toMap())),
    "playlistId": playlistId,
    "isInfinite": isInfinite,
    "continuations": continuations == null ? [] : List<dynamic>.from(continuations!.map((x) => x.toMap())),
    "shortBylineText": shortBylineText?.toMap(),
    "trackingParams": trackingParams,
    "titleText": titleText?.toMap(),
    "previewDescription": previewDescription?.toMap(),
    "numItemsToShow": numItemsToShow,
  };
}

class ContentElement {
  PlaylistPanelVideoRenderer? playlistPanelVideoRenderer;

  ContentElement({
    this.playlistPanelVideoRenderer,
  });

  factory ContentElement.fromJson(String str) => ContentElement.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ContentElement.fromMap(Map<String, dynamic> json) => ContentElement(
    playlistPanelVideoRenderer: json["playlistPanelVideoRenderer"] == null ? null : PlaylistPanelVideoRenderer.fromMap(json["playlistPanelVideoRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "playlistPanelVideoRenderer": playlistPanelVideoRenderer?.toMap(),
  };
}

class PlaylistPanelVideoRenderer {
  Title? title;
  LongBylineText? longBylineText;
  ThumbnailDetailsClass? thumbnail;
  LengthText? lengthText;
  bool? selected;
  PlaylistPanelVideoRendererNavigationEndpoint? navigationEndpoint;
  String? videoId;
  Title? shortBylineText;
  String? trackingParams;
  Menu? menu;
  String? playlistSetVideoId;
  bool? canReorder;

  PlaylistPanelVideoRenderer({
    this.title,
    this.longBylineText,
    this.thumbnail,
    this.lengthText,
    this.selected,
    this.navigationEndpoint,
    this.videoId,
    this.shortBylineText,
    this.trackingParams,
    this.menu,
    this.playlistSetVideoId,
    this.canReorder,
  });

  factory PlaylistPanelVideoRenderer.fromJson(String str) => PlaylistPanelVideoRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PlaylistPanelVideoRenderer.fromMap(Map<String, dynamic> json) => PlaylistPanelVideoRenderer(
    title: json["title"] == null ? null : Title.fromMap(json["title"]),
    longBylineText: json["longBylineText"] == null ? null : LongBylineText.fromMap(json["longBylineText"]),
    thumbnail: json["thumbnail"] == null ? null : ThumbnailDetailsClass.fromMap(json["thumbnail"]),
    lengthText: json["lengthText"] == null ? null : LengthText.fromMap(json["lengthText"]),
    selected: json["selected"],
    navigationEndpoint: json["navigationEndpoint"] == null ? null : PlaylistPanelVideoRendererNavigationEndpoint.fromMap(json["navigationEndpoint"]),
    videoId: json["videoId"],
    shortBylineText: json["shortBylineText"] == null ? null : Title.fromMap(json["shortBylineText"]),
    trackingParams: json["trackingParams"],
    menu: json["menu"] == null ? null : Menu.fromMap(json["menu"]),
    playlistSetVideoId: json["playlistSetVideoId"],
    canReorder: json["canReorder"],
  );

  Map<String, dynamic> toMap() => {
    "title": title?.toMap(),
    "longBylineText": longBylineText?.toMap(),
    "thumbnail": thumbnail?.toMap(),
    "lengthText": lengthText?.toMap(),
    "selected": selected,
    "navigationEndpoint": navigationEndpoint?.toMap(),
    "videoId": videoId,
    "shortBylineText": shortBylineText?.toMap(),
    "trackingParams": trackingParams,
    "menu": menu?.toMap(),
    "playlistSetVideoId": playlistSetVideoId,
    "canReorder": canReorder,
  };
}

class LengthText {
  List<LengthTextRun>? runs;
  Accessibility? accessibility;

  LengthText({
    this.runs,
    this.accessibility,
  });

  factory LengthText.fromJson(String str) => LengthText.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LengthText.fromMap(Map<String, dynamic> json) => LengthText(
    runs: json["runs"] == null ? [] : List<LengthTextRun>.from(json["runs"]!.map((x) => LengthTextRun.fromMap(x))),
    accessibility: json["accessibility"] == null ? null : Accessibility.fromMap(json["accessibility"]),
  );

  Map<String, dynamic> toMap() => {
    "runs": runs == null ? [] : List<dynamic>.from(runs!.map((x) => x.toMap())),
    "accessibility": accessibility?.toMap(),
  };
}

class Accessibility {
  AccessibilityData? accessibilityData;

  Accessibility({
    this.accessibilityData,
  });

  factory Accessibility.fromJson(String str) => Accessibility.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Accessibility.fromMap(Map<String, dynamic> json) => Accessibility(
    accessibilityData: json["accessibilityData"] == null ? null : AccessibilityData.fromMap(json["accessibilityData"]),
  );

  Map<String, dynamic> toMap() => {
    "accessibilityData": accessibilityData?.toMap(),
  };
}

class AccessibilityData {
  String? label;

  AccessibilityData({
    this.label,
  });

  factory AccessibilityData.fromJson(String str) => AccessibilityData.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory AccessibilityData.fromMap(Map<String, dynamic> json) => AccessibilityData(
    label: json["label"],
  );

  Map<String, dynamic> toMap() => {
    "label": label,
  };
}

class LengthTextRun {
  String? text;

  LengthTextRun({
    this.text,
  });

  factory LengthTextRun.fromJson(String str) => LengthTextRun.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LengthTextRun.fromMap(Map<String, dynamic> json) => LengthTextRun(
    text: json["text"],
  );

  Map<String, dynamic> toMap() => {
    "text": text,
  };
}

class LongBylineText {
  List<LongBylineTextRun>? runs;

  LongBylineText({
    this.runs,
  });

  factory LongBylineText.fromJson(String str) => LongBylineText.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LongBylineText.fromMap(Map<String, dynamic> json) => LongBylineText(
    runs: json["runs"] == null ? [] : List<LongBylineTextRun>.from(json["runs"]!.map((x) => LongBylineTextRun.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "runs": runs == null ? [] : List<dynamic>.from(runs!.map((x) => x.toMap())),
  };
}

class LongBylineTextRun {
  String? text;
  Endpoint? navigationEndpoint;

  LongBylineTextRun({
    this.text,
    this.navigationEndpoint,
  });

  factory LongBylineTextRun.fromJson(String str) => LongBylineTextRun.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LongBylineTextRun.fromMap(Map<String, dynamic> json) => LongBylineTextRun(
    text: json["text"],
    navigationEndpoint: json["navigationEndpoint"] == null ? null : Endpoint.fromMap(json["navigationEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "text": text,
    "navigationEndpoint": navigationEndpoint?.toMap(),
  };
}

class Endpoint {
  String? clickTrackingParams;
  BrowseEndpoint? browseEndpoint;

  Endpoint({
    this.clickTrackingParams,
    this.browseEndpoint,
  });

  factory Endpoint.fromJson(String str) => Endpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Endpoint.fromMap(Map<String, dynamic> json) => Endpoint(
    clickTrackingParams: json["clickTrackingParams"],
    browseEndpoint: json["browseEndpoint"] == null ? null : BrowseEndpoint.fromMap(json["browseEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "browseEndpoint": browseEndpoint?.toMap(),
  };
}

class BrowseEndpoint {
  String? browseId;
  BrowseEndpointContextSupportedConfigs? browseEndpointContextSupportedConfigs;

  BrowseEndpoint({
    this.browseId,
    this.browseEndpointContextSupportedConfigs,
  });

  factory BrowseEndpoint.fromJson(String str) => BrowseEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory BrowseEndpoint.fromMap(Map<String, dynamic> json) => BrowseEndpoint(
    browseId: json["browseId"],
    browseEndpointContextSupportedConfigs: json["browseEndpointContextSupportedConfigs"] == null ? null : BrowseEndpointContextSupportedConfigs.fromMap(json["browseEndpointContextSupportedConfigs"]),
  );

  Map<String, dynamic> toMap() => {
    "browseId": browseId,
    "browseEndpointContextSupportedConfigs": browseEndpointContextSupportedConfigs?.toMap(),
  };
}

class BrowseEndpointContextSupportedConfigs {
  BrowseEndpointContextMusicConfig? browseEndpointContextMusicConfig;

  BrowseEndpointContextSupportedConfigs({
    this.browseEndpointContextMusicConfig,
  });

  factory BrowseEndpointContextSupportedConfigs.fromJson(String str) => BrowseEndpointContextSupportedConfigs.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory BrowseEndpointContextSupportedConfigs.fromMap(Map<String, dynamic> json) => BrowseEndpointContextSupportedConfigs(
    browseEndpointContextMusicConfig: json["browseEndpointContextMusicConfig"] == null ? null : BrowseEndpointContextMusicConfig.fromMap(json["browseEndpointContextMusicConfig"]),
  );

  Map<String, dynamic> toMap() => {
    "browseEndpointContextMusicConfig": browseEndpointContextMusicConfig?.toMap(),
  };
}

class BrowseEndpointContextMusicConfig {
  String? pageType;

  BrowseEndpointContextMusicConfig({
    this.pageType,
  });

  factory BrowseEndpointContextMusicConfig.fromJson(String str) => BrowseEndpointContextMusicConfig.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory BrowseEndpointContextMusicConfig.fromMap(Map<String, dynamic> json) => BrowseEndpointContextMusicConfig(
    pageType: json["pageType"],
  );

  Map<String, dynamic> toMap() => {
    "pageType": pageType,
  };
}

class Menu {
  MenuRenderer? menuRenderer;

  Menu({
    this.menuRenderer,
  });

  factory Menu.fromJson(String str) => Menu.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Menu.fromMap(Map<String, dynamic> json) => Menu(
    menuRenderer: json["menuRenderer"] == null ? null : MenuRenderer.fromMap(json["menuRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "menuRenderer": menuRenderer?.toMap(),
  };
}

class MenuRenderer {
  List<MenuRendererItem>? items;
  String? trackingParams;
  Accessibility? accessibility;

  MenuRenderer({
    this.items,
    this.trackingParams,
    this.accessibility,
  });

  factory MenuRenderer.fromJson(String str) => MenuRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MenuRenderer.fromMap(Map<String, dynamic> json) => MenuRenderer(
    items: json["items"] == null ? [] : List<MenuRendererItem>.from(json["items"]!.map((x) => MenuRendererItem.fromMap(x))),
    trackingParams: json["trackingParams"],
    accessibility: json["accessibility"] == null ? null : Accessibility.fromMap(json["accessibility"]),
  );

  Map<String, dynamic> toMap() => {
    "items": items == null ? [] : List<dynamic>.from(items!.map((x) => x.toMap())),
    "trackingParams": trackingParams,
    "accessibility": accessibility?.toMap(),
  };
}

class MenuRendererItem {
  MenuItemRenderer? menuNavigationItemRenderer;
  MenuItemRenderer? menuServiceItemRenderer;
  ToggleMenuServiceItemRenderer? toggleMenuServiceItemRenderer;

  MenuRendererItem({
    this.menuNavigationItemRenderer,
    this.menuServiceItemRenderer,
    this.toggleMenuServiceItemRenderer,
  });

  factory MenuRendererItem.fromJson(String str) => MenuRendererItem.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MenuRendererItem.fromMap(Map<String, dynamic> json) => MenuRendererItem(
    menuNavigationItemRenderer: json["menuNavigationItemRenderer"] == null ? null : MenuItemRenderer.fromMap(json["menuNavigationItemRenderer"]),
    menuServiceItemRenderer: json["menuServiceItemRenderer"] == null ? null : MenuItemRenderer.fromMap(json["menuServiceItemRenderer"]),
    toggleMenuServiceItemRenderer: json["toggleMenuServiceItemRenderer"] == null ? null : ToggleMenuServiceItemRenderer.fromMap(json["toggleMenuServiceItemRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "menuNavigationItemRenderer": menuNavigationItemRenderer?.toMap(),
    "menuServiceItemRenderer": menuServiceItemRenderer?.toMap(),
    "toggleMenuServiceItemRenderer": toggleMenuServiceItemRenderer?.toMap(),
  };
}

class MenuItemRenderer {
  Title? text;
  Icon? icon;
  MenuNavigationItemRendererNavigationEndpoint? navigationEndpoint;
  String? trackingParams;
  ServiceEndpoint? serviceEndpoint;

  MenuItemRenderer({
    this.text,
    this.icon,
    this.navigationEndpoint,
    this.trackingParams,
    this.serviceEndpoint,
  });

  factory MenuItemRenderer.fromJson(String str) => MenuItemRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MenuItemRenderer.fromMap(Map<String, dynamic> json) => MenuItemRenderer(
    text: json["text"] == null ? null : Title.fromMap(json["text"]),
    icon: json["icon"] == null ? null : Icon.fromMap(json["icon"]),
    navigationEndpoint: json["navigationEndpoint"] == null ? null : MenuNavigationItemRendererNavigationEndpoint.fromMap(json["navigationEndpoint"]),
    trackingParams: json["trackingParams"],
    serviceEndpoint: json["serviceEndpoint"] == null ? null : ServiceEndpoint.fromMap(json["serviceEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "text": text?.toMap(),
    "icon": icon?.toMap(),
    "navigationEndpoint": navigationEndpoint?.toMap(),
    "trackingParams": trackingParams,
    "serviceEndpoint": serviceEndpoint?.toMap(),
  };
}

class Icon {
  String? iconType;

  Icon({
    this.iconType,
  });

  factory Icon.fromJson(String str) => Icon.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Icon.fromMap(Map<String, dynamic> json) => Icon(
    iconType: json["iconType"],
  );

  Map<String, dynamic> toMap() => {
    "iconType": iconType,
  };
}

class MenuNavigationItemRendererNavigationEndpoint {
  String? clickTrackingParams;
  PurpleWatchEndpoint? watchEndpoint;
  ModalEndpoint? modalEndpoint;
  BrowseEndpoint? browseEndpoint;
  ShareEntityEndpoint? shareEntityEndpoint;

  MenuNavigationItemRendererNavigationEndpoint({
    this.clickTrackingParams,
    this.watchEndpoint,
    this.modalEndpoint,
    this.browseEndpoint,
    this.shareEntityEndpoint,
  });

  factory MenuNavigationItemRendererNavigationEndpoint.fromJson(String str) => MenuNavigationItemRendererNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MenuNavigationItemRendererNavigationEndpoint.fromMap(Map<String, dynamic> json) => MenuNavigationItemRendererNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    watchEndpoint: json["watchEndpoint"] == null ? null : PurpleWatchEndpoint.fromMap(json["watchEndpoint"]),
    modalEndpoint: json["modalEndpoint"] == null ? null : ModalEndpoint.fromMap(json["modalEndpoint"]),
    browseEndpoint: json["browseEndpoint"] == null ? null : BrowseEndpoint.fromMap(json["browseEndpoint"]),
    shareEntityEndpoint: json["shareEntityEndpoint"] == null ? null : ShareEntityEndpoint.fromMap(json["shareEntityEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
    "modalEndpoint": modalEndpoint?.toMap(),
    "browseEndpoint": browseEndpoint?.toMap(),
    "shareEntityEndpoint": shareEntityEndpoint?.toMap(),
  };
}

class ModalEndpoint {
  Modal? modal;

  ModalEndpoint({
    this.modal,
  });

  factory ModalEndpoint.fromJson(String str) => ModalEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ModalEndpoint.fromMap(Map<String, dynamic> json) => ModalEndpoint(
    modal: json["modal"] == null ? null : Modal.fromMap(json["modal"]),
  );

  Map<String, dynamic> toMap() => {
    "modal": modal?.toMap(),
  };
}

class Modal {
  ModalWithTitleAndButtonRenderer? modalWithTitleAndButtonRenderer;

  Modal({
    this.modalWithTitleAndButtonRenderer,
  });

  factory Modal.fromJson(String str) => Modal.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Modal.fromMap(Map<String, dynamic> json) => Modal(
    modalWithTitleAndButtonRenderer: json["modalWithTitleAndButtonRenderer"] == null ? null : ModalWithTitleAndButtonRenderer.fromMap(json["modalWithTitleAndButtonRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "modalWithTitleAndButtonRenderer": modalWithTitleAndButtonRenderer?.toMap(),
  };
}

class ModalWithTitleAndButtonRenderer {
  Title? title;
  Title? content;
  CancelButtonClass? button;

  ModalWithTitleAndButtonRenderer({
    this.title,
    this.content,
    this.button,
  });

  factory ModalWithTitleAndButtonRenderer.fromJson(String str) => ModalWithTitleAndButtonRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ModalWithTitleAndButtonRenderer.fromMap(Map<String, dynamic> json) => ModalWithTitleAndButtonRenderer(
    title: json["title"] == null ? null : Title.fromMap(json["title"]),
    content: json["content"] == null ? null : Title.fromMap(json["content"]),
    button: json["button"] == null ? null : CancelButtonClass.fromMap(json["button"]),
  );

  Map<String, dynamic> toMap() => {
    "title": title?.toMap(),
    "content": content?.toMap(),
    "button": button?.toMap(),
  };
}

class CancelButtonClass {
  ButtonRenderer? buttonRenderer;

  CancelButtonClass({
    this.buttonRenderer,
  });

  factory CancelButtonClass.fromJson(String str) => CancelButtonClass.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory CancelButtonClass.fromMap(Map<String, dynamic> json) => CancelButtonClass(
    buttonRenderer: json["buttonRenderer"] == null ? null : ButtonRenderer.fromMap(json["buttonRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "buttonRenderer": buttonRenderer?.toMap(),
  };
}

class ButtonRenderer {
  String? style;
  bool? isDisabled;
  Title? text;
  ButtonRendererNavigationEndpoint? navigationEndpoint;
  String? trackingParams;

  ButtonRenderer({
    this.style,
    this.isDisabled,
    this.text,
    this.navigationEndpoint,
    this.trackingParams,
  });

  factory ButtonRenderer.fromJson(String str) => ButtonRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ButtonRenderer.fromMap(Map<String, dynamic> json) => ButtonRenderer(
    style: json["style"],
    isDisabled: json["isDisabled"],
    text: json["text"] == null ? null : Title.fromMap(json["text"]),
    navigationEndpoint: json["navigationEndpoint"] == null ? null : ButtonRendererNavigationEndpoint.fromMap(json["navigationEndpoint"]),
    trackingParams: json["trackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "style": style,
    "isDisabled": isDisabled,
    "text": text?.toMap(),
    "navigationEndpoint": navigationEndpoint?.toMap(),
    "trackingParams": trackingParams,
  };
}

class ButtonRendererNavigationEndpoint {
  String? clickTrackingParams;
  SignInEndpoint? signInEndpoint;

  ButtonRendererNavigationEndpoint({
    this.clickTrackingParams,
    this.signInEndpoint,
  });

  factory ButtonRendererNavigationEndpoint.fromJson(String str) => ButtonRendererNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ButtonRendererNavigationEndpoint.fromMap(Map<String, dynamic> json) => ButtonRendererNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    signInEndpoint: json["signInEndpoint"] == null ? null : SignInEndpoint.fromMap(json["signInEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "signInEndpoint": signInEndpoint?.toMap(),
  };
}

class SignInEndpoint {
  bool? hack;

  SignInEndpoint({
    this.hack,
  });

  factory SignInEndpoint.fromJson(String str) => SignInEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory SignInEndpoint.fromMap(Map<String, dynamic> json) => SignInEndpoint(
    hack: json["hack"],
  );

  Map<String, dynamic> toMap() => {
    "hack": hack,
  };
}

class Title {
  List<LengthTextRun>? runs;

  Title({
    this.runs,
  });

  factory Title.fromJson(String str) => Title.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Title.fromMap(Map<String, dynamic> json) => Title(
    runs: json["runs"] == null ? [] : List<LengthTextRun>.from(json["runs"]!.map((x) => LengthTextRun.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "runs": runs == null ? [] : List<dynamic>.from(runs!.map((x) => x.toMap())),
  };
}

class ShareEntityEndpoint {
  String? serializedShareEntity;
  String? sharePanelType;

  ShareEntityEndpoint({
    this.serializedShareEntity,
    this.sharePanelType,
  });

  factory ShareEntityEndpoint.fromJson(String str) => ShareEntityEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ShareEntityEndpoint.fromMap(Map<String, dynamic> json) => ShareEntityEndpoint(
    serializedShareEntity: json["serializedShareEntity"],
    sharePanelType: json["sharePanelType"],
  );

  Map<String, dynamic> toMap() => {
    "serializedShareEntity": serializedShareEntity,
    "sharePanelType": sharePanelType,
  };
}

class PurpleWatchEndpoint {
  String? videoId;
  String? playlistId;
  String? params;
  LoggingContext? loggingContext;
  PurpleWatchEndpointMusicSupportedConfigs? watchEndpointMusicSupportedConfigs;

  PurpleWatchEndpoint({
    this.videoId,
    this.playlistId,
    this.params,
    this.loggingContext,
    this.watchEndpointMusicSupportedConfigs,
  });

  factory PurpleWatchEndpoint.fromJson(String str) => PurpleWatchEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PurpleWatchEndpoint.fromMap(Map<String, dynamic> json) => PurpleWatchEndpoint(
    videoId: json["videoId"],
    playlistId: json["playlistId"],
    params: json["params"],
    loggingContext: json["loggingContext"] == null ? null : LoggingContext.fromMap(json["loggingContext"]),
    watchEndpointMusicSupportedConfigs: json["watchEndpointMusicSupportedConfigs"] == null ? null : PurpleWatchEndpointMusicSupportedConfigs.fromMap(json["watchEndpointMusicSupportedConfigs"]),
  );

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
    "playlistId": playlistId,
    "params": params,
    "loggingContext": loggingContext?.toMap(),
    "watchEndpointMusicSupportedConfigs": watchEndpointMusicSupportedConfigs?.toMap(),
  };
}

class LoggingContext {
  VssLoggingContext? vssLoggingContext;

  LoggingContext({
    this.vssLoggingContext,
  });

  factory LoggingContext.fromJson(String str) => LoggingContext.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LoggingContext.fromMap(Map<String, dynamic> json) => LoggingContext(
    vssLoggingContext: json["vssLoggingContext"] == null ? null : VssLoggingContext.fromMap(json["vssLoggingContext"]),
  );

  Map<String, dynamic> toMap() => {
    "vssLoggingContext": vssLoggingContext?.toMap(),
  };
}

class VssLoggingContext {
  String? serializedContextData;

  VssLoggingContext({
    this.serializedContextData,
  });

  factory VssLoggingContext.fromJson(String str) => VssLoggingContext.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory VssLoggingContext.fromMap(Map<String, dynamic> json) => VssLoggingContext(
    serializedContextData: json["serializedContextData"],
  );

  Map<String, dynamic> toMap() => {
    "serializedContextData": serializedContextData,
  };
}

class PurpleWatchEndpointMusicSupportedConfigs {
  PurpleWatchEndpointMusicConfig? watchEndpointMusicConfig;

  PurpleWatchEndpointMusicSupportedConfigs({
    this.watchEndpointMusicConfig,
  });

  factory PurpleWatchEndpointMusicSupportedConfigs.fromJson(String str) => PurpleWatchEndpointMusicSupportedConfigs.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PurpleWatchEndpointMusicSupportedConfigs.fromMap(Map<String, dynamic> json) => PurpleWatchEndpointMusicSupportedConfigs(
    watchEndpointMusicConfig: json["watchEndpointMusicConfig"] == null ? null : PurpleWatchEndpointMusicConfig.fromMap(json["watchEndpointMusicConfig"]),
  );

  Map<String, dynamic> toMap() => {
    "watchEndpointMusicConfig": watchEndpointMusicConfig?.toMap(),
  };
}

class PurpleWatchEndpointMusicConfig {
  String? musicVideoType;

  PurpleWatchEndpointMusicConfig({
    this.musicVideoType,
  });

  factory PurpleWatchEndpointMusicConfig.fromJson(String str) => PurpleWatchEndpointMusicConfig.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PurpleWatchEndpointMusicConfig.fromMap(Map<String, dynamic> json) => PurpleWatchEndpointMusicConfig(
    musicVideoType: json["musicVideoType"],
  );

  Map<String, dynamic> toMap() => {
    "musicVideoType": musicVideoType,
  };
}

class ServiceEndpoint {
  String? clickTrackingParams;
  QueueAddEndpoint? queueAddEndpoint;
  RemoveFromQueueEndpoint? removeFromQueueEndpoint;
  ModalEndpoint? modalEndpoint;

  ServiceEndpoint({
    this.clickTrackingParams,
    this.queueAddEndpoint,
    this.removeFromQueueEndpoint,
    this.modalEndpoint,
  });

  factory ServiceEndpoint.fromJson(String str) => ServiceEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ServiceEndpoint.fromMap(Map<String, dynamic> json) => ServiceEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    queueAddEndpoint: json["queueAddEndpoint"] == null ? null : QueueAddEndpoint.fromMap(json["queueAddEndpoint"]),
    removeFromQueueEndpoint: json["removeFromQueueEndpoint"] == null ? null : RemoveFromQueueEndpoint.fromMap(json["removeFromQueueEndpoint"]),
    modalEndpoint: json["modalEndpoint"] == null ? null : ModalEndpoint.fromMap(json["modalEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "queueAddEndpoint": queueAddEndpoint?.toMap(),
    "removeFromQueueEndpoint": removeFromQueueEndpoint?.toMap(),
    "modalEndpoint": modalEndpoint?.toMap(),
  };
}

class QueueAddEndpoint {
  QueueTarget? queueTarget;
  String? queueInsertPosition;
  List<Command>? commands;

  QueueAddEndpoint({
    this.queueTarget,
    this.queueInsertPosition,
    this.commands,
  });

  factory QueueAddEndpoint.fromJson(String str) => QueueAddEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory QueueAddEndpoint.fromMap(Map<String, dynamic> json) => QueueAddEndpoint(
    queueTarget: json["queueTarget"] == null ? null : QueueTarget.fromMap(json["queueTarget"]),
    queueInsertPosition: json["queueInsertPosition"],
    commands: json["commands"] == null ? [] : List<Command>.from(json["commands"]!.map((x) => Command.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "queueTarget": queueTarget?.toMap(),
    "queueInsertPosition": queueInsertPosition,
    "commands": commands == null ? [] : List<dynamic>.from(commands!.map((x) => x.toMap())),
  };
}

class Command {
  String? clickTrackingParams;
  AddToToastAction? addToToastAction;

  Command({
    this.clickTrackingParams,
    this.addToToastAction,
  });

  factory Command.fromJson(String str) => Command.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Command.fromMap(Map<String, dynamic> json) => Command(
    clickTrackingParams: json["clickTrackingParams"],
    addToToastAction: json["addToToastAction"] == null ? null : AddToToastAction.fromMap(json["addToToastAction"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "addToToastAction": addToToastAction?.toMap(),
  };
}

class AddToToastAction {
  AddToToastActionItem? item;

  AddToToastAction({
    this.item,
  });

  factory AddToToastAction.fromJson(String str) => AddToToastAction.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory AddToToastAction.fromMap(Map<String, dynamic> json) => AddToToastAction(
    item: json["item"] == null ? null : AddToToastActionItem.fromMap(json["item"]),
  );

  Map<String, dynamic> toMap() => {
    "item": item?.toMap(),
  };
}

class AddToToastActionItem {
  NotificationTextRenderer? notificationTextRenderer;

  AddToToastActionItem({
    this.notificationTextRenderer,
  });

  factory AddToToastActionItem.fromJson(String str) => AddToToastActionItem.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory AddToToastActionItem.fromMap(Map<String, dynamic> json) => AddToToastActionItem(
    notificationTextRenderer: json["notificationTextRenderer"] == null ? null : NotificationTextRenderer.fromMap(json["notificationTextRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "notificationTextRenderer": notificationTextRenderer?.toMap(),
  };
}

class NotificationTextRenderer {
  Title? successResponseText;
  String? trackingParams;

  NotificationTextRenderer({
    this.successResponseText,
    this.trackingParams,
  });

  factory NotificationTextRenderer.fromJson(String str) => NotificationTextRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory NotificationTextRenderer.fromMap(Map<String, dynamic> json) => NotificationTextRenderer(
    successResponseText: json["successResponseText"] == null ? null : Title.fromMap(json["successResponseText"]),
    trackingParams: json["trackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "successResponseText": successResponseText?.toMap(),
    "trackingParams": trackingParams,
  };
}

class QueueTarget {
  String? videoId;
  OnEmptyQueue? onEmptyQueue;

  QueueTarget({
    this.videoId,
    this.onEmptyQueue,
  });

  factory QueueTarget.fromJson(String str) => QueueTarget.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory QueueTarget.fromMap(Map<String, dynamic> json) => QueueTarget(
    videoId: json["videoId"],
    onEmptyQueue: json["onEmptyQueue"] == null ? null : OnEmptyQueue.fromMap(json["onEmptyQueue"]),
  );

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
    "onEmptyQueue": onEmptyQueue?.toMap(),
  };
}

class OnEmptyQueue {
  String? clickTrackingParams;
  Target? watchEndpoint;

  OnEmptyQueue({
    this.clickTrackingParams,
    this.watchEndpoint,
  });

  factory OnEmptyQueue.fromJson(String str) => OnEmptyQueue.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory OnEmptyQueue.fromMap(Map<String, dynamic> json) => OnEmptyQueue(
    clickTrackingParams: json["clickTrackingParams"],
    watchEndpoint: json["watchEndpoint"] == null ? null : Target.fromMap(json["watchEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
  };
}

class Target {
  String? videoId;

  Target({
    this.videoId,
  });

  factory Target.fromJson(String str) => Target.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Target.fromMap(Map<String, dynamic> json) => Target(
    videoId: json["videoId"],
  );

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
  };
}

class RemoveFromQueueEndpoint {
  String? videoId;
  List<Command>? commands;

  RemoveFromQueueEndpoint({
    this.videoId,
    this.commands,
  });

  factory RemoveFromQueueEndpoint.fromJson(String str) => RemoveFromQueueEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory RemoveFromQueueEndpoint.fromMap(Map<String, dynamic> json) => RemoveFromQueueEndpoint(
    videoId: json["videoId"],
    commands: json["commands"] == null ? [] : List<Command>.from(json["commands"]!.map((x) => Command.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
    "commands": commands == null ? [] : List<dynamic>.from(commands!.map((x) => x.toMap())),
  };
}

class ToggleMenuServiceItemRenderer {
  Title? defaultText;
  Icon? defaultIcon;
  DislikeNavigationEndpoint? defaultServiceEndpoint;
  Title? toggledText;
  Icon? toggledIcon;
  String? trackingParams;

  ToggleMenuServiceItemRenderer({
    this.defaultText,
    this.defaultIcon,
    this.defaultServiceEndpoint,
    this.toggledText,
    this.toggledIcon,
    this.trackingParams,
  });

  factory ToggleMenuServiceItemRenderer.fromJson(String str) => ToggleMenuServiceItemRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ToggleMenuServiceItemRenderer.fromMap(Map<String, dynamic> json) => ToggleMenuServiceItemRenderer(
    defaultText: json["defaultText"] == null ? null : Title.fromMap(json["defaultText"]),
    defaultIcon: json["defaultIcon"] == null ? null : Icon.fromMap(json["defaultIcon"]),
    defaultServiceEndpoint: json["defaultServiceEndpoint"] == null ? null : DislikeNavigationEndpoint.fromMap(json["defaultServiceEndpoint"]),
    toggledText: json["toggledText"] == null ? null : Title.fromMap(json["toggledText"]),
    toggledIcon: json["toggledIcon"] == null ? null : Icon.fromMap(json["toggledIcon"]),
    trackingParams: json["trackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "defaultText": defaultText?.toMap(),
    "defaultIcon": defaultIcon?.toMap(),
    "defaultServiceEndpoint": defaultServiceEndpoint?.toMap(),
    "toggledText": toggledText?.toMap(),
    "toggledIcon": toggledIcon?.toMap(),
    "trackingParams": trackingParams,
  };
}

class DislikeNavigationEndpoint {
  String? clickTrackingParams;
  ModalEndpoint? modalEndpoint;

  DislikeNavigationEndpoint({
    this.clickTrackingParams,
    this.modalEndpoint,
  });

  factory DislikeNavigationEndpoint.fromJson(String str) => DislikeNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory DislikeNavigationEndpoint.fromMap(Map<String, dynamic> json) => DislikeNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    modalEndpoint: json["modalEndpoint"] == null ? null : ModalEndpoint.fromMap(json["modalEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "modalEndpoint": modalEndpoint?.toMap(),
  };
}

class PlaylistPanelVideoRendererNavigationEndpoint {
  String? clickTrackingParams;
  FluffyWatchEndpoint? watchEndpoint;

  PlaylistPanelVideoRendererNavigationEndpoint({
    this.clickTrackingParams,
    this.watchEndpoint,
  });

  factory PlaylistPanelVideoRendererNavigationEndpoint.fromJson(String str) => PlaylistPanelVideoRendererNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PlaylistPanelVideoRendererNavigationEndpoint.fromMap(Map<String, dynamic> json) => PlaylistPanelVideoRendererNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    watchEndpoint: json["watchEndpoint"] == null ? null : FluffyWatchEndpoint.fromMap(json["watchEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
  };
}

class FluffyWatchEndpoint {
  String? videoId;
  String? playlistId;
  int? index;
  String? params;
  String? playerParams;
  String? playlistSetVideoId;
  LoggingContext? loggingContext;
  FluffyWatchEndpointMusicSupportedConfigs? watchEndpointMusicSupportedConfigs;

  FluffyWatchEndpoint({
    this.videoId,
    this.playlistId,
    this.index,
    this.params,
    this.playerParams,
    this.playlistSetVideoId,
    this.loggingContext,
    this.watchEndpointMusicSupportedConfigs,
  });

  factory FluffyWatchEndpoint.fromJson(String str) => FluffyWatchEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FluffyWatchEndpoint.fromMap(Map<String, dynamic> json) => FluffyWatchEndpoint(
    videoId: json["videoId"],
    playlistId: json["playlistId"],
    index: json["index"],
    params: json["params"],
    playerParams: json["playerParams"],
    playlistSetVideoId: json["playlistSetVideoId"],
    loggingContext: json["loggingContext"] == null ? null : LoggingContext.fromMap(json["loggingContext"]),
    watchEndpointMusicSupportedConfigs: json["watchEndpointMusicSupportedConfigs"] == null ? null : FluffyWatchEndpointMusicSupportedConfigs.fromMap(json["watchEndpointMusicSupportedConfigs"]),
  );

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
    "playlistId": playlistId,
    "index": index,
    "params": params,
    "playerParams": playerParams,
    "playlistSetVideoId": playlistSetVideoId,
    "loggingContext": loggingContext?.toMap(),
    "watchEndpointMusicSupportedConfigs": watchEndpointMusicSupportedConfigs?.toMap(),
  };
}

class FluffyWatchEndpointMusicSupportedConfigs {
  FluffyWatchEndpointMusicConfig? watchEndpointMusicConfig;

  FluffyWatchEndpointMusicSupportedConfigs({
    this.watchEndpointMusicConfig,
  });

  factory FluffyWatchEndpointMusicSupportedConfigs.fromJson(String str) => FluffyWatchEndpointMusicSupportedConfigs.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FluffyWatchEndpointMusicSupportedConfigs.fromMap(Map<String, dynamic> json) => FluffyWatchEndpointMusicSupportedConfigs(
    watchEndpointMusicConfig: json["watchEndpointMusicConfig"] == null ? null : FluffyWatchEndpointMusicConfig.fromMap(json["watchEndpointMusicConfig"]),
  );

  Map<String, dynamic> toMap() => {
    "watchEndpointMusicConfig": watchEndpointMusicConfig?.toMap(),
  };
}

class FluffyWatchEndpointMusicConfig {
  bool? hasPersistentPlaylistPanel;
  String? musicVideoType;

  FluffyWatchEndpointMusicConfig({
    this.hasPersistentPlaylistPanel,
    this.musicVideoType,
  });

  factory FluffyWatchEndpointMusicConfig.fromJson(String str) => FluffyWatchEndpointMusicConfig.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FluffyWatchEndpointMusicConfig.fromMap(Map<String, dynamic> json) => FluffyWatchEndpointMusicConfig(
    hasPersistentPlaylistPanel: json["hasPersistentPlaylistPanel"],
    musicVideoType: json["musicVideoType"],
  );

  Map<String, dynamic> toMap() => {
    "hasPersistentPlaylistPanel": hasPersistentPlaylistPanel,
    "musicVideoType": musicVideoType,
  };
}

class ThumbnailDetailsClass {
  List<ThumbnailElement>? thumbnails;

  ThumbnailDetailsClass({
    this.thumbnails,
  });

  factory ThumbnailDetailsClass.fromJson(String str) => ThumbnailDetailsClass.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ThumbnailDetailsClass.fromMap(Map<String, dynamic> json) => ThumbnailDetailsClass(
    thumbnails: json["thumbnails"] == null ? [] : List<ThumbnailElement>.from(json["thumbnails"]!.map((x) => ThumbnailElement.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "thumbnails": thumbnails == null ? [] : List<dynamic>.from(thumbnails!.map((x) => x.toMap())),
  };
}

class ThumbnailElement {
  String? url;
  int? width;
  int? height;

  ThumbnailElement({
    this.url,
    this.width,
    this.height,
  });

  factory ThumbnailElement.fromJson(String str) => ThumbnailElement.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ThumbnailElement.fromMap(Map<String, dynamic> json) => ThumbnailElement(
    url: json["url"],
    width: json["width"],
    height: json["height"],
  );

  Map<String, dynamic> toMap() => {
    "url": url,
    "width": width,
    "height": height,
  };
}

class Continuation {
  NextRadioContinuationData? nextRadioContinuationData;

  Continuation({
    this.nextRadioContinuationData,
  });

  factory Continuation.fromJson(String str) => Continuation.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Continuation.fromMap(Map<String, dynamic> json) => Continuation(
    nextRadioContinuationData: json["nextRadioContinuationData"] == null ? null : NextRadioContinuationData.fromMap(json["nextRadioContinuationData"]),
  );

  Map<String, dynamic> toMap() => {
    "nextRadioContinuationData": nextRadioContinuationData?.toMap(),
  };
}

class NextRadioContinuationData {
  String? continuation;
  String? clickTrackingParams;

  NextRadioContinuationData({
    this.continuation,
    this.clickTrackingParams,
  });

  factory NextRadioContinuationData.fromJson(String str) => NextRadioContinuationData.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory NextRadioContinuationData.fromMap(Map<String, dynamic> json) => NextRadioContinuationData(
    continuation: json["continuation"],
    clickTrackingParams: json["clickTrackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "continuation": continuation,
    "clickTrackingParams": clickTrackingParams,
  };
}

class PreviewDescription {
  PreviewDescription();

  factory PreviewDescription.fromJson(String str) => PreviewDescription.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PreviewDescription.fromMap(Map<String, dynamic> json) => PreviewDescription(
  );

  Map<String, dynamic> toMap() => {
  };
}

class Header {
  MusicQueueHeaderRenderer? musicQueueHeaderRenderer;

  Header({
    this.musicQueueHeaderRenderer,
  });

  factory Header.fromJson(String str) => Header.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Header.fromMap(Map<String, dynamic> json) => Header(
    musicQueueHeaderRenderer: json["musicQueueHeaderRenderer"] == null ? null : MusicQueueHeaderRenderer.fromMap(json["musicQueueHeaderRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "musicQueueHeaderRenderer": musicQueueHeaderRenderer?.toMap(),
  };
}

class MusicQueueHeaderRenderer {
  Title? title;
  Title? subtitle;
  List<ButtonElement>? buttons;
  String? trackingParams;

  MusicQueueHeaderRenderer({
    this.title,
    this.subtitle,
    this.buttons,
    this.trackingParams,
  });

  factory MusicQueueHeaderRenderer.fromJson(String str) => MusicQueueHeaderRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory MusicQueueHeaderRenderer.fromMap(Map<String, dynamic> json) => MusicQueueHeaderRenderer(
    title: json["title"] == null ? null : Title.fromMap(json["title"]),
    subtitle: json["subtitle"] == null ? null : Title.fromMap(json["subtitle"]),
    buttons: json["buttons"] == null ? [] : List<ButtonElement>.from(json["buttons"]!.map((x) => ButtonElement.fromMap(x))),
    trackingParams: json["trackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "title": title?.toMap(),
    "subtitle": subtitle?.toMap(),
    "buttons": buttons == null ? [] : List<dynamic>.from(buttons!.map((x) => x.toMap())),
    "trackingParams": trackingParams,
  };
}

class ButtonElement {
  ButtonChipCloudChipRenderer? chipCloudChipRenderer;

  ButtonElement({
    this.chipCloudChipRenderer,
  });

  factory ButtonElement.fromJson(String str) => ButtonElement.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ButtonElement.fromMap(Map<String, dynamic> json) => ButtonElement(
    chipCloudChipRenderer: json["chipCloudChipRenderer"] == null ? null : ButtonChipCloudChipRenderer.fromMap(json["chipCloudChipRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "chipCloudChipRenderer": chipCloudChipRenderer?.toMap(),
  };
}

class ButtonChipCloudChipRenderer {
  Style? style;
  Title? text;
  PurpleNavigationEndpoint? navigationEndpoint;
  String? trackingParams;
  Icon? icon;
  Accessibility? accessibilityData;
  bool? isSelected;
  String? uniqueId;

  ButtonChipCloudChipRenderer({
    this.style,
    this.text,
    this.navigationEndpoint,
    this.trackingParams,
    this.icon,
    this.accessibilityData,
    this.isSelected,
    this.uniqueId,
  });

  factory ButtonChipCloudChipRenderer.fromJson(String str) => ButtonChipCloudChipRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ButtonChipCloudChipRenderer.fromMap(Map<String, dynamic> json) => ButtonChipCloudChipRenderer(
    style: json["style"] == null ? null : Style.fromMap(json["style"]),
    text: json["text"] == null ? null : Title.fromMap(json["text"]),
    navigationEndpoint: json["navigationEndpoint"] == null ? null : PurpleNavigationEndpoint.fromMap(json["navigationEndpoint"]),
    trackingParams: json["trackingParams"],
    icon: json["icon"] == null ? null : Icon.fromMap(json["icon"]),
    accessibilityData: json["accessibilityData"] == null ? null : Accessibility.fromMap(json["accessibilityData"]),
    isSelected: json["isSelected"],
    uniqueId: json["uniqueId"],
  );

  Map<String, dynamic> toMap() => {
    "style": style?.toMap(),
    "text": text?.toMap(),
    "navigationEndpoint": navigationEndpoint?.toMap(),
    "trackingParams": trackingParams,
    "icon": icon?.toMap(),
    "accessibilityData": accessibilityData?.toMap(),
    "isSelected": isSelected,
    "uniqueId": uniqueId,
  };
}

class PurpleNavigationEndpoint {
  String? clickTrackingParams;
  ModalEndpoint? modalEndpoint;
  PreviewDescription? saveQueueToPlaylistCommand;

  PurpleNavigationEndpoint({
    this.clickTrackingParams,
    this.modalEndpoint,
    this.saveQueueToPlaylistCommand,
  });

  factory PurpleNavigationEndpoint.fromJson(String str) => PurpleNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PurpleNavigationEndpoint.fromMap(Map<String, dynamic> json) => PurpleNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    modalEndpoint: json["modalEndpoint"] == null ? null : ModalEndpoint.fromMap(json["modalEndpoint"]),
    saveQueueToPlaylistCommand: json["saveQueueToPlaylistCommand"] == null ? null : PreviewDescription.fromMap(json["saveQueueToPlaylistCommand"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "modalEndpoint": modalEndpoint?.toMap(),
    "saveQueueToPlaylistCommand": saveQueueToPlaylistCommand?.toMap(),
  };
}

class Style {
  String? styleType;

  Style({
    this.styleType,
  });

  factory Style.fromJson(String str) => Style.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Style.fromMap(Map<String, dynamic> json) => Style(
    styleType: json["styleType"],
  );

  Map<String, dynamic> toMap() => {
    "styleType": styleType,
  };
}

class SubHeaderChipCloud {
  ChipCloudRenderer? chipCloudRenderer;

  SubHeaderChipCloud({
    this.chipCloudRenderer,
  });

  factory SubHeaderChipCloud.fromJson(String str) => SubHeaderChipCloud.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory SubHeaderChipCloud.fromMap(Map<String, dynamic> json) => SubHeaderChipCloud(
    chipCloudRenderer: json["chipCloudRenderer"] == null ? null : ChipCloudRenderer.fromMap(json["chipCloudRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "chipCloudRenderer": chipCloudRenderer?.toMap(),
  };
}

class ChipCloudRenderer {
  List<Chip>? chips;
  String? trackingParams;

  ChipCloudRenderer({
    this.chips,
    this.trackingParams,
  });

  factory ChipCloudRenderer.fromJson(String str) => ChipCloudRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ChipCloudRenderer.fromMap(Map<String, dynamic> json) => ChipCloudRenderer(
    chips: json["chips"] == null ? [] : List<Chip>.from(json["chips"]!.map((x) => Chip.fromMap(x))),
    trackingParams: json["trackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "chips": chips == null ? [] : List<dynamic>.from(chips!.map((x) => x.toMap())),
    "trackingParams": trackingParams,
  };
}

class Chip {
  ChipChipCloudChipRenderer? chipCloudChipRenderer;

  Chip({
    this.chipCloudChipRenderer,
  });

  factory Chip.fromJson(String str) => Chip.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Chip.fromMap(Map<String, dynamic> json) => Chip(
    chipCloudChipRenderer: json["chipCloudChipRenderer"] == null ? null : ChipChipCloudChipRenderer.fromMap(json["chipCloudChipRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "chipCloudChipRenderer": chipCloudChipRenderer?.toMap(),
  };
}

class ChipChipCloudChipRenderer {
  Title? text;
  FluffyNavigationEndpoint? navigationEndpoint;
  String? trackingParams;
  Accessibility? accessibilityData;
  bool? isSelected;
  String? uniqueId;

  ChipChipCloudChipRenderer({
    this.text,
    this.navigationEndpoint,
    this.trackingParams,
    this.accessibilityData,
    this.isSelected,
    this.uniqueId,
  });

  factory ChipChipCloudChipRenderer.fromJson(String str) => ChipChipCloudChipRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ChipChipCloudChipRenderer.fromMap(Map<String, dynamic> json) => ChipChipCloudChipRenderer(
    text: json["text"] == null ? null : Title.fromMap(json["text"]),
    navigationEndpoint: json["navigationEndpoint"] == null ? null : FluffyNavigationEndpoint.fromMap(json["navigationEndpoint"]),
    trackingParams: json["trackingParams"],
    accessibilityData: json["accessibilityData"] == null ? null : Accessibility.fromMap(json["accessibilityData"]),
    isSelected: json["isSelected"],
    uniqueId: json["uniqueId"],
  );

  Map<String, dynamic> toMap() => {
    "text": text?.toMap(),
    "navigationEndpoint": navigationEndpoint?.toMap(),
    "trackingParams": trackingParams,
    "accessibilityData": accessibilityData?.toMap(),
    "isSelected": isSelected,
    "uniqueId": uniqueId,
  };
}

class FluffyNavigationEndpoint {
  String? clickTrackingParams;
  QueueUpdateCommand? queueUpdateCommand;

  FluffyNavigationEndpoint({
    this.clickTrackingParams,
    this.queueUpdateCommand,
  });

  factory FluffyNavigationEndpoint.fromJson(String str) => FluffyNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FluffyNavigationEndpoint.fromMap(Map<String, dynamic> json) => FluffyNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    queueUpdateCommand: json["queueUpdateCommand"] == null ? null : QueueUpdateCommand.fromMap(json["queueUpdateCommand"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "queueUpdateCommand": queueUpdateCommand?.toMap(),
  };
}

class QueueUpdateCommand {
  String? queueUpdateSection;
  FetchContentsCommand? fetchContentsCommand;
  bool? dedupeAgainstLocalQueue;

  QueueUpdateCommand({
    this.queueUpdateSection,
    this.fetchContentsCommand,
    this.dedupeAgainstLocalQueue,
  });

  factory QueueUpdateCommand.fromJson(String str) => QueueUpdateCommand.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory QueueUpdateCommand.fromMap(Map<String, dynamic> json) => QueueUpdateCommand(
    queueUpdateSection: json["queueUpdateSection"],
    fetchContentsCommand: json["fetchContentsCommand"] == null ? null : FetchContentsCommand.fromMap(json["fetchContentsCommand"]),
    dedupeAgainstLocalQueue: json["dedupeAgainstLocalQueue"],
  );

  Map<String, dynamic> toMap() => {
    "queueUpdateSection": queueUpdateSection,
    "fetchContentsCommand": fetchContentsCommand?.toMap(),
    "dedupeAgainstLocalQueue": dedupeAgainstLocalQueue,
  };
}

class FetchContentsCommand {
  String? clickTrackingParams;
  FetchContentsCommandWatchEndpoint? watchEndpoint;

  FetchContentsCommand({
    this.clickTrackingParams,
    this.watchEndpoint,
  });

  factory FetchContentsCommand.fromJson(String str) => FetchContentsCommand.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FetchContentsCommand.fromMap(Map<String, dynamic> json) => FetchContentsCommand(
    clickTrackingParams: json["clickTrackingParams"],
    watchEndpoint: json["watchEndpoint"] == null ? null : FetchContentsCommandWatchEndpoint.fromMap(json["watchEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
  };
}

class FetchContentsCommandWatchEndpoint {
  String? playlistId;
  String? params;
  LoggingContext? loggingContext;

  FetchContentsCommandWatchEndpoint({
    this.playlistId,
    this.params,
    this.loggingContext,
  });

  factory FetchContentsCommandWatchEndpoint.fromJson(String str) => FetchContentsCommandWatchEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FetchContentsCommandWatchEndpoint.fromMap(Map<String, dynamic> json) => FetchContentsCommandWatchEndpoint(
    playlistId: json["playlistId"],
    params: json["params"],
    loggingContext: json["loggingContext"] == null ? null : LoggingContext.fromMap(json["loggingContext"]),
  );

  Map<String, dynamic> toMap() => {
    "playlistId": playlistId,
    "params": params,
    "loggingContext": loggingContext?.toMap(),
  };
}

class CurrentVideoEndpoint {
  String? clickTrackingParams;
  CurrentVideoEndpointWatchEndpoint? watchEndpoint;

  CurrentVideoEndpoint({
    this.clickTrackingParams,
    this.watchEndpoint,
  });

  factory CurrentVideoEndpoint.fromJson(String str) => CurrentVideoEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory CurrentVideoEndpoint.fromMap(Map<String, dynamic> json) => CurrentVideoEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    watchEndpoint: json["watchEndpoint"] == null ? null : CurrentVideoEndpointWatchEndpoint.fromMap(json["watchEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
  };
}

class CurrentVideoEndpointWatchEndpoint {
  String? videoId;
  String? playlistId;
  int? index;
  String? playlistSetVideoId;
  LoggingContext? loggingContext;

  CurrentVideoEndpointWatchEndpoint({
    this.videoId,
    this.playlistId,
    this.index,
    this.playlistSetVideoId,
    this.loggingContext,
  });

  factory CurrentVideoEndpointWatchEndpoint.fromJson(String str) => CurrentVideoEndpointWatchEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory CurrentVideoEndpointWatchEndpoint.fromMap(Map<String, dynamic> json) => CurrentVideoEndpointWatchEndpoint(
    videoId: json["videoId"],
    playlistId: json["playlistId"],
    index: json["index"],
    playlistSetVideoId: json["playlistSetVideoId"],
    loggingContext: json["loggingContext"] == null ? null : LoggingContext.fromMap(json["loggingContext"]),
  );

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
    "playlistId": playlistId,
    "index": index,
    "playlistSetVideoId": playlistSetVideoId,
    "loggingContext": loggingContext?.toMap(),
  };
}

class PlayerOverlays {
  PlayerOverlayRenderer? playerOverlayRenderer;

  PlayerOverlays({
    this.playerOverlayRenderer,
  });

  factory PlayerOverlays.fromJson(String str) => PlayerOverlays.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PlayerOverlays.fromMap(Map<String, dynamic> json) => PlayerOverlays(
    playerOverlayRenderer: json["playerOverlayRenderer"] == null ? null : PlayerOverlayRenderer.fromMap(json["playerOverlayRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "playerOverlayRenderer": playerOverlayRenderer?.toMap(),
  };
}

class PlayerOverlayRenderer {
  List<Action>? actions;
  BrowserMediaSession? browserMediaSession;

  PlayerOverlayRenderer({
    this.actions,
    this.browserMediaSession,
  });

  factory PlayerOverlayRenderer.fromJson(String str) => PlayerOverlayRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory PlayerOverlayRenderer.fromMap(Map<String, dynamic> json) => PlayerOverlayRenderer(
    actions: json["actions"] == null ? [] : List<Action>.from(json["actions"]!.map((x) => Action.fromMap(x))),
    browserMediaSession: json["browserMediaSession"] == null ? null : BrowserMediaSession.fromMap(json["browserMediaSession"]),
  );

  Map<String, dynamic> toMap() => {
    "actions": actions == null ? [] : List<dynamic>.from(actions!.map((x) => x.toMap())),
    "browserMediaSession": browserMediaSession?.toMap(),
  };
}

class Action {
  LikeButtonRenderer? likeButtonRenderer;

  Action({
    this.likeButtonRenderer,
  });

  factory Action.fromJson(String str) => Action.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Action.fromMap(Map<String, dynamic> json) => Action(
    likeButtonRenderer: json["likeButtonRenderer"] == null ? null : LikeButtonRenderer.fromMap(json["likeButtonRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "likeButtonRenderer": likeButtonRenderer?.toMap(),
  };
}

class LikeButtonRenderer {
  Target? target;
  String? likeStatus;
  String? trackingParams;
  bool? likesAllowed;
  DislikeNavigationEndpoint? dislikeNavigationEndpoint;
  DislikeNavigationEndpoint? likeCommand;

  LikeButtonRenderer({
    this.target,
    this.likeStatus,
    this.trackingParams,
    this.likesAllowed,
    this.dislikeNavigationEndpoint,
    this.likeCommand,
  });

  factory LikeButtonRenderer.fromJson(String str) => LikeButtonRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory LikeButtonRenderer.fromMap(Map<String, dynamic> json) => LikeButtonRenderer(
    target: json["target"] == null ? null : Target.fromMap(json["target"]),
    likeStatus: json["likeStatus"],
    trackingParams: json["trackingParams"],
    likesAllowed: json["likesAllowed"],
    dislikeNavigationEndpoint: json["dislikeNavigationEndpoint"] == null ? null : DislikeNavigationEndpoint.fromMap(json["dislikeNavigationEndpoint"]),
    likeCommand: json["likeCommand"] == null ? null : DislikeNavigationEndpoint.fromMap(json["likeCommand"]),
  );

  Map<String, dynamic> toMap() => {
    "target": target?.toMap(),
    "likeStatus": likeStatus,
    "trackingParams": trackingParams,
    "likesAllowed": likesAllowed,
    "dislikeNavigationEndpoint": dislikeNavigationEndpoint?.toMap(),
    "likeCommand": likeCommand?.toMap(),
  };
}

class BrowserMediaSession {
  BrowserMediaSessionRenderer? browserMediaSessionRenderer;

  BrowserMediaSession({
    this.browserMediaSessionRenderer,
  });

  factory BrowserMediaSession.fromJson(String str) => BrowserMediaSession.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory BrowserMediaSession.fromMap(Map<String, dynamic> json) => BrowserMediaSession(
    browserMediaSessionRenderer: json["browserMediaSessionRenderer"] == null ? null : BrowserMediaSessionRenderer.fromMap(json["browserMediaSessionRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "browserMediaSessionRenderer": browserMediaSessionRenderer?.toMap(),
  };
}

class BrowserMediaSessionRenderer {
  Title? album;
  ThumbnailDetailsClass? thumbnailDetails;

  BrowserMediaSessionRenderer({
    this.album,
    this.thumbnailDetails,
  });

  factory BrowserMediaSessionRenderer.fromJson(String str) => BrowserMediaSessionRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory BrowserMediaSessionRenderer.fromMap(Map<String, dynamic> json) => BrowserMediaSessionRenderer(
    album: json["album"] == null ? null : Title.fromMap(json["album"]),
    thumbnailDetails: json["thumbnailDetails"] == null ? null : ThumbnailDetailsClass.fromMap(json["thumbnailDetails"]),
  );

  Map<String, dynamic> toMap() => {
    "album": album?.toMap(),
    "thumbnailDetails": thumbnailDetails?.toMap(),
  };
}

class ResponseContext {
  String? visitorData;
  List<ServiceTrackingParam>? serviceTrackingParams;

  ResponseContext({
    this.visitorData,
    this.serviceTrackingParams,
  });

  factory ResponseContext.fromJson(String str) => ResponseContext.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ResponseContext.fromMap(Map<String, dynamic> json) => ResponseContext(
    visitorData: json["visitorData"],
    serviceTrackingParams: json["serviceTrackingParams"] == null ? [] : List<ServiceTrackingParam>.from(json["serviceTrackingParams"]!.map((x) => ServiceTrackingParam.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "visitorData": visitorData,
    "serviceTrackingParams": serviceTrackingParams == null ? [] : List<dynamic>.from(serviceTrackingParams!.map((x) => x.toMap())),
  };
}

class ServiceTrackingParam {
  String? service;
  List<Param>? params;

  ServiceTrackingParam({
    this.service,
    this.params,
  });

  factory ServiceTrackingParam.fromJson(String str) => ServiceTrackingParam.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ServiceTrackingParam.fromMap(Map<String, dynamic> json) => ServiceTrackingParam(
    service: json["service"],
    params: json["params"] == null ? [] : List<Param>.from(json["params"]!.map((x) => Param.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "service": service,
    "params": params == null ? [] : List<dynamic>.from(params!.map((x) => x.toMap())),
  };
}

class Param {
  String? key;
  String? value;

  Param({
    this.key,
    this.value,
  });

  factory Param.fromJson(String str) => Param.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Param.fromMap(Map<String, dynamic> json) => Param(
    key: json["key"],
    value: json["value"],
  );

  Map<String, dynamic> toMap() => {
    "key": key,
    "value": value,
  };
}

class VideoReporting {
  ReportFormModalRenderer? reportFormModalRenderer;

  VideoReporting({
    this.reportFormModalRenderer,
  });

  factory VideoReporting.fromJson(String str) => VideoReporting.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory VideoReporting.fromMap(Map<String, dynamic> json) => VideoReporting(
    reportFormModalRenderer: json["reportFormModalRenderer"] == null ? null : ReportFormModalRenderer.fromMap(json["reportFormModalRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "reportFormModalRenderer": reportFormModalRenderer?.toMap(),
  };
}

class ReportFormModalRenderer {
  OptionsSupportedRenderers? optionsSupportedRenderers;
  String? trackingParams;
  Title? title;
  CancelButtonClass? submitButton;
  CancelButtonClass? cancelButton;
  Footer? footer;

  ReportFormModalRenderer({
    this.optionsSupportedRenderers,
    this.trackingParams,
    this.title,
    this.submitButton,
    this.cancelButton,
    this.footer,
  });

  factory ReportFormModalRenderer.fromJson(String str) => ReportFormModalRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory ReportFormModalRenderer.fromMap(Map<String, dynamic> json) => ReportFormModalRenderer(
    optionsSupportedRenderers: json["optionsSupportedRenderers"] == null ? null : OptionsSupportedRenderers.fromMap(json["optionsSupportedRenderers"]),
    trackingParams: json["trackingParams"],
    title: json["title"] == null ? null : Title.fromMap(json["title"]),
    submitButton: json["submitButton"] == null ? null : CancelButtonClass.fromMap(json["submitButton"]),
    cancelButton: json["cancelButton"] == null ? null : CancelButtonClass.fromMap(json["cancelButton"]),
    footer: json["footer"] == null ? null : Footer.fromMap(json["footer"]),
  );

  Map<String, dynamic> toMap() => {
    "optionsSupportedRenderers": optionsSupportedRenderers?.toMap(),
    "trackingParams": trackingParams,
    "title": title?.toMap(),
    "submitButton": submitButton?.toMap(),
    "cancelButton": cancelButton?.toMap(),
    "footer": footer?.toMap(),
  };
}

class Footer {
  List<FooterRun>? runs;

  Footer({
    this.runs,
  });

  factory Footer.fromJson(String str) => Footer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory Footer.fromMap(Map<String, dynamic> json) => Footer(
    runs: json["runs"] == null ? [] : List<FooterRun>.from(json["runs"]!.map((x) => FooterRun.fromMap(x))),
  );

  Map<String, dynamic> toMap() => {
    "runs": runs == null ? [] : List<dynamic>.from(runs!.map((x) => x.toMap())),
  };
}

class FooterRun {
  String? text;
  RunNavigationEndpoint? navigationEndpoint;

  FooterRun({
    this.text,
    this.navigationEndpoint,
  });

  factory FooterRun.fromJson(String str) => FooterRun.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FooterRun.fromMap(Map<String, dynamic> json) => FooterRun(
    text: json["text"],
    navigationEndpoint: json["navigationEndpoint"] == null ? null : RunNavigationEndpoint.fromMap(json["navigationEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "text": text,
    "navigationEndpoint": navigationEndpoint?.toMap(),
  };
}

class RunNavigationEndpoint {
  String? clickTrackingParams;
  UrlEndpoint? urlEndpoint;

  RunNavigationEndpoint({
    this.clickTrackingParams,
    this.urlEndpoint,
  });

  factory RunNavigationEndpoint.fromJson(String str) => RunNavigationEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory RunNavigationEndpoint.fromMap(Map<String, dynamic> json) => RunNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    urlEndpoint: json["urlEndpoint"] == null ? null : UrlEndpoint.fromMap(json["urlEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "urlEndpoint": urlEndpoint?.toMap(),
  };
}

class UrlEndpoint {
  String? url;

  UrlEndpoint({
    this.url,
  });

  factory UrlEndpoint.fromJson(String str) => UrlEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory UrlEndpoint.fromMap(Map<String, dynamic> json) => UrlEndpoint(
    url: json["url"],
  );

  Map<String, dynamic> toMap() => {
    "url": url,
  };
}

class OptionsSupportedRenderers {
  OptionsRenderer? optionsRenderer;

  OptionsSupportedRenderers({
    this.optionsRenderer,
  });

  factory OptionsSupportedRenderers.fromJson(String str) => OptionsSupportedRenderers.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory OptionsSupportedRenderers.fromMap(Map<String, dynamic> json) => OptionsSupportedRenderers(
    optionsRenderer: json["optionsRenderer"] == null ? null : OptionsRenderer.fromMap(json["optionsRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "optionsRenderer": optionsRenderer?.toMap(),
  };
}

class OptionsRenderer {
  List<OptionsRendererItem>? items;
  String? trackingParams;

  OptionsRenderer({
    this.items,
    this.trackingParams,
  });

  factory OptionsRenderer.fromJson(String str) => OptionsRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory OptionsRenderer.fromMap(Map<String, dynamic> json) => OptionsRenderer(
    items: json["items"] == null ? [] : List<OptionsRendererItem>.from(json["items"]!.map((x) => OptionsRendererItem.fromMap(x))),
    trackingParams: json["trackingParams"],
  );

  Map<String, dynamic> toMap() => {
    "items": items == null ? [] : List<dynamic>.from(items!.map((x) => x.toMap())),
    "trackingParams": trackingParams,
  };
}

class OptionsRendererItem {
  OptionSelectableItemRenderer? optionSelectableItemRenderer;

  OptionsRendererItem({
    this.optionSelectableItemRenderer,
  });

  factory OptionsRendererItem.fromJson(String str) => OptionsRendererItem.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory OptionsRendererItem.fromMap(Map<String, dynamic> json) => OptionsRendererItem(
    optionSelectableItemRenderer: json["optionSelectableItemRenderer"] == null ? null : OptionSelectableItemRenderer.fromMap(json["optionSelectableItemRenderer"]),
  );

  Map<String, dynamic> toMap() => {
    "optionSelectableItemRenderer": optionSelectableItemRenderer?.toMap(),
  };
}

class OptionSelectableItemRenderer {
  Title? text;
  String? trackingParams;
  SubmitEndpoint? submitEndpoint;

  OptionSelectableItemRenderer({
    this.text,
    this.trackingParams,
    this.submitEndpoint,
  });

  factory OptionSelectableItemRenderer.fromJson(String str) => OptionSelectableItemRenderer.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory OptionSelectableItemRenderer.fromMap(Map<String, dynamic> json) => OptionSelectableItemRenderer(
    text: json["text"] == null ? null : Title.fromMap(json["text"]),
    trackingParams: json["trackingParams"],
    submitEndpoint: json["submitEndpoint"] == null ? null : SubmitEndpoint.fromMap(json["submitEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "text": text?.toMap(),
    "trackingParams": trackingParams,
    "submitEndpoint": submitEndpoint?.toMap(),
  };
}

class SubmitEndpoint {
  String? clickTrackingParams;
  FlagEndpoint? flagEndpoint;

  SubmitEndpoint({
    this.clickTrackingParams,
    this.flagEndpoint,
  });

  factory SubmitEndpoint.fromJson(String str) => SubmitEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory SubmitEndpoint.fromMap(Map<String, dynamic> json) => SubmitEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    flagEndpoint: json["flagEndpoint"] == null ? null : FlagEndpoint.fromMap(json["flagEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "flagEndpoint": flagEndpoint?.toMap(),
  };
}

class FlagEndpoint {
  String? flagAction;

  FlagEndpoint({
    this.flagAction,
  });

  factory FlagEndpoint.fromJson(String str) => FlagEndpoint.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory FlagEndpoint.fromMap(Map<String, dynamic> json) => FlagEndpoint(
    flagAction: json["flagAction"],
  );

  Map<String, dynamic> toMap() => {
    "flagAction": flagAction,
  };
}
