// Author: fengshengxiong
// Date: 2024/7/29
// Description: 搜索结果更多模型

import 'dart:convert';

class SearchResultMoreModel {
  ResponseContext? responseContext;
  ContinuationContents? continuationContents;
  String? trackingParams;
  SearchResultMoreModelHeader? header;

  SearchResultMoreModel({
    this.responseContext,
    this.continuationContents,
    this.trackingParams,
    this.header,
  });

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

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

  factory SearchResultMoreModel.fromMap(Map<String, dynamic> json) => SearchResultMoreModel(
    responseContext: json["responseContext"] == null ? null : ResponseContext.fromMap(json["responseContext"]),
    continuationContents: json["continuationContents"] == null ? null : ContinuationContents.fromMap(json["continuationContents"]),
    trackingParams: json["trackingParams"],
    header: json["header"] == null ? null : SearchResultMoreModelHeader.fromMap(json["header"]),
  );

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

class ContinuationContents {
  MusicShelfContinuation? musicShelfContinuation;

  ContinuationContents({
    this.musicShelfContinuation,
  });

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

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

  factory ContinuationContents.fromMap(Map<String, dynamic> json) => ContinuationContents(
    musicShelfContinuation: json["musicShelfContinuation"] == null ? null : MusicShelfContinuation.fromMap(json["musicShelfContinuation"]),
  );

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

class MusicShelfContinuation {
  List<ContentElement>? contents;
  String? trackingParams;
  List<Continuation>? continuations;
  ShelfDivider? shelfDivider;
  bool? autoReloadWhenEmpty;

  MusicShelfContinuation({
    this.contents,
    this.trackingParams,
    this.continuations,
    this.shelfDivider,
    this.autoReloadWhenEmpty,
  });

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

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

  factory MusicShelfContinuation.fromMap(Map<String, dynamic> json) => MusicShelfContinuation(
    contents: json["contents"] == null ? [] : List<ContentElement>.from(json["contents"]!.map((x) => ContentElement.fromMap(x))),
    trackingParams: json["trackingParams"],
    continuations: json["continuations"] == null ? [] : List<Continuation>.from(json["continuations"]!.map((x) => Continuation.fromMap(x))),
    shelfDivider: json["shelfDivider"] == null ? null : ShelfDivider.fromMap(json["shelfDivider"]),
    autoReloadWhenEmpty: json["autoReloadWhenEmpty"],
  );

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

class ContentElement {
  MusicResponsiveListItemRenderer? musicResponsiveListItemRenderer;

  ContentElement({
    this.musicResponsiveListItemRenderer,
  });

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

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

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

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

class MusicResponsiveListItemRenderer {
  String? trackingParams;
  MusicResponsiveListItemRendererThumbnail? thumbnail;
  Overlay? overlay;
  List<FlexColumn>? flexColumns;
  Menu? menu;
  PlaylistItemData? playlistItemData;
  String? flexColumnDisplayStyle;
  NavigationEndpoint? navigationEndpoint;
  String? itemHeight;

  MusicResponsiveListItemRenderer({
    this.trackingParams,
    this.thumbnail,
    this.overlay,
    this.flexColumns,
    this.menu,
    this.playlistItemData,
    this.flexColumnDisplayStyle,
    this.navigationEndpoint,
    this.itemHeight,
  });

  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"],
    thumbnail: json["thumbnail"] == null ? null : MusicResponsiveListItemRendererThumbnail.fromMap(json["thumbnail"]),
    overlay: json["overlay"] == null ? null : Overlay.fromMap(json["overlay"]),
    flexColumns: json["flexColumns"] == null ? [] : List<FlexColumn>.from(json["flexColumns"]!.map((x) => FlexColumn.fromMap(x))),
    menu: json["menu"] == null ? null : Menu.fromMap(json["menu"]),
    playlistItemData: json["playlistItemData"] == null ? null : PlaylistItemData.fromMap(json["playlistItemData"]),
    flexColumnDisplayStyle: json["flexColumnDisplayStyle"],
    navigationEndpoint: json["navigationEndpoint"] == null ? null : NavigationEndpoint.fromMap(json["navigationEndpoint"]),
    itemHeight: json["itemHeight"],
  );

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

class NavigationEndpoint {
  String? clickTrackingParams;
  BrowseEndpoint? browseEndpoint;

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

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

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

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 {
  MusicResponsiveListItemFlexColumnRendererText? 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 : MusicResponsiveListItemFlexColumnRendererText.fromMap(json["text"]),
    displayPriority: json["displayPriority"],
  );

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

class MusicResponsiveListItemFlexColumnRendererText {
  List<PurpleRun>? runs;

  MusicResponsiveListItemFlexColumnRendererText({
    this.runs,
  });

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

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

  factory MusicResponsiveListItemFlexColumnRendererText.fromMap(Map<String, dynamic> json) => MusicResponsiveListItemFlexColumnRendererText(
    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;
  RunNavigationEndpoint? 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 : RunNavigationEndpoint.fromMap(json["navigationEndpoint"]),
  );

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

class RunNavigationEndpoint {
  String? clickTrackingParams;
  PlayNavigationEndpointWatchEndpoint? watchEndpoint;
  BrowseEndpoint? browseEndpoint;

  RunNavigationEndpoint({
    this.clickTrackingParams,
    this.watchEndpoint,
    this.browseEndpoint,
  });

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

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
    "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 PlayNavigationEndpointWatchEndpoint {
  String? videoId;
  WatchEndpointMusicSupportedConfigs? watchEndpointMusicSupportedConfigs;

  PlayNavigationEndpointWatchEndpoint({
    this.videoId,
    this.watchEndpointMusicSupportedConfigs,
  });

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

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

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 {
  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<ItemElement>? 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<ItemElement>.from(json["items"]!.map((x) => ItemElement.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 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 ItemElement {
  MenuItemRenderer? menuNavigationItemRenderer;
  MenuItemRenderer? menuServiceItemRenderer;
  ToggleMenuServiceItemRenderer? toggleMenuServiceItemRenderer;

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

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

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

  factory ItemElement.fromMap(Map<String, dynamic> json) => ItemElement(
    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 {
  DefaultTextClass? 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 : DefaultTextClass.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 {
  DefaultTextClass? title;
  DefaultTextClass? content;
  Button? 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 : DefaultTextClass.fromMap(json["title"]),
    content: json["content"] == null ? null : DefaultTextClass.fromMap(json["content"]),
    button: json["button"] == null ? null : Button.fromMap(json["button"]),
  );

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

class Button {
  ButtonRenderer? buttonRenderer;

  Button({
    this.buttonRenderer,
  });

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

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

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

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

class ButtonRenderer {
  String? style;
  bool? isDisabled;
  DefaultTextClass? 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 : DefaultTextClass.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 DefaultTextClass {
  List<DefaultTextRun>? runs;

  DefaultTextClass({
    this.runs,
  });

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

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

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

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

class DefaultTextRun {
  String? text;

  DefaultTextRun({
    this.text,
  });

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

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

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

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

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;
  WatchEndpointMusicSupportedConfigs? 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 : WatchEndpointMusicSupportedConfigs.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 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 {
  DefaultTextClass? 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 : DefaultTextClass.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;
  PlaylistItemData? 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 : PlaylistItemData.fromMap(json["watchEndpoint"]),
  );

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

class PlaylistItemData {
  String? videoId;

  PlaylistItemData({
    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(
    videoId: json["videoId"],
  );

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

class ToggleMenuServiceItemRenderer {
  DefaultTextClass? defaultText;
  Icon? defaultIcon;
  DefaultServiceEndpoint? defaultServiceEndpoint;
  DefaultTextClass? 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 : DefaultTextClass.fromMap(json["defaultText"]),
    defaultIcon: json["defaultIcon"] == null ? null : Icon.fromMap(json["defaultIcon"]),
    defaultServiceEndpoint: json["defaultServiceEndpoint"] == null ? null : DefaultServiceEndpoint.fromMap(json["defaultServiceEndpoint"]),
    toggledText: json["toggledText"] == null ? null : DefaultTextClass.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 DefaultServiceEndpoint {
  String? clickTrackingParams;
  ModalEndpoint? modalEndpoint;

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

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

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

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

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

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 {
  Background? 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 : Background.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 Background {
  VerticalGradient? verticalGradient;

  Background({
    this.verticalGradient,
  });

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

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

  factory Background.fromMap(Map<String, dynamic> json) => Background(
    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 {
  MusicPlayButtonRenderer? 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 : MusicPlayButtonRenderer.fromMap(json["musicPlayButtonRenderer"]),
  );

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

class MusicPlayButtonRenderer {
  PlayNavigationEndpoint? 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;

  MusicPlayButtonRenderer({
    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 MusicPlayButtonRenderer.fromJson(String str) => MusicPlayButtonRenderer.fromMap(json.decode(str));

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

  factory MusicPlayButtonRenderer.fromMap(Map<String, dynamic> json) => MusicPlayButtonRenderer(
    playNavigationEndpoint: json["playNavigationEndpoint"] == null ? null : PlayNavigationEndpoint.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 PlayNavigationEndpoint {
  String? clickTrackingParams;
  PlayNavigationEndpointWatchEndpoint? watchEndpoint;

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

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

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

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

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

class MusicResponsiveListItemRendererThumbnail {
  MusicThumbnailRenderer? musicThumbnailRenderer;

  MusicResponsiveListItemRendererThumbnail({
    this.musicThumbnailRenderer,
  });

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

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

  factory MusicResponsiveListItemRendererThumbnail.fromMap(Map<String, dynamic> json) => MusicResponsiveListItemRendererThumbnail(
    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 Continuation {
  NextContinuationData? nextContinuationData;

  Continuation({
    this.nextContinuationData,
  });

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

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

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

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

class NextContinuationData {
  String? continuation;
  String? clickTrackingParams;

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

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

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

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

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

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 SearchResultMoreModelHeader {
  MusicHeaderRenderer? musicHeaderRenderer;

  SearchResultMoreModelHeader({
    this.musicHeaderRenderer,
  });

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

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

  factory SearchResultMoreModelHeader.fromMap(Map<String, dynamic> json) => SearchResultMoreModelHeader(
    musicHeaderRenderer: json["musicHeaderRenderer"] == null ? null : MusicHeaderRenderer.fromMap(json["musicHeaderRenderer"]),
  );

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

class MusicHeaderRenderer {
  MusicHeaderRendererHeader? header;
  String? trackingParams;

  MusicHeaderRenderer({
    this.header,
    this.trackingParams,
  });

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

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

  factory MusicHeaderRenderer.fromMap(Map<String, dynamic> json) => MusicHeaderRenderer(
    header: json["header"] == null ? null : MusicHeaderRendererHeader.fromMap(json["header"]),
    trackingParams: json["trackingParams"],
  );

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

class MusicHeaderRendererHeader {
  ChipCloudRenderer? chipCloudRenderer;

  MusicHeaderRendererHeader({
    this.chipCloudRenderer,
  });

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

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

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

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

class ChipCloudRenderer {
  List<Chip>? chips;
  int? collapsedRowCount;
  String? trackingParams;
  bool? horizontalScrollable;

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

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

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

class Chip {
  ChipCloudChipRenderer? 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 : ChipCloudChipRenderer.fromMap(json["chipCloudChipRenderer"]),
  );

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

class ChipCloudChipRenderer {
  Style? style;
  ChipCloudChipRendererNavigationEndpoint? navigationEndpoint;
  String? trackingParams;
  Icon? icon;
  Accessibility? accessibilityData;
  bool? isSelected;
  DefaultTextClass? text;
  String? uniqueId;

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

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

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

  factory ChipCloudChipRenderer.fromMap(Map<String, dynamic> json) => ChipCloudChipRenderer(
    style: json["style"] == null ? null : Style.fromMap(json["style"]),
    navigationEndpoint: json["navigationEndpoint"] == null ? null : ChipCloudChipRendererNavigationEndpoint.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"],
    text: json["text"] == null ? null : DefaultTextClass.fromMap(json["text"]),
    uniqueId: json["uniqueId"],
  );

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

class ChipCloudChipRendererNavigationEndpoint {
  String? clickTrackingParams;
  SearchEndpoint? searchEndpoint;

  ChipCloudChipRendererNavigationEndpoint({
    this.clickTrackingParams,
    this.searchEndpoint,
  });

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

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

  factory ChipCloudChipRendererNavigationEndpoint.fromMap(Map<String, dynamic> json) => ChipCloudChipRendererNavigationEndpoint(
    clickTrackingParams: json["clickTrackingParams"],
    searchEndpoint: json["searchEndpoint"] == null ? null : SearchEndpoint.fromMap(json["searchEndpoint"]),
  );

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

class SearchEndpoint {
  String? query;
  String? params;

  SearchEndpoint({
    this.query,
    this.params,
  });

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

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

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

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

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 ResponseContext {
  String? visitorData;
  List<ServiceTrackingParam>? serviceTrackingParams;
  int? maxAgeSeconds;

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

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

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

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