55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
namespace Spark.Api.Server {
|
|
using bts.api;
|
|
using bts.utils;
|
|
|
|
using CommandLine;
|
|
|
|
using Spark.Core;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
[Verb("dump-securities")]
|
|
public class DumpSecuritiesOptions {
|
|
[Option("user", Default = CommonOptionMetadata.DEFAULT_USER)]
|
|
public string? user { get; set; }
|
|
|
|
[Option("password", Default = CommonOptionMetadata.DEFAULT_PASSWORD)]
|
|
public string? password { get; set; }
|
|
|
|
[Option(
|
|
"sparkd",
|
|
MetaValue = CommonOptionMetadata.SPARKD_META_VALUE,
|
|
HelpText = CommonOptionMetadata.SPARKD_HELP_TEXT)]
|
|
public string? sparkd { get; set; }
|
|
|
|
[Option("types", HelpText = "The types of securities to dump", Separator = ' ')]
|
|
public IEnumerable<SecurityType>? types { get; set; }
|
|
|
|
[Option("venues", HelpText = "The venues to query", Separator = ' ')]
|
|
public IEnumerable<Venue>? venues { get; set; }
|
|
|
|
[Option("assets", HelpText = "The assets to query", Separator = ' ')]
|
|
public IEnumerable<string>? assets { get; set; }
|
|
|
|
[Option("verbose", HelpText = "Whether or not to show verbose output")]
|
|
public bool verbose { get; set; }
|
|
|
|
[Option("timeout", HelpText = "The amount of time to wait for securities")]
|
|
public TimeSpan? timeout { get; set; }
|
|
|
|
public override string ToString() =>
|
|
TableFormatter.fmt_table(new (string, object?)[] {
|
|
("user", user),
|
|
("password", password),
|
|
("sparkd", sparkd),
|
|
("assets", ", ".join(assets.empty_if_null())),
|
|
("venues", ", ".join(venues.empty_if_null())),
|
|
("types", ", ".join(types.empty_if_null())),
|
|
("verbose", verbose),
|
|
("timeout", timeout),
|
|
});
|
|
}
|
|
}
|