//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace Microsoft.SqlTools.ServiceLayer.NotebookConvert
{
///
/// Basic schema wrapper for parsing a Notebook document
///
public class NotebookDocument
{
[JsonProperty("metadata")]
public NotebookMetadata NotebookMetadata;
[JsonProperty("nbformat_minor")]
public int NotebookFormatMinor = 2;
[JsonProperty("nbformat")]
public int NotebookFormat = 4;
[JsonProperty("cells")]
public IList Cells = new List();
}
public class NotebookMetadata
{
[JsonProperty("kernelspec")]
public NotebookKernelSpec KernelSpec;
[JsonProperty("language_info")]
public NotebookLanguageInfo LanguageInfo;
}
public class NotebookKernelSpec
{
[JsonProperty("name")]
public string Name;
[JsonProperty("display_name")]
public string DisplayName;
[JsonProperty("language")]
public string Language;
}
public class NotebookLanguageInfo
{
[JsonProperty("name")]
public string Name;
[JsonProperty("version")]
public string Version;
}
///
/// Cell of a Notebook document
///
public class NotebookCell
{
public NotebookCell(string cellType, IList source)
{
this.CellType = cellType;
this.Source = source;
}
[JsonProperty("cell_type")]
public string CellType;
[JsonProperty("source")]
public IList Source;
}
}