-
Notifications
You must be signed in to change notification settings - Fork 368
/
ExecuteRequest.cs
40 lines (32 loc) · 1.42 KB
/
ExecuteRequest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Microsoft.DotNet.Interactive.Jupyter.Protocol
{
[JupyterMessageType(JupyterMessageContentTypes.ExecuteRequest)]
public class ExecuteRequest : RequestMessage
{
[JsonPropertyName("code")]
public string Code { get; }
[JsonPropertyName("silent")]
public bool Silent { get; }
[JsonPropertyName("store_history")]
public bool StoreHistory { get; }
[JsonPropertyName("user_expressions")]
public IReadOnlyDictionary<string, string> UserExpressions { get; }
[JsonPropertyName("allow_stdin")]
public bool AllowStdin { get; }
[JsonPropertyName("stop_on_error")]
public bool StopOnError { get; }
public ExecuteRequest(string code, bool silent = false, bool storeHistory = false, bool allowStdin = true, bool stopOnError = false, IReadOnlyDictionary<string, string> userExpressions = null)
{
Silent = silent;
StoreHistory = storeHistory;
AllowStdin = allowStdin;
StopOnError = stopOnError;
UserExpressions = userExpressions ?? new Dictionary<string, string>();
Code = code ?? string.Empty;
}
}
}