// Author: fengshengxiong
// Date: 2024/6/30
// Description: Browse-专辑模型

import 'dart:convert';

class BrowseAlbumModel {
  ResponseContext? responseContext;
  Contents? contents;
  String? trackingParams;
  Microformat? microformat;
  StraplineThumbnailClass? background;

  BrowseAlbumModel({
    this.responseContext,
    this.contents,
    this.trackingParams,
    this.microformat,
    this.background,
  });

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

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

  factory BrowseAlbumModel.fromMap(Map<String, dynamic> json) => BrowseAlbumModel(
    responseContext: json["responseContext"] == null ? null : ResponseContext.fromMap(json["responseContext"]),
    contents: json["contents"] == null ? null : Contents.fromMap(json["contents"]),
    trackingParams: json["trackingParams"],
    microformat: json["microformat"] == null ? null : Microformat.fromMap(json["microformat"]),
    background: json["background"] == null ? null : StraplineThumbnailClass.fromMap(json["background"]),
  );

  Map<String, dynamic> toMap() => {
    "responseContext": responseContext?.toMap(),
    "contents": contents?.toMap(),
    "trackingParams": trackingParams,
    "microformat": microformat?.toMap(),
    "background": background?.toMap(),
  };
}

class StraplineThumbnailClass {
  MusicThumbnailRenderer? musicThumbnailRenderer;

  StraplineThumbnailClass({
    this.musicThumbnailRenderer,
  });

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

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

  factory StraplineThumbnailClass.fromMap(Map<String, dynamic> json) => StraplineThumbnailClass(
    musicThumbnailRenderer: json["musicThumbnailRenderer"] == null ? null : MusicThumbnailRenderer.fromMap(json["musicThumbnailRenderer"]),
  );

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

class MusicThumbnailRenderer {
  MusicThumbnailRendererThumbnail? thumbnail;
  String? thumbnailCrop;
  String? thumbnailScale;
  String? trackingParams;

  MusicThumbnailRenderer({
    this.thumbnail,
    this.thumbnailCrop,
    this.thumbnailScale,
    this.trackingParams,
  });

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

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

  factory MusicThumbnailRenderer.fromMap(Map<String, dynamic> json) => MusicThumbnailRenderer(
    thumbnail: json["thumbnail"] == null ? null : MusicThumbnailRendererThumbnail.fromMap(json["thumbnail"]),
    thumbnailCrop: json["thumbnailCrop"],
    thumbnailScale: json["thumbnailScale"],
    trackingParams: json["trackingParams"],
  );

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

class MusicThumbnailRendererThumbnail {
  List<ThumbnailElement>? thumbnails;

  MusicThumbnailRendererThumbnail({
    this.thumbnails,
  });

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

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

  factory MusicThumbnailRendererThumbnail.fromMap(Map<String, dynamic> json) => MusicThumbnailRendererThumbnail(
    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 Contents {
  TwoColumnBrowseResultsRenderer? twoColumnBrowseResultsRenderer;

  Contents({
    this.twoColumnBrowseResultsRenderer,
  });

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

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

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

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

class TwoColumnBrowseResultsRenderer {
  SecondaryContents? secondaryContents;
  List<Tab>? tabs;

  TwoColumnBrowseResultsRenderer({
    this.secondaryContents,
    this.tabs,
  });

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

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

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

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

class SecondaryContents {
  SecondaryContentsSectionListRenderer? sectionListRenderer;

  SecondaryContents({
    this.sectionListRenderer,
  });

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

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

  factory SecondaryContents.fromMap(Map<String, dynamic> json) => SecondaryContents(
    sectionListRenderer: json["sectionListRenderer"] == null ? null : SecondaryContentsSectionListRenderer.fromMap(json["sectionListRenderer"]),
  );

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

class SecondaryContentsSectionListRenderer {
  List<PurpleContent>? contents;
  String? trackingParams;

  SecondaryContentsSectionListRenderer({
    this.contents,
    this.trackingParams,
  });

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

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

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

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

class PurpleContent {
  MusicShelfRenderer? musicShelfRenderer;

  PurpleContent({
    this.musicShelfRenderer,
  });

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

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

  factory PurpleContent.fromMap(Map<String, dynamic> json) => PurpleContent(
    musicShelfRenderer: json["musicShelfRenderer"] == null ? null : MusicShelfRenderer.fromMap(json["musicShelfRenderer"]),
  );

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

class MusicShelfRenderer {
  List<MusicShelfRendererContent>? contents;
  String? trackingParams;
  ShelfDivider? shelfDivider;
  bool? contentsMultiSelectable;

  MusicShelfRenderer({
    this.contents,
    this.trackingParams,
    this.shelfDivider,
    this.contentsMultiSelectable,
  });

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

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

  factory MusicShelfRenderer.fromMap(Map<String, dynamic> json) => MusicShelfRenderer(
    contents: json["contents"] == null ? [] : List<MusicShelfRendererContent>.from(json["contents"]!.map((x) => MusicShelfRendererContent.fromMap(x))),
    trackingParams: json["trackingParams"],
    shelfDivider: json["shelfDivider"] == null ? null : ShelfDivider.fromMap(json["shelfDivider"]),
    contentsMultiSelectable: json["contentsMultiSelectable"],
  );

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

class MusicShelfRendererContent {
  MusicResponsiveListItemRenderer? musicResponsiveListItemRenderer;

  MusicShelfRendererContent({
    this.musicResponsiveListItemRenderer,
  });

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

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

  factory MusicShelfRendererContent.fromMap(Map<String, dynamic> json) => MusicShelfRendererContent(
    musicResponsiveListItemRenderer: json["musicResponsiveListItemRenderer"] == null ? null : MusicResponsiveListItemRenderer.fromMap(json["musicResponsiveListItemRenderer"]),
  );

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

class MusicResponsiveListItemRenderer {
  String? trackingParams;
  Overlay? overlay;
  List<FlexColumn>? flexColumns;
  List<FixedColumn>? fixedColumns;
  Menu? menu;
  PlaylistItemData? playlistItemData;
  String? itemHeight;
  Index? index;
  MultiSelectCheckbox? multiSelectCheckbox;

  MusicResponsiveListItemRenderer({
    this.trackingParams,
    this.overlay,
    this.flexColumns,
    this.fixedColumns,
    this.menu,
    this.playlistItemData,
    this.itemHeight,
    this.index,
    this.multiSelectCheckbox,
  });

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

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

  factory MusicResponsiveListItemRenderer.fromMap(Map<String, dynamic> json) => MusicResponsiveListItemRenderer(
    trackingParams: json["trackingParams"],
    overlay: json["overlay"] == null ? null : Overlay.fromMap(json["overlay"]),
    flexColumns: json["flexColumns"] == null ? [] : List<FlexColumn>.from(json["flexColumns"]!.map((x) => FlexColumn.fromMap(x))),
    fixedColumns: json["fixedColumns"] == null ? [] : List<FixedColumn>.from(json["fixedColumns"]!.map((x) => FixedColumn.fromMap(x))),
    menu: json["menu"] == null ? null : Menu.fromMap(json["menu"]),
    playlistItemData: json["playlistItemData"] == null ? null : PlaylistItemData.fromMap(json["playlistItemData"]),
    itemHeight: json["itemHeight"],
    index: json["index"] == null ? null : Index.fromMap(json["index"]),
    multiSelectCheckbox: json["multiSelectCheckbox"] == null ? null : MultiSelectCheckbox.fromMap(json["multiSelectCheckbox"]),
  );

  Map<String, dynamic> toMap() => {
    "trackingParams": trackingParams,
    "overlay": overlay?.toMap(),
    "flexColumns": flexColumns == null ? [] : List<dynamic>.from(flexColumns!.map((x) => x.toMap())),
    "fixedColumns": fixedColumns == null ? [] : List<dynamic>.from(fixedColumns!.map((x) => x.toMap())),
    "menu": menu?.toMap(),
    "playlistItemData": playlistItemData?.toMap(),
    "itemHeight": itemHeight,
    "index": index?.toMap(),
    "multiSelectCheckbox": multiSelectCheckbox?.toMap(),
  };
}

class FixedColumn {
  MusicResponsiveListItemFixedColumnRenderer? musicResponsiveListItemFixedColumnRenderer;

  FixedColumn({
    this.musicResponsiveListItemFixedColumnRenderer,
  });

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

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

  factory FixedColumn.fromMap(Map<String, dynamic> json) => FixedColumn(
    musicResponsiveListItemFixedColumnRenderer: json["musicResponsiveListItemFixedColumnRenderer"] == null ? null : MusicResponsiveListItemFixedColumnRenderer.fromMap(json["musicResponsiveListItemFixedColumnRenderer"]),
  );

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

class MusicResponsiveListItemFixedColumnRenderer {
  Index? text;
  String? displayPriority;
  String? size;

  MusicResponsiveListItemFixedColumnRenderer({
    this.text,
    this.displayPriority,
    this.size,
  });

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

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

  factory MusicResponsiveListItemFixedColumnRenderer.fromMap(Map<String, dynamic> json) => MusicResponsiveListItemFixedColumnRenderer(
    text: json["text"] == null ? null : Index.fromMap(json["text"]),
    displayPriority: json["displayPriority"],
    size: json["size"],
  );

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

class Index {
  List<IndexRun>? runs;

  Index({
    this.runs,
  });

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

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

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

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

class IndexRun {
  String? text;

  IndexRun({
    this.text,
  });

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

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

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

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

class FlexColumn {
  MusicResponsiveListItemFlexColumnRenderer? musicResponsiveListItemFlexColumnRenderer;

  FlexColumn({
    this.musicResponsiveListItemFlexColumnRenderer,
  });

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

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

  factory FlexColumn.fromMap(Map<String, dynamic> json) => FlexColumn(
    musicResponsiveListItemFlexColumnRenderer: json["musicResponsiveListItemFlexColumnRenderer"] == null ? null : MusicResponsiveListItemFlexColumnRenderer.fromMap(json["musicResponsiveListItemFlexColumnRenderer"]),
  );

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

class MusicResponsiveListItemFlexColumnRenderer {
  Text? text;
  String? displayPriority;

  MusicResponsiveListItemFlexColumnRenderer({
    this.text,
    this.displayPriority,
  });

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

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

  factory MusicResponsiveListItemFlexColumnRenderer.fromMap(Map<String, dynamic> json) => MusicResponsiveListItemFlexColumnRenderer(
    text: json["text"] == null ? null : Text.fromMap(json["text"]),
    displayPriority: json["displayPriority"],
  );

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

class Text {
  List<PurpleRun>? runs;

  Text({
    this.runs,
  });

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

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

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

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

class PurpleRun {
  String? text;
  NavigationEndpoint? navigationEndpoint;

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

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

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

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

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

class NavigationEndpoint {
  String? clickTrackingParams;
  PlayNavigationEndpointWatchEndpoint? watchEndpoint;

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

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

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

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

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

class PlayNavigationEndpointWatchEndpoint {
  String? videoId;
  String? playlistId;
  LoggingContext? loggingContext;
  WatchEndpointMusicSupportedConfigs? watchEndpointMusicSupportedConfigs;
  String? params;
  int? index;

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

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

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

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

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

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 WatchEndpointMusicSupportedConfigs {
  WatchEndpointMusicConfig? watchEndpointMusicConfig;

  WatchEndpointMusicSupportedConfigs({
    this.watchEndpointMusicConfig,
  });

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

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

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

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

class WatchEndpointMusicConfig {
  String? musicVideoType;

  WatchEndpointMusicConfig({
    this.musicVideoType,
  });

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

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

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

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

class Menu {
  MenuMenuRenderer? 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 : MenuMenuRenderer.fromMap(json["menuRenderer"]),
  );

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

class MenuMenuRenderer {
  List<PurpleItem>? items;
  String? trackingParams;
  List<TopLevelButton>? topLevelButtons;
  Accessibility? accessibility;

  MenuMenuRenderer({
    this.items,
    this.trackingParams,
    this.topLevelButtons,
    this.accessibility,
  });

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

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

  factory MenuMenuRenderer.fromMap(Map<String, dynamic> json) => MenuMenuRenderer(
    items: json["items"] == null ? [] : List<PurpleItem>.from(json["items"]!.map((x) => PurpleItem.fromMap(x))),
    trackingParams: json["trackingParams"],
    topLevelButtons: json["topLevelButtons"] == null ? [] : List<TopLevelButton>.from(json["topLevelButtons"]!.map((x) => TopLevelButton.fromMap(x))),
    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,
    "topLevelButtons": topLevelButtons == null ? [] : List<dynamic>.from(topLevelButtons!.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 PurpleItem {
  MenuItemRenderer? menuNavigationItemRenderer;
  MenuItemRenderer? menuServiceItemRenderer;

  PurpleItem({
    this.menuNavigationItemRenderer,
    this.menuServiceItemRenderer,
  });

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

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

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

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

class MenuItemRenderer {
  Index? 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 : Index.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;
  PlayNavigationEndpointWatchEndpoint? watchEndpoint;
  ModalEndpoint? modalEndpoint;
  BrowseEndpoint? browseEndpoint;
  ShareEntityEndpoint? shareEntityEndpoint;
  WatchPlaylistEndpoint? watchPlaylistEndpoint;

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

  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 : PlayNavigationEndpointWatchEndpoint.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"]),
    watchPlaylistEndpoint: json["watchPlaylistEndpoint"] == null ? null : WatchPlaylistEndpoint.fromMap(json["watchPlaylistEndpoint"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
    "modalEndpoint": modalEndpoint?.toMap(),
    "browseEndpoint": browseEndpoint?.toMap(),
    "shareEntityEndpoint": shareEntityEndpoint?.toMap(),
    "watchPlaylistEndpoint": watchPlaylistEndpoint?.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 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 {
  Index? title;
  Index? content;
  ModalWithTitleAndButtonRendererButton? 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 : Index.fromMap(json["title"]),
    content: json["content"] == null ? null : Index.fromMap(json["content"]),
    button: json["button"] == null ? null : ModalWithTitleAndButtonRendererButton.fromMap(json["button"]),
  );

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

class ModalWithTitleAndButtonRendererButton {
  ButtonRenderer? buttonRenderer;

  ModalWithTitleAndButtonRendererButton({
    this.buttonRenderer,
  });

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

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

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

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

class ButtonRenderer {
  String? style;
  bool? isDisabled;
  Index? 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 : Index.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 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 WatchPlaylistEndpoint {
  String? playlistId;
  String? params;

  WatchPlaylistEndpoint({
    this.playlistId,
    this.params,
  });

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

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

  factory WatchPlaylistEndpoint.fromMap(Map<String, dynamic> json) => WatchPlaylistEndpoint(
    playlistId: json["playlistId"],
    params: json["params"],
  );

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

class ServiceEndpoint {
  String? clickTrackingParams;
  QueueAddEndpoint? queueAddEndpoint;

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

  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"]),
  );

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "queueAddEndpoint": queueAddEndpoint?.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 {
  Index? 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 : Index.fromMap(json["successResponseText"]),
    trackingParams: json["trackingParams"],
  );

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

class QueueTarget {
  String? videoId;
  OnEmptyQueue? onEmptyQueue;
  String? playlistId;

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

  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"]),
    playlistId: json["playlistId"],
  );

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

class OnEmptyQueue {
  String? clickTrackingParams;
  OnEmptyQueueWatchEndpoint? 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 : OnEmptyQueueWatchEndpoint.fromMap(json["watchEndpoint"]),
  );

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

class OnEmptyQueueWatchEndpoint {
  String? videoId;
  String? playlistId;

  OnEmptyQueueWatchEndpoint({
    this.videoId,
    this.playlistId,
  });

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

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

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

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

class TopLevelButton {
  LikeButtonRenderer? likeButtonRenderer;

  TopLevelButton({
    this.likeButtonRenderer,
  });

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

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

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

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

class LikeButtonRenderer {
  LikeButtonRendererTarget? target;
  String? likeStatus;
  String? trackingParams;
  bool? likesAllowed;
  DefaultNavigationEndpoint? dislikeNavigationEndpoint;
  DefaultNavigationEndpoint? 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 : LikeButtonRendererTarget.fromMap(json["target"]),
    likeStatus: json["likeStatus"],
    trackingParams: json["trackingParams"],
    likesAllowed: json["likesAllowed"],
    dislikeNavigationEndpoint: json["dislikeNavigationEndpoint"] == null ? null : DefaultNavigationEndpoint.fromMap(json["dislikeNavigationEndpoint"]),
    likeCommand: json["likeCommand"] == null ? null : DefaultNavigationEndpoint.fromMap(json["likeCommand"]),
  );

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

class DefaultNavigationEndpoint {
  String? clickTrackingParams;
  ModalEndpoint? modalEndpoint;

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

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

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

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

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

class LikeButtonRendererTarget {
  String? videoId;

  LikeButtonRendererTarget({
    this.videoId,
  });

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

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

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

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

class MultiSelectCheckbox {
  CheckboxRenderer? checkboxRenderer;

  MultiSelectCheckbox({
    this.checkboxRenderer,
  });

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

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

  factory MultiSelectCheckbox.fromMap(Map<String, dynamic> json) => MultiSelectCheckbox(
    checkboxRenderer: json["checkboxRenderer"] == null ? null : CheckboxRenderer.fromMap(json["checkboxRenderer"]),
  );

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

class CheckboxRenderer {
  OnSelectionChangeCommand? onSelectionChangeCommand;
  String? checkedState;
  String? trackingParams;

  CheckboxRenderer({
    this.onSelectionChangeCommand,
    this.checkedState,
    this.trackingParams,
  });

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

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

  factory CheckboxRenderer.fromMap(Map<String, dynamic> json) => CheckboxRenderer(
    onSelectionChangeCommand: json["onSelectionChangeCommand"] == null ? null : OnSelectionChangeCommand.fromMap(json["onSelectionChangeCommand"]),
    checkedState: json["checkedState"],
    trackingParams: json["trackingParams"],
  );

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

class OnSelectionChangeCommand {
  String? clickTrackingParams;
  UpdateMultiSelectStateCommand? updateMultiSelectStateCommand;

  OnSelectionChangeCommand({
    this.clickTrackingParams,
    this.updateMultiSelectStateCommand,
  });

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

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

  factory OnSelectionChangeCommand.fromMap(Map<String, dynamic> json) => OnSelectionChangeCommand(
    clickTrackingParams: json["clickTrackingParams"],
    updateMultiSelectStateCommand: json["updateMultiSelectStateCommand"] == null ? null : UpdateMultiSelectStateCommand.fromMap(json["updateMultiSelectStateCommand"]),
  );

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

class UpdateMultiSelectStateCommand {
  String? multiSelectParams;
  String? multiSelectItem;

  UpdateMultiSelectStateCommand({
    this.multiSelectParams,
    this.multiSelectItem,
  });

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

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

  factory UpdateMultiSelectStateCommand.fromMap(Map<String, dynamic> json) => UpdateMultiSelectStateCommand(
    multiSelectParams: json["multiSelectParams"],
    multiSelectItem: json["multiSelectItem"],
  );

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

class Overlay {
  MusicItemThumbnailOverlayRenderer? musicItemThumbnailOverlayRenderer;

  Overlay({
    this.musicItemThumbnailOverlayRenderer,
  });

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

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

  factory Overlay.fromMap(Map<String, dynamic> json) => Overlay(
    musicItemThumbnailOverlayRenderer: json["musicItemThumbnailOverlayRenderer"] == null ? null : MusicItemThumbnailOverlayRenderer.fromMap(json["musicItemThumbnailOverlayRenderer"]),
  );

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

class MusicItemThumbnailOverlayRenderer {
  MusicItemThumbnailOverlayRendererBackground? background;
  MusicItemThumbnailOverlayRendererContent? content;
  String? contentPosition;
  String? displayStyle;

  MusicItemThumbnailOverlayRenderer({
    this.background,
    this.content,
    this.contentPosition,
    this.displayStyle,
  });

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

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

  factory MusicItemThumbnailOverlayRenderer.fromMap(Map<String, dynamic> json) => MusicItemThumbnailOverlayRenderer(
    background: json["background"] == null ? null : MusicItemThumbnailOverlayRendererBackground.fromMap(json["background"]),
    content: json["content"] == null ? null : MusicItemThumbnailOverlayRendererContent.fromMap(json["content"]),
    contentPosition: json["contentPosition"],
    displayStyle: json["displayStyle"],
  );

  Map<String, dynamic> toMap() => {
    "background": background?.toMap(),
    "content": content?.toMap(),
    "contentPosition": contentPosition,
    "displayStyle": displayStyle,
  };
}

class MusicItemThumbnailOverlayRendererBackground {
  VerticalGradient? verticalGradient;

  MusicItemThumbnailOverlayRendererBackground({
    this.verticalGradient,
  });

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

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

  factory MusicItemThumbnailOverlayRendererBackground.fromMap(Map<String, dynamic> json) => MusicItemThumbnailOverlayRendererBackground(
    verticalGradient: json["verticalGradient"] == null ? null : VerticalGradient.fromMap(json["verticalGradient"]),
  );

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

class VerticalGradient {
  List<String>? gradientLayerColors;

  VerticalGradient({
    this.gradientLayerColors,
  });

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

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

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

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

class MusicItemThumbnailOverlayRendererContent {
  ContentMusicPlayButtonRenderer? musicPlayButtonRenderer;

  MusicItemThumbnailOverlayRendererContent({
    this.musicPlayButtonRenderer,
  });

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

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

  factory MusicItemThumbnailOverlayRendererContent.fromMap(Map<String, dynamic> json) => MusicItemThumbnailOverlayRendererContent(
    musicPlayButtonRenderer: json["musicPlayButtonRenderer"] == null ? null : ContentMusicPlayButtonRenderer.fromMap(json["musicPlayButtonRenderer"]),
  );

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

class ContentMusicPlayButtonRenderer {
  NavigationEndpoint? playNavigationEndpoint;
  String? trackingParams;
  Icon? playIcon;
  Icon? pauseIcon;
  int? iconColor;
  int? backgroundColor;
  int? activeBackgroundColor;
  int? loadingIndicatorColor;
  Icon? playingIcon;
  int? iconLoadingColor;
  int? activeScaleFactor;
  String? buttonSize;
  String? rippleTarget;
  Accessibility? accessibilityPlayData;
  Accessibility? accessibilityPauseData;

  ContentMusicPlayButtonRenderer({
    this.playNavigationEndpoint,
    this.trackingParams,
    this.playIcon,
    this.pauseIcon,
    this.iconColor,
    this.backgroundColor,
    this.activeBackgroundColor,
    this.loadingIndicatorColor,
    this.playingIcon,
    this.iconLoadingColor,
    this.activeScaleFactor,
    this.buttonSize,
    this.rippleTarget,
    this.accessibilityPlayData,
    this.accessibilityPauseData,
  });

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

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

  factory ContentMusicPlayButtonRenderer.fromMap(Map<String, dynamic> json) => ContentMusicPlayButtonRenderer(
    playNavigationEndpoint: json["playNavigationEndpoint"] == null ? null : NavigationEndpoint.fromMap(json["playNavigationEndpoint"]),
    trackingParams: json["trackingParams"],
    playIcon: json["playIcon"] == null ? null : Icon.fromMap(json["playIcon"]),
    pauseIcon: json["pauseIcon"] == null ? null : Icon.fromMap(json["pauseIcon"]),
    iconColor: json["iconColor"],
    backgroundColor: json["backgroundColor"],
    activeBackgroundColor: json["activeBackgroundColor"],
    loadingIndicatorColor: json["loadingIndicatorColor"],
    playingIcon: json["playingIcon"] == null ? null : Icon.fromMap(json["playingIcon"]),
    iconLoadingColor: json["iconLoadingColor"],
    activeScaleFactor: json["activeScaleFactor"],
    buttonSize: json["buttonSize"],
    rippleTarget: json["rippleTarget"],
    accessibilityPlayData: json["accessibilityPlayData"] == null ? null : Accessibility.fromMap(json["accessibilityPlayData"]),
    accessibilityPauseData: json["accessibilityPauseData"] == null ? null : Accessibility.fromMap(json["accessibilityPauseData"]),
  );

  Map<String, dynamic> toMap() => {
    "playNavigationEndpoint": playNavigationEndpoint?.toMap(),
    "trackingParams": trackingParams,
    "playIcon": playIcon?.toMap(),
    "pauseIcon": pauseIcon?.toMap(),
    "iconColor": iconColor,
    "backgroundColor": backgroundColor,
    "activeBackgroundColor": activeBackgroundColor,
    "loadingIndicatorColor": loadingIndicatorColor,
    "playingIcon": playingIcon?.toMap(),
    "iconLoadingColor": iconLoadingColor,
    "activeScaleFactor": activeScaleFactor,
    "buttonSize": buttonSize,
    "rippleTarget": rippleTarget,
    "accessibilityPlayData": accessibilityPlayData?.toMap(),
    "accessibilityPauseData": accessibilityPauseData?.toMap(),
  };
}

class PlaylistItemData {
  String? playlistSetVideoId;
  String? videoId;

  PlaylistItemData({
    this.playlistSetVideoId,
    this.videoId,
  });

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

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

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

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

class ShelfDivider {
  MusicShelfDividerRenderer? musicShelfDividerRenderer;

  ShelfDivider({
    this.musicShelfDividerRenderer,
  });

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

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

  factory ShelfDivider.fromMap(Map<String, dynamic> json) => ShelfDivider(
    musicShelfDividerRenderer: json["musicShelfDividerRenderer"] == null ? null : MusicShelfDividerRenderer.fromMap(json["musicShelfDividerRenderer"]),
  );

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

class MusicShelfDividerRenderer {
  bool? hidden;

  MusicShelfDividerRenderer({
    this.hidden,
  });

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

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

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

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

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 {
  TabRendererContent? content;
  String? trackingParams;

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

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

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

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

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

class TabRendererContent {
  ContentSectionListRenderer? sectionListRenderer;

  TabRendererContent({
    this.sectionListRenderer,
  });

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

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

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

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

class ContentSectionListRenderer {
  List<FluffyContent>? contents;
  String? trackingParams;

  ContentSectionListRenderer({
    this.contents,
    this.trackingParams,
  });

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

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

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

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

class FluffyContent {
  MusicResponsiveHeaderRenderer? musicResponsiveHeaderRenderer;

  FluffyContent({
    this.musicResponsiveHeaderRenderer,
  });

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

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

  factory FluffyContent.fromMap(Map<String, dynamic> json) => FluffyContent(
    musicResponsiveHeaderRenderer: json["musicResponsiveHeaderRenderer"] == null ? null : MusicResponsiveHeaderRenderer.fromMap(json["musicResponsiveHeaderRenderer"]),
  );

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

class MusicResponsiveHeaderRenderer {
  StraplineThumbnailClass? thumbnail;
  List<ButtonElement>? buttons;
  Index? title;
  Index? subtitle;
  String? trackingParams;
  StraplineTextOne? straplineTextOne;
  StraplineThumbnailClass? straplineThumbnail;
  MusicResponsiveHeaderRendererDescription? description;
  Index? secondSubtitle;

  MusicResponsiveHeaderRenderer({
    this.thumbnail,
    this.buttons,
    this.title,
    this.subtitle,
    this.trackingParams,
    this.straplineTextOne,
    this.straplineThumbnail,
    this.description,
    this.secondSubtitle,
  });

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

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

  factory MusicResponsiveHeaderRenderer.fromMap(Map<String, dynamic> json) => MusicResponsiveHeaderRenderer(
    thumbnail: json["thumbnail"] == null ? null : StraplineThumbnailClass.fromMap(json["thumbnail"]),
    buttons: json["buttons"] == null ? [] : List<ButtonElement>.from(json["buttons"]!.map((x) => ButtonElement.fromMap(x))),
    title: json["title"] == null ? null : Index.fromMap(json["title"]),
    subtitle: json["subtitle"] == null ? null : Index.fromMap(json["subtitle"]),
    trackingParams: json["trackingParams"],
    straplineTextOne: json["straplineTextOne"] == null ? null : StraplineTextOne.fromMap(json["straplineTextOne"]),
    straplineThumbnail: json["straplineThumbnail"] == null ? null : StraplineThumbnailClass.fromMap(json["straplineThumbnail"]),
    description: json["description"] == null ? null : MusicResponsiveHeaderRendererDescription.fromMap(json["description"]),
    secondSubtitle: json["secondSubtitle"] == null ? null : Index.fromMap(json["secondSubtitle"]),
  );

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

class ButtonElement {
  ButtonToggleButtonRenderer? toggleButtonRenderer;
  ButtonMusicPlayButtonRenderer? musicPlayButtonRenderer;
  ButtonMenuRenderer? menuRenderer;

  ButtonElement({
    this.toggleButtonRenderer,
    this.musicPlayButtonRenderer,
    this.menuRenderer,
  });

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

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

  factory ButtonElement.fromMap(Map<String, dynamic> json) => ButtonElement(
    toggleButtonRenderer: json["toggleButtonRenderer"] == null ? null : ButtonToggleButtonRenderer.fromMap(json["toggleButtonRenderer"]),
    musicPlayButtonRenderer: json["musicPlayButtonRenderer"] == null ? null : ButtonMusicPlayButtonRenderer.fromMap(json["musicPlayButtonRenderer"]),
    menuRenderer: json["menuRenderer"] == null ? null : ButtonMenuRenderer.fromMap(json["menuRenderer"]),
  );

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

class ButtonMenuRenderer {
  List<FluffyItem>? items;
  String? trackingParams;
  Accessibility? accessibility;

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

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

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

  factory ButtonMenuRenderer.fromMap(Map<String, dynamic> json) => ButtonMenuRenderer(
    items: json["items"] == null ? [] : List<FluffyItem>.from(json["items"]!.map((x) => FluffyItem.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 FluffyItem {
  MenuItemRenderer? menuNavigationItemRenderer;
  MenuItemRenderer? menuServiceItemRenderer;
  ToggleMenuServiceItemRenderer? toggleMenuServiceItemRenderer;

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

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

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

  factory FluffyItem.fromMap(Map<String, dynamic> json) => FluffyItem(
    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 ToggleMenuServiceItemRenderer {
  Index? defaultText;
  Icon? defaultIcon;
  DefaultNavigationEndpoint? defaultServiceEndpoint;
  Index? toggledText;
  Icon? toggledIcon;
  ToggledServiceEndpoint? toggledServiceEndpoint;
  String? trackingParams;

  ToggleMenuServiceItemRenderer({
    this.defaultText,
    this.defaultIcon,
    this.defaultServiceEndpoint,
    this.toggledText,
    this.toggledIcon,
    this.toggledServiceEndpoint,
    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 : Index.fromMap(json["defaultText"]),
    defaultIcon: json["defaultIcon"] == null ? null : Icon.fromMap(json["defaultIcon"]),
    defaultServiceEndpoint: json["defaultServiceEndpoint"] == null ? null : DefaultNavigationEndpoint.fromMap(json["defaultServiceEndpoint"]),
    toggledText: json["toggledText"] == null ? null : Index.fromMap(json["toggledText"]),
    toggledIcon: json["toggledIcon"] == null ? null : Icon.fromMap(json["toggledIcon"]),
    toggledServiceEndpoint: json["toggledServiceEndpoint"] == null ? null : ToggledServiceEndpoint.fromMap(json["toggledServiceEndpoint"]),
    trackingParams: json["trackingParams"],
  );

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

class ToggledServiceEndpoint {
  String? clickTrackingParams;
  LikeEndpoint? likeEndpoint;

  ToggledServiceEndpoint({
    this.clickTrackingParams,
    this.likeEndpoint,
  });

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

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

  factory ToggledServiceEndpoint.fromMap(Map<String, dynamic> json) => ToggledServiceEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    likeEndpoint: json["likeEndpoint"] == null ? null : LikeEndpoint.fromMap(json["likeEndpoint"]),
  );

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

class LikeEndpoint {
  String? status;
  LikeEndpointTarget? target;

  LikeEndpoint({
    this.status,
    this.target,
  });

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

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

  factory LikeEndpoint.fromMap(Map<String, dynamic> json) => LikeEndpoint(
    status: json["status"],
    target: json["target"] == null ? null : LikeEndpointTarget.fromMap(json["target"]),
  );

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

class LikeEndpointTarget {
  String? playlistId;

  LikeEndpointTarget({
    this.playlistId,
  });

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

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

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

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

class ButtonMusicPlayButtonRenderer {
  NavigationEndpoint? playNavigationEndpoint;
  String? trackingParams;
  Icon? playIcon;
  Icon? pauseIcon;
  int? iconColor;
  int? backgroundColor;
  int? activeBackgroundColor;
  int? loadingIndicatorColor;
  Icon? playingIcon;
  int? iconLoadingColor;
  int? activeScaleFactor;
  Accessibility? accessibilityPlayData;
  Accessibility? accessibilityPauseData;

  ButtonMusicPlayButtonRenderer({
    this.playNavigationEndpoint,
    this.trackingParams,
    this.playIcon,
    this.pauseIcon,
    this.iconColor,
    this.backgroundColor,
    this.activeBackgroundColor,
    this.loadingIndicatorColor,
    this.playingIcon,
    this.iconLoadingColor,
    this.activeScaleFactor,
    this.accessibilityPlayData,
    this.accessibilityPauseData,
  });

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

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

  factory ButtonMusicPlayButtonRenderer.fromMap(Map<String, dynamic> json) => ButtonMusicPlayButtonRenderer(
    playNavigationEndpoint: json["playNavigationEndpoint"] == null ? null : NavigationEndpoint.fromMap(json["playNavigationEndpoint"]),
    trackingParams: json["trackingParams"],
    playIcon: json["playIcon"] == null ? null : Icon.fromMap(json["playIcon"]),
    pauseIcon: json["pauseIcon"] == null ? null : Icon.fromMap(json["pauseIcon"]),
    iconColor: json["iconColor"],
    backgroundColor: json["backgroundColor"],
    activeBackgroundColor: json["activeBackgroundColor"],
    loadingIndicatorColor: json["loadingIndicatorColor"],
    playingIcon: json["playingIcon"] == null ? null : Icon.fromMap(json["playingIcon"]),
    iconLoadingColor: json["iconLoadingColor"],
    activeScaleFactor: json["activeScaleFactor"],
    accessibilityPlayData: json["accessibilityPlayData"] == null ? null : Accessibility.fromMap(json["accessibilityPlayData"]),
    accessibilityPauseData: json["accessibilityPauseData"] == null ? null : Accessibility.fromMap(json["accessibilityPauseData"]),
  );

  Map<String, dynamic> toMap() => {
    "playNavigationEndpoint": playNavigationEndpoint?.toMap(),
    "trackingParams": trackingParams,
    "playIcon": playIcon?.toMap(),
    "pauseIcon": pauseIcon?.toMap(),
    "iconColor": iconColor,
    "backgroundColor": backgroundColor,
    "activeBackgroundColor": activeBackgroundColor,
    "loadingIndicatorColor": loadingIndicatorColor,
    "playingIcon": playingIcon?.toMap(),
    "iconLoadingColor": iconLoadingColor,
    "activeScaleFactor": activeScaleFactor,
    "accessibilityPlayData": accessibilityPlayData?.toMap(),
    "accessibilityPauseData": accessibilityPauseData?.toMap(),
  };
}

class ButtonToggleButtonRenderer {
  bool? isToggled;
  bool? isDisabled;
  Icon? defaultIcon;
  Icon? toggledIcon;
  String? trackingParams;
  DefaultNavigationEndpoint? defaultNavigationEndpoint;
  Accessibility? accessibilityData;
  Accessibility? toggledAccessibilityData;

  ButtonToggleButtonRenderer({
    this.isToggled,
    this.isDisabled,
    this.defaultIcon,
    this.toggledIcon,
    this.trackingParams,
    this.defaultNavigationEndpoint,
    this.accessibilityData,
    this.toggledAccessibilityData,
  });

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

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

  factory ButtonToggleButtonRenderer.fromMap(Map<String, dynamic> json) => ButtonToggleButtonRenderer(
    isToggled: json["isToggled"],
    isDisabled: json["isDisabled"],
    defaultIcon: json["defaultIcon"] == null ? null : Icon.fromMap(json["defaultIcon"]),
    toggledIcon: json["toggledIcon"] == null ? null : Icon.fromMap(json["toggledIcon"]),
    trackingParams: json["trackingParams"],
    defaultNavigationEndpoint: json["defaultNavigationEndpoint"] == null ? null : DefaultNavigationEndpoint.fromMap(json["defaultNavigationEndpoint"]),
    accessibilityData: json["accessibilityData"] == null ? null : Accessibility.fromMap(json["accessibilityData"]),
    toggledAccessibilityData: json["toggledAccessibilityData"] == null ? null : Accessibility.fromMap(json["toggledAccessibilityData"]),
  );

  Map<String, dynamic> toMap() => {
    "isToggled": isToggled,
    "isDisabled": isDisabled,
    "defaultIcon": defaultIcon?.toMap(),
    "toggledIcon": toggledIcon?.toMap(),
    "trackingParams": trackingParams,
    "defaultNavigationEndpoint": defaultNavigationEndpoint?.toMap(),
    "accessibilityData": accessibilityData?.toMap(),
    "toggledAccessibilityData": toggledAccessibilityData?.toMap(),
  };
}

class MusicResponsiveHeaderRendererDescription {
  MusicDescriptionShelfRenderer? musicDescriptionShelfRenderer;

  MusicResponsiveHeaderRendererDescription({
    this.musicDescriptionShelfRenderer,
  });

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

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

  factory MusicResponsiveHeaderRendererDescription.fromMap(Map<String, dynamic> json) => MusicResponsiveHeaderRendererDescription(
    musicDescriptionShelfRenderer: json["musicDescriptionShelfRenderer"] == null ? null : MusicDescriptionShelfRenderer.fromMap(json["musicDescriptionShelfRenderer"]),
  );

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

class MusicDescriptionShelfRenderer {
  MusicDescriptionShelfRendererDescription? description;
  MoreButton? moreButton;
  String? trackingParams;
  String? shelfStyle;

  MusicDescriptionShelfRenderer({
    this.description,
    this.moreButton,
    this.trackingParams,
    this.shelfStyle,
  });

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

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

  factory MusicDescriptionShelfRenderer.fromMap(Map<String, dynamic> json) => MusicDescriptionShelfRenderer(
    description: json["description"] == null ? null : MusicDescriptionShelfRendererDescription.fromMap(json["description"]),
    moreButton: json["moreButton"] == null ? null : MoreButton.fromMap(json["moreButton"]),
    trackingParams: json["trackingParams"],
    shelfStyle: json["shelfStyle"],
  );

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

class MusicDescriptionShelfRendererDescription {
  List<DescriptionRun>? runs;

  MusicDescriptionShelfRendererDescription({
    this.runs,
  });

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

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

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

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

class DescriptionRun {
  String? text;
  PurpleNavigationEndpoint? navigationEndpoint;

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

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

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

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

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

class PurpleNavigationEndpoint {
  String? clickTrackingParams;
  UrlEndpoint? urlEndpoint;

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

  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"],
    urlEndpoint: json["urlEndpoint"] == null ? null : UrlEndpoint.fromMap(json["urlEndpoint"]),
  );

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

class UrlEndpoint {
  String? url;
  String? target;

  UrlEndpoint({
    this.url,
    this.target,
  });

  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"],
    target: json["target"],
  );

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

class MoreButton {
  MoreButtonToggleButtonRenderer? toggleButtonRenderer;

  MoreButton({
    this.toggleButtonRenderer,
  });

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

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

  factory MoreButton.fromMap(Map<String, dynamic> json) => MoreButton(
    toggleButtonRenderer: json["toggleButtonRenderer"] == null ? null : MoreButtonToggleButtonRenderer.fromMap(json["toggleButtonRenderer"]),
  );

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

class MoreButtonToggleButtonRenderer {
  bool? isToggled;
  bool? isDisabled;
  Icon? defaultIcon;
  Index? defaultText;
  Icon? toggledIcon;
  Index? toggledText;
  String? trackingParams;

  MoreButtonToggleButtonRenderer({
    this.isToggled,
    this.isDisabled,
    this.defaultIcon,
    this.defaultText,
    this.toggledIcon,
    this.toggledText,
    this.trackingParams,
  });

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

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

  factory MoreButtonToggleButtonRenderer.fromMap(Map<String, dynamic> json) => MoreButtonToggleButtonRenderer(
    isToggled: json["isToggled"],
    isDisabled: json["isDisabled"],
    defaultIcon: json["defaultIcon"] == null ? null : Icon.fromMap(json["defaultIcon"]),
    defaultText: json["defaultText"] == null ? null : Index.fromMap(json["defaultText"]),
    toggledIcon: json["toggledIcon"] == null ? null : Icon.fromMap(json["toggledIcon"]),
    toggledText: json["toggledText"] == null ? null : Index.fromMap(json["toggledText"]),
    trackingParams: json["trackingParams"],
  );

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

class StraplineTextOne {
  List<StraplineTextOneRun>? runs;

  StraplineTextOne({
    this.runs,
  });

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

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

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

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

class StraplineTextOneRun {
  String? text;
  FluffyNavigationEndpoint? navigationEndpoint;

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

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

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

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

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

class FluffyNavigationEndpoint {
  String? clickTrackingParams;
  BrowseEndpoint? browseEndpoint;

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

  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"],
    browseEndpoint: json["browseEndpoint"] == null ? null : BrowseEndpoint.fromMap(json["browseEndpoint"]),
  );

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

class Microformat {
  MicroformatDataRenderer? microformatDataRenderer;

  Microformat({
    this.microformatDataRenderer,
  });

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

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

  factory Microformat.fromMap(Map<String, dynamic> json) => Microformat(
    microformatDataRenderer: json["microformatDataRenderer"] == null ? null : MicroformatDataRenderer.fromMap(json["microformatDataRenderer"]),
  );

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

class MicroformatDataRenderer {
  String? urlCanonical;

  MicroformatDataRenderer({
    this.urlCanonical,
  });

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

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

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

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

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,
  };
}
