You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.6 KiB
C#

namespace OpenAuth.WebApi;
public class CommonTopicRequest<T>
{
/**
* The command is sent and the response is matched by the tid and bid fields in the message,
* and the reply should keep the tid and bid the same.
*/
public string Tid { get; set; }
public string Bid { get; set; }
public long? Timestamp { get; set; }
public T Data { get; set; }
public override string ToString()
{
return $"CommonTopicRequest{{tid='{Tid}', bid='{Bid}', timestamp={Timestamp}, data={Data}}}";
}
public CommonTopicRequest<T> SetTid(string tid)
{
Tid = tid;
return this;
}
public CommonTopicRequest<T> SetBid(string bid)
{
Bid = bid;
return this;
}
public CommonTopicRequest<T> SetTimestamp(long? timestamp)
{
Timestamp = timestamp;
return this;
}
public CommonTopicRequest<T> SetData(T data)
{
Data = data;
return this;
}
}
public class OsdTopicRequest<T> : CommonTopicRequest<T>
{
public string method { get; set; }
public OsdTopicRequest<T> SetTid(string tid)
{
Tid = tid;
return this;
}
public OsdTopicRequest<T> SetBid(string bid)
{
Bid = bid;
return this;
}
public OsdTopicRequest<T> SetTimestamp(long? timestamp)
{
Timestamp = timestamp;
return this;
}
public OsdTopicRequest<T> SetData(T data)
{
Data = data;
return this;
}
public OsdTopicRequest<T> SetMethod(string method)
{
this.method = method;
return this;
}
}