1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-13 17:33:02 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/SharedApis/Models/Options/ParameterDescription.cs
T

62 lines
1.8 KiB
C#

using System;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Parameter description
/// </summary>
public class ParameterDescription
{
/// <summary>
/// Name of the parameter
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Names of the parameters
/// </summary>
public string[]? Names { get; set; }
/// <summary>
/// Type of the value
/// </summary>
public Type ValueType { get; set; }
/// <summary>
/// Parameter description
/// </summary>
public string Description { get; set; }
/// <summary>
/// Example value
/// </summary>
public object ExampleValue { get; set; }
/// <summary>
/// ctor
/// </summary>
public ParameterDescription(string parameterName, Type valueType, string description, object exampleValue)
{
Name = parameterName;
ValueType = valueType;
Description = description;
ExampleValue = exampleValue;
}
/// <summary>
/// ctor
/// </summary>
public ParameterDescription(string[] parameterNames, Type valueType, string description, object exampleValue)
{
Names = parameterNames;
ValueType = valueType;
Description = description;
ExampleValue = exampleValue;
}
/// <inheritdoc />
public override string ToString()
{
if (Name != null)
return $"[{ValueType.Name}] {Name}: {Description} | example: {ExampleValue}";
return $"[{ValueType.Name}] {string.Join(" / ", Names!)}: {Description} | example: {ExampleValue}";
}
}
}