// Author: fengshengxiong
// Date: 2024/7/28
// Description: 搜索结果模型

import 'dart:convert';

class SearchResultModel {
  ResponseContext? responseContext;
  Contents? contents;
  String? trackingParams;

  SearchResultModel({
    this.responseContext,
    this.contents,
    this.trackingParams,
  });

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

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

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

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

class Contents {
  TabbedSearchResultsRenderer? tabbedSearchResultsRenderer;

  Contents({
    this.tabbedSearchResultsRenderer,
  });

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

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

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

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

class TabbedSearchResultsRenderer {
  List<Tab>? tabs;

  TabbedSearchResultsRenderer({
    this.tabs,
  });

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

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

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

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

class Tab {
  TabRenderer? tabRenderer;

  Tab({
    this.tabRenderer,
  });

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

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

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

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

class TabRenderer {
  String? title;
  bool? selected;
  TabRendererContent? content;
  String? tabIdentifier;
  String? trackingParams;

  TabRenderer({
    this.title,
    this.selected,
    this.content,
    this.tabIdentifier,
    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(
    title: json["title"],
    selected: json["selected"],
    content: json["content"] == null ? null : TabRendererContent.fromMap(json["content"]),
    tabIdentifier: json["tabIdentifier"],
    trackingParams: json["trackingParams"],
  );

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

class TabRendererContent {
  SectionListRenderer? 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 : SectionListRenderer.fromMap(json["sectionListRenderer"]),
  );

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

class SectionListRenderer {
  List<SectionListRendererContent>? contents;
  String? trackingParams;
  SectionListRendererHeader? header;

  SectionListRenderer({
    this.contents,
    this.trackingParams,
    this.header,
  });

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

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

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

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

class SectionListRendererContent {
  MusicCardShelfRenderer? musicCardShelfRenderer;
  MusicShelfRenderer? musicShelfRenderer;

  SectionListRendererContent({
    this.musicCardShelfRenderer,
    this.musicShelfRenderer,
  });

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

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

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

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

class MusicCardShelfRenderer {
  String? trackingParams;
  MusicResponsiveListItemRendererThumbnail? thumbnail;
  Title? title;
  Subtitle? subtitle;
  List<MusicCardShelfRendererContent>? contents;
  List<ButtonElement>? buttons;
  MusicCardShelfRendererMenu? menu;
  OnTap? onTap;
  MusicCardShelfRendererHeader? header;
  ThumbnailOverlayClass? thumbnailOverlay;

  MusicCardShelfRenderer({
    this.trackingParams,
    this.thumbnail,
    this.title,
    this.subtitle,
    this.contents,
    this.buttons,
    this.menu,
    this.onTap,
    this.header,
    this.thumbnailOverlay,
  });

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

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

  factory MusicCardShelfRenderer.fromMap(Map<String, dynamic> json) => MusicCardShelfRenderer(
    trackingParams: json["trackingParams"],
    thumbnail: json["thumbnail"] == null ? null : MusicResponsiveListItemRendererThumbnail.fromMap(json["thumbnail"]),
    title: json["title"] == null ? null : Title.fromMap(json["title"]),
    subtitle: json["subtitle"] == null ? null : Subtitle.fromMap(json["subtitle"]),
    contents: json["contents"] == null ? [] : List<MusicCardShelfRendererContent>.from(json["contents"]!.map((x) => MusicCardShelfRendererContent.fromMap(x))),
    buttons: json["buttons"] == null ? [] : List<ButtonElement>.from(json["buttons"]!.map((x) => ButtonElement.fromMap(x))),
    menu: json["menu"] == null ? null : MusicCardShelfRendererMenu.fromMap(json["menu"]),
    onTap: json["onTap"] == null ? null : OnTap.fromMap(json["onTap"]),
    header: json["header"] == null ? null : MusicCardShelfRendererHeader.fromMap(json["header"]),
    thumbnailOverlay: json["thumbnailOverlay"] == null ? null : ThumbnailOverlayClass.fromMap(json["thumbnailOverlay"]),
  );

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

class ButtonElement {
  PurpleButtonRenderer? buttonRenderer;

  ButtonElement({
    this.buttonRenderer,
  });

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

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

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

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

class PurpleButtonRenderer {
  String? style;
  String? size;
  bool? isDisabled;
  BottomText? text;
  Icon? icon;
  AccessibilityAccessibility? accessibility;
  String? trackingParams;
  AccessibilityPauseDataClass? accessibilityData;
  ButtonRendererCommand? command;

  PurpleButtonRenderer({
    this.style,
    this.size,
    this.isDisabled,
    this.text,
    this.icon,
    this.accessibility,
    this.trackingParams,
    this.accessibilityData,
    this.command,
  });

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

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

  factory PurpleButtonRenderer.fromMap(Map<String, dynamic> json) => PurpleButtonRenderer(
    style: json["style"],
    size: json["size"],
    isDisabled: json["isDisabled"],
    text: json["text"] == null ? null : BottomText.fromMap(json["text"]),
    icon: json["icon"] == null ? null : Icon.fromMap(json["icon"]),
    accessibility: json["accessibility"] == null ? null : AccessibilityAccessibility.fromMap(json["accessibility"]),
    trackingParams: json["trackingParams"],
    accessibilityData: json["accessibilityData"] == null ? null : AccessibilityPauseDataClass.fromMap(json["accessibilityData"]),
    command: json["command"] == null ? null : ButtonRendererCommand.fromMap(json["command"]),
  );

  Map<String, dynamic> toMap() => {
    "style": style,
    "size": size,
    "isDisabled": isDisabled,
    "text": text?.toMap(),
    "icon": icon?.toMap(),
    "accessibility": accessibility?.toMap(),
    "trackingParams": trackingParams,
    "accessibilityData": accessibilityData?.toMap(),
    "command": command?.toMap(),
  };
}

class AccessibilityAccessibility {
  String? label;

  AccessibilityAccessibility({
    this.label,
  });

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

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

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

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

class AccessibilityPauseDataClass {
  AccessibilityAccessibility? accessibilityData;

  AccessibilityPauseDataClass({
    this.accessibilityData,
  });

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

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

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

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

class ButtonRendererCommand {
  String? clickTrackingParams;
  CommandWatchEndpoint? watchEndpoint;
  ModalEndpoint? modalEndpoint;

  ButtonRendererCommand({
    this.clickTrackingParams,
    this.watchEndpoint,
    this.modalEndpoint,
  });

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

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

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

  Map<String, dynamic> toMap() => {
    "clickTrackingParams": clickTrackingParams,
    "watchEndpoint": watchEndpoint?.toMap(),
    "modalEndpoint": modalEndpoint?.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 {
  BottomText? title;
  BottomText? 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 : BottomText.fromMap(json["title"]),
    content: json["content"] == null ? null : BottomText.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 {
  FluffyButtonRenderer? 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 : FluffyButtonRenderer.fromMap(json["buttonRenderer"]),
  );

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

class FluffyButtonRenderer {
  String? style;
  bool? isDisabled;
  BottomText? text;
  ButtonRendererNavigationEndpoint? navigationEndpoint;
  String? trackingParams;

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

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

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

  factory FluffyButtonRenderer.fromMap(Map<String, dynamic> json) => FluffyButtonRenderer(
    style: json["style"],
    isDisabled: json["isDisabled"],
    text: json["text"] == null ? null : BottomText.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 BottomText {
  List<BottomTextRun>? runs;

  BottomText({
    this.runs,
  });

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

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

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

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

class BottomTextRun {
  String? text;

  BottomTextRun({
    this.text,
  });

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

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

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

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

class CommandWatchEndpoint {
  String? videoId;
  String? params;
  WatchEndpointMusicSupportedConfigs? watchEndpointMusicSupportedConfigs;

  CommandWatchEndpoint({
    this.videoId,
    this.params,
    this.watchEndpointMusicSupportedConfigs,
  });

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

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

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

  Map<String, dynamic> toMap() => {
    "videoId": videoId,
    "params": params,
    "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 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 MusicCardShelfRendererContent {
  MessageRenderer? messageRenderer;
  PurpleMusicResponsiveListItemRenderer? musicResponsiveListItemRenderer;

  MusicCardShelfRendererContent({
    this.messageRenderer,
    this.musicResponsiveListItemRenderer,
  });

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

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

  factory MusicCardShelfRendererContent.fromMap(Map<String, dynamic> json) => MusicCardShelfRendererContent(
    messageRenderer: json["messageRenderer"] == null ? null : MessageRenderer.fromMap(json["messageRenderer"]),
    musicResponsiveListItemRenderer: json["musicResponsiveListItemRenderer"] == null ? null : PurpleMusicResponsiveListItemRenderer.fromMap(json["musicResponsiveListItemRenderer"]),
  );

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

class MessageRenderer {
  BottomText? text;
  String? trackingParams;
  MessageRendererStyle? style;

  MessageRenderer({
    this.text,
    this.trackingParams,
    this.style,
  });

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

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

  factory MessageRenderer.fromMap(Map<String, dynamic> json) => MessageRenderer(
    text: json["text"] == null ? null : BottomText.fromMap(json["text"]),
    trackingParams: json["trackingParams"],
    style: json["style"] == null ? null : MessageRendererStyle.fromMap(json["style"]),
  );

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

class MessageRendererStyle {
  String? value;

  MessageRendererStyle({
    this.value,
  });

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

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

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

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

class PurpleMusicResponsiveListItemRenderer {
  String? trackingParams;
  MusicResponsiveListItemRendererThumbnail? thumbnail;
  ThumbnailOverlayClass? overlay;
  List<FlexColumn>? flexColumns;
  MusicCardShelfRendererMenu? menu;
  PlaylistItemData? playlistItemData;
  String? flexColumnDisplayStyle;
  String? itemHeight;

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

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

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

  factory PurpleMusicResponsiveListItemRenderer.fromMap(Map<String, dynamic> json) => PurpleMusicResponsiveListItemRenderer(
    trackingParams: json["trackingParams"],
    thumbnail: json["thumbnail"] == null ? null : MusicResponsiveListItemRendererThumbnail.fromMap(json["thumbnail"]),
    overlay: json["overlay"] == null ? null : ThumbnailOverlayClass.fromMap(json["overlay"]),
    flexColumns: json["flexColumns"] == null ? [] : List<FlexColumn>.from(json["flexColumns"]!.map((x) => FlexColumn.fromMap(x))),
    menu: json["menu"] == null ? null : MusicCardShelfRendererMenu.fromMap(json["menu"]),
    playlistItemData: json["playlistItemData"] == null ? null : PlaylistItemData.fromMap(json["playlistItemData"]),
    flexColumnDisplayStyle: json["flexColumnDisplayStyle"],
    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,
    "itemHeight": itemHeight,
  };
}

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;
  PurpleNavigationEndpoint? 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 : PurpleNavigationEndpoint.fromMap(json["navigationEndpoint"]),
  );

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

class PurpleNavigationEndpoint {
  String? clickTrackingParams;
  OnTapWatchEndpoint? watchEndpoint;
  BrowseEndpoint? browseEndpoint;

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

  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"],
    watchEndpoint: json["watchEndpoint"] == null ? null : OnTapWatchEndpoint.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 OnTapWatchEndpoint {
  String? videoId;
  WatchEndpointMusicSupportedConfigs? watchEndpointMusicSupportedConfigs;

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

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

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

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

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

class MusicCardShelfRendererMenu {
  PurpleMenuRenderer? menuRenderer;

  MusicCardShelfRendererMenu({
    this.menuRenderer,
  });

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

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

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

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

class PurpleMenuRenderer {
  List<ItemElement>? items;
  String? trackingParams;
  AccessibilityPauseDataClass? accessibility;

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

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

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

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

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

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 {
  BottomText? 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 : BottomText.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 MenuNavigationItemRendererNavigationEndpoint {
  String? clickTrackingParams;
  PurpleWatchEndpoint? watchEndpoint;
  ModalEndpoint? modalEndpoint;
  ShareEntityEndpoint? shareEntityEndpoint;
  BrowseEndpoint? browseEndpoint;
  WatchPlaylistEndpoint? watchPlaylistEndpoint;

  MenuNavigationItemRendererNavigationEndpoint({
    this.clickTrackingParams,
    this.watchEndpoint,
    this.modalEndpoint,
    this.shareEntityEndpoint,
    this.browseEndpoint,
    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 : PurpleWatchEndpoint.fromMap(json["watchEndpoint"]),
    modalEndpoint: json["modalEndpoint"] == null ? null : ModalEndpoint.fromMap(json["modalEndpoint"]),
    shareEntityEndpoint: json["shareEntityEndpoint"] == null ? null : ShareEntityEndpoint.fromMap(json["shareEntityEndpoint"]),
    browseEndpoint: json["browseEndpoint"] == null ? null : BrowseEndpoint.fromMap(json["browseEndpoint"]),
    watchPlaylistEndpoint: json["watchPlaylistEndpoint"] == null ? null : WatchPlaylistEndpoint.fromMap(json["watchPlaylistEndpoint"]),
  );

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

class ShareEntityEndpoint {
  String? serializedShareEntity;
  String? sharePanelType;

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

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

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

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

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

class PurpleWatchEndpoint {
  String? videoId;
  String? playlistId;
  String? params;
  LoggingContext? loggingContext;
  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 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<CommandElement>? 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<CommandElement>.from(json["commands"]!.map((x) => CommandElement.fromMap(x))),
  );

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

class CommandElement {
  String? clickTrackingParams;
  AddToToastAction? addToToastAction;

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

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

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

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

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

  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 : BottomText.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 : BottomText.fromMap(json["toggledText"]),
    toggledIcon: json["toggledIcon"] == null ? null : Icon.fromMap(json["toggledIcon"]),
    trackingParams: json["trackingParams"],
    toggledServiceEndpoint: json["toggledServiceEndpoint"] == null ? null : ToggledServiceEndpoint.fromMap(json["toggledServiceEndpoint"]),
  );

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

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 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;
  Target? 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 : Target.fromMap(json["target"]),
  );

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

class Target {
  String? playlistId;

  Target({
    this.playlistId,
  });

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

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

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

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

class ThumbnailOverlayClass {
  ThumbnailOverlayMusicItemThumbnailOverlayRenderer? musicItemThumbnailOverlayRenderer;

  ThumbnailOverlayClass({
    this.musicItemThumbnailOverlayRenderer,
  });

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

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

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

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

class ThumbnailOverlayMusicItemThumbnailOverlayRenderer {
  Background? background;
  PurpleContent? content;
  String? contentPosition;
  String? displayStyle;

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

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

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

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

  PurpleContent({
    this.musicPlayButtonRenderer,
  });

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

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

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

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

class PurpleMusicPlayButtonRenderer {
  OnTap? 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;
  AccessibilityPauseDataClass? accessibilityPlayData;
  AccessibilityPauseDataClass? accessibilityPauseData;

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

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

  factory PurpleMusicPlayButtonRenderer.fromMap(Map<String, dynamic> json) => PurpleMusicPlayButtonRenderer(
    playNavigationEndpoint: json["playNavigationEndpoint"] == null ? null : OnTap.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 : AccessibilityPauseDataClass.fromMap(json["accessibilityPlayData"]),
    accessibilityPauseData: json["accessibilityPauseData"] == null ? null : AccessibilityPauseDataClass.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 OnTap {
  String? clickTrackingParams;
  OnTapWatchEndpoint? watchEndpoint;
  BrowseEndpoint? browseEndpoint;

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

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

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

  factory OnTap.fromMap(Map<String, dynamic> json) => OnTap(
    clickTrackingParams: json["clickTrackingParams"],
    watchEndpoint: json["watchEndpoint"] == null ? null : OnTapWatchEndpoint.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 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 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 MusicCardShelfRendererHeader {
  MusicCardShelfHeaderBasicRenderer? musicCardShelfHeaderBasicRenderer;

  MusicCardShelfRendererHeader({
    this.musicCardShelfHeaderBasicRenderer,
  });

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

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

  factory MusicCardShelfRendererHeader.fromMap(Map<String, dynamic> json) => MusicCardShelfRendererHeader(
    musicCardShelfHeaderBasicRenderer: json["musicCardShelfHeaderBasicRenderer"] == null ? null : MusicCardShelfHeaderBasicRenderer.fromMap(json["musicCardShelfHeaderBasicRenderer"]),
  );

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

class MusicCardShelfHeaderBasicRenderer {
  BottomText? title;
  String? trackingParams;

  MusicCardShelfHeaderBasicRenderer({
    this.title,
    this.trackingParams,
  });

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

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

  factory MusicCardShelfHeaderBasicRenderer.fromMap(Map<String, dynamic> json) => MusicCardShelfHeaderBasicRenderer(
    title: json["title"] == null ? null : BottomText.fromMap(json["title"]),
    trackingParams: json["trackingParams"],
  );

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

class Subtitle {
  List<SubtitleRun>? runs;

  Subtitle({
    this.runs,
  });

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

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

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

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

class SubtitleRun {
  String? text;
  MusicResponsiveListItemRendererNavigationEndpoint? navigationEndpoint;

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

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

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

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

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

class MusicResponsiveListItemRendererNavigationEndpoint {
  String? clickTrackingParams;
  BrowseEndpoint? browseEndpoint;

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

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

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

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

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

class Title {
  List<FluffyRun>? runs;

  Title({
    this.runs,
  });

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

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

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

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

class FluffyRun {
  String? text;
  OnTap? navigationEndpoint;

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

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

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

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

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

class MusicShelfRenderer {
  BottomText? title;
  List<MusicShelfRendererContent>? contents;
  String? trackingParams;
  BottomText? bottomText;
  Endpoint? bottomEndpoint;
  List<Continuation>? continuations;
  ShelfDivider? shelfDivider;

  MusicShelfRenderer({
    this.title,
    this.contents,
    this.trackingParams,
    this.bottomText,
    this.bottomEndpoint,
    this.continuations,
    this.shelfDivider,
  });

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

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

  factory MusicShelfRenderer.fromMap(Map<String, dynamic> json) => MusicShelfRenderer(
    title: json["title"] == null ? null : BottomText.fromMap(json["title"]),
    contents: json["contents"] == null ? [] : List<MusicShelfRendererContent>.from(json["contents"]!.map((x) => MusicShelfRendererContent.fromMap(x))),
    trackingParams: json["trackingParams"],
    bottomText: json["bottomText"] == null ? null : BottomText.fromMap(json["bottomText"]),
    bottomEndpoint: json["bottomEndpoint"] == null ? null : Endpoint.fromMap(json["bottomEndpoint"]),
    continuations: json["continuations"] == null ? [] : List<Continuation>.from(json["continuations"]!.map((x) => Continuation.fromMap(x))),
    shelfDivider: json["shelfDivider"] == null ? null : ShelfDivider.fromMap(json["shelfDivider"]),
  );

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

class Endpoint {
  String? clickTrackingParams;
  SearchEndpoint? searchEndpoint;

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

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

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

  factory Endpoint.fromMap(Map<String, dynamic> json) => Endpoint(
    clickTrackingParams: json["clickTrackingParams"],
    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 MusicShelfRendererContent {
  FluffyMusicResponsiveListItemRenderer? 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 : FluffyMusicResponsiveListItemRenderer.fromMap(json["musicResponsiveListItemRenderer"]),
  );

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

class FluffyMusicResponsiveListItemRenderer {
  String? trackingParams;
  MusicResponsiveListItemRendererThumbnail? thumbnail;
  PurpleOverlay? overlay;
  List<FlexColumn>? flexColumns;
  PurpleMenu? menu;
  PlaylistItemData? playlistItemData;
  String? flexColumnDisplayStyle;
  String? itemHeight;
  MusicResponsiveListItemRendererNavigationEndpoint? navigationEndpoint;

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

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

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

  factory FluffyMusicResponsiveListItemRenderer.fromMap(Map<String, dynamic> json) => FluffyMusicResponsiveListItemRenderer(
    trackingParams: json["trackingParams"],
    thumbnail: json["thumbnail"] == null ? null : MusicResponsiveListItemRendererThumbnail.fromMap(json["thumbnail"]),
    overlay: json["overlay"] == null ? null : PurpleOverlay.fromMap(json["overlay"]),
    flexColumns: json["flexColumns"] == null ? [] : List<FlexColumn>.from(json["flexColumns"]!.map((x) => FlexColumn.fromMap(x))),
    menu: json["menu"] == null ? null : PurpleMenu.fromMap(json["menu"]),
    playlistItemData: json["playlistItemData"] == null ? null : PlaylistItemData.fromMap(json["playlistItemData"]),
    flexColumnDisplayStyle: json["flexColumnDisplayStyle"],
    itemHeight: json["itemHeight"],
    navigationEndpoint: json["navigationEndpoint"] == null ? null : MusicResponsiveListItemRendererNavigationEndpoint.fromMap(json["navigationEndpoint"]),
  );

  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,
    "itemHeight": itemHeight,
    "navigationEndpoint": navigationEndpoint?.toMap(),
  };
}

class PurpleMenu {
  FluffyMenuRenderer? menuRenderer;

  PurpleMenu({
    this.menuRenderer,
  });

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

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

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

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

class FluffyMenuRenderer {
  List<ItemElement>? items;
  String? trackingParams;
  AccessibilityPauseDataClass? accessibility;
  List<TopLevelButton>? topLevelButtons;

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

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

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

  factory FluffyMenuRenderer.fromMap(Map<String, dynamic> json) => FluffyMenuRenderer(
    items: json["items"] == null ? [] : List<ItemElement>.from(json["items"]!.map((x) => ItemElement.fromMap(x))),
    trackingParams: json["trackingParams"],
    accessibility: json["accessibility"] == null ? null : AccessibilityPauseDataClass.fromMap(json["accessibility"]),
    topLevelButtons: json["topLevelButtons"] == null ? [] : List<TopLevelButton>.from(json["topLevelButtons"]!.map((x) => TopLevelButton.fromMap(x))),
  );

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

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

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

class PurpleOverlay {
  PurpleMusicItemThumbnailOverlayRenderer? musicItemThumbnailOverlayRenderer;

  PurpleOverlay({
    this.musicItemThumbnailOverlayRenderer,
  });

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

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

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

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

class PurpleMusicItemThumbnailOverlayRenderer {
  Background? background;
  FluffyContent? content;
  String? contentPosition;
  String? displayStyle;

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

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

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

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

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

class FluffyContent {
  FluffyMusicPlayButtonRenderer? musicPlayButtonRenderer;

  FluffyContent({
    this.musicPlayButtonRenderer,
  });

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

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

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

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

class FluffyMusicPlayButtonRenderer {
  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;
  AccessibilityPauseDataClass? accessibilityPlayData;
  AccessibilityPauseDataClass? accessibilityPauseData;

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

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

  factory FluffyMusicPlayButtonRenderer.fromMap(Map<String, dynamic> json) => FluffyMusicPlayButtonRenderer(
    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 : AccessibilityPauseDataClass.fromMap(json["accessibilityPlayData"]),
    accessibilityPauseData: json["accessibilityPauseData"] == null ? null : AccessibilityPauseDataClass.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;
  CommandWatchEndpoint? watchEndpoint;
  WatchPlaylistEndpoint? watchPlaylistEndpoint;

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

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

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

class Continuation {
  NextContinuationData? nextContinuationData;

  Continuation({
    this.nextContinuationData,
  });

  Continuation copyWith({
    NextContinuationData? nextContinuationData,
  }) =>
      Continuation(
        nextContinuationData: nextContinuationData ?? 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,
  });

  NextContinuationData copyWith({
    String? continuation,
    String? clickTrackingParams,
  }) =>
      NextContinuationData(
        continuation: continuation ?? this.continuation,
        clickTrackingParams: clickTrackingParams ?? 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 SectionListRendererHeader {
  ChipCloudRenderer? chipCloudRenderer;

  SectionListRendererHeader({
    this.chipCloudRenderer,
  });

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

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

  factory SectionListRendererHeader.fromMap(Map<String, dynamic> json) => SectionListRendererHeader(
    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 {
  ChipCloudChipRendererStyle? style;
  BottomText? text;
  Endpoint? navigationEndpoint;
  String? trackingParams;
  AccessibilityPauseDataClass? accessibilityData;
  bool? isSelected;
  String? uniqueId;

  ChipCloudChipRenderer({
    this.style,
    this.text,
    this.navigationEndpoint,
    this.trackingParams,
    this.accessibilityData,
    this.isSelected,
    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 : ChipCloudChipRendererStyle.fromMap(json["style"]),
    text: json["text"] == null ? null : BottomText.fromMap(json["text"]),
    navigationEndpoint: json["navigationEndpoint"] == null ? null : Endpoint.fromMap(json["navigationEndpoint"]),
    trackingParams: json["trackingParams"],
    accessibilityData: json["accessibilityData"] == null ? null : AccessibilityPauseDataClass.fromMap(json["accessibilityData"]),
    isSelected: json["isSelected"],
    uniqueId: json["uniqueId"],
  );

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

class ChipCloudChipRendererStyle {
  String? styleType;

  ChipCloudChipRendererStyle({
    this.styleType,
  });

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

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

  factory ChipCloudChipRendererStyle.fromMap(Map<String, dynamic> json) => ChipCloudChipRendererStyle(
    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,
  };
}
