blob: 0fc63ee8e47d239e16fca41a6e9cb2731f086c5e (
plain)
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
|
using System.Text.Json.Serialization;
namespace CommandLineWrapper.JsonResults.Implements;
public class ShareSeeResultGetter : JsonResultGetter<SeeShareResult>
{
private string _shareId;
public ShareSeeResultGetter(string shareId)
=> _shareId = shareId;
public void ChangeShareId(string shareId)
=> _shareId = shareId;
protected override Task<JVCSCommandInvoker.InvokeResult> ExecCommand(JVCSWorkspace workspace)
=> workspace.ShareSee(_shareId);
}
public struct SeeShareResult
{
public string ShareId { get; set; }
public string Sharer { get; set; }
public string Description { get; set; }
public Dictionary<string, SheetMappingMetadata> Mappings { get; set; }
}
public struct SheetMappingMetadata
{
// TIPS
// Since SheetMappingMetadata in the serialized output of the command-line tool `jv sheet see <SHARE_ID>`
// comes directly from the version control repository,
// its property names use the original lowercase snake_case naming,
// so JsonPropertyName must be explicitly specified for mapping.
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("ver")]
public string Version { get; set; }
}
|