123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Text.Json.Serialization;
- namespace DeviceInfoToAliIotHubViaGateway
- {
- internal class Device3Tuple
- {
- internal Device3Tuple(string productKey, string deviceName, string deviceSecret) : this(null, productKey, deviceName, deviceSecret)
- {
- }
- internal Device3Tuple(string productName, string productKey, string deviceName, string deviceSecret)
- {
- this.ProductName = productName;
- this.ProductKey = productKey;
- this.DeviceName = deviceName;
- this.DeviceSecret = deviceSecret;
- }
- public string ProductName { get; set; }
- public string ProductKey { get; set; }
- public string DeviceName { get; set; }
- public string DeviceSecret { get; set; }
- }
-
-
-
- public class DynamicDevice2TupleParam
- {
-
-
-
- public string deviceName { get; set; }
-
-
-
- public string productKey { get; set; }
- }
-
-
-
- internal class DynamicDeviceRegResponseParam
- {
-
-
-
- public string iotId { get; set; }
-
-
-
- public string deviceSecret { get; set; }
- public string productKey { get; set; }
- public string deviceName { get; set; }
- }
- internal class DynamicDeviceRegRequest
- {
-
-
-
- public string id { get; set; }
-
-
-
- public string version => "1.0";
-
-
-
- [JsonPropertyName("params")]
- public List<DynamicDevice2TupleParam> Params { get; set; }
-
-
-
- public string method => "thing.sub.register";
- }
- internal class DynamicDeviceRegResponse
- {
-
-
-
-
-
-
-
- public int code { get; set; }
- public List<DynamicDeviceRegResponseParam> data { get; set; }
- public string id { get; set; }
- public string message { get; set; }
- public string method { get; set; }
- public string version { get; set; }
- }
-
-
-
- internal class DynamicDeviceTopoAddRequestParam
- {
-
-
-
- public string deviceName { get; set; }
-
-
-
- public string productKey { get; set; }
-
-
-
-
-
-
-
-
- public string sign { get; set; }
- public string signmethod => "hmacSha1";
-
-
-
- public string timestamp { get; set; }
-
-
-
- public string clientId { get; set; }
- }
-
-
-
- internal class DynamicDeviceTopoAddRequest
- {
-
-
-
- public string id { get; set; }
-
-
-
- public string version => "1.0";
-
-
-
- [JsonPropertyName("params")]
- public List<DynamicDeviceTopoAddRequestParam> Params { get; set; }
-
-
-
- public string method => "thing.topo.add";
- }
-
-
-
- internal class DynamicDeviceTopoAddResponse
- {
-
-
-
-
-
-
- public int code { get; set; }
- public object data { get; set; }
- public string id { get; set; }
- public string message { get; set; }
- public string method { get; set; }
- public string version { get; set; }
- }
-
-
-
- internal class DynamicDeviceTopoDeleteRequest
- {
-
-
-
- public string id { get; set; }
-
-
-
- public string version => "1.0";
-
-
-
- [JsonPropertyName("params")]
- public List<DynamicDevice2TupleParam> Params { get; set; }
-
-
-
- public string method => "thing.topo.delete";
- }
-
-
-
- internal class DynamicDeviceTopoDeleteResponse
- {
- public string id { get; set; }
-
-
-
-
-
-
- public int code { get; set; }
- public object data { get; set; }
- }
-
-
-
- internal class DynamicDeviceTopoGetRequest
- {
-
-
-
- public string id { get; set; }
-
-
-
- public string version => "1.0";
-
-
-
- [JsonPropertyName("params")]
- public List<DynamicDevice2TupleParam> Params { get; }
-
-
-
- public string method => "thing.topo.get";
- }
-
-
-
- internal class DynamicDeviceTopoGetResponse
- {
- public string id { get; set; }
-
-
-
-
-
- public int code { get; set; }
- public List<DynamicDevice2TupleParam> data { get; set; }
- }
-
-
-
-
-
- internal class DynamicDeviceListFoundGetRequest
- {
-
-
-
- public string id { get; set; }
-
-
-
- public string version => "1.0";
-
-
-
- [JsonPropertyName("params")]
- public List<DynamicDevice2TupleParam> Params { get; set; }
-
-
-
- public string method => "thing.list.found";
- }
-
-
-
- internal class DynamicDeviceListFoundResponse
- {
- public string id { get; set; }
-
-
-
-
-
-
-
- public int code { get; set; }
- public object data { get; set; }
- }
-
-
-
-
-
- internal class DynamicDeviceTopoNotifyRequest
- {
-
-
-
- public string id { get; set; }
-
-
-
- public string version => "1.0";
-
-
-
- [JsonPropertyName("params")]
- public List<DynamicDevice2TupleParam> Params { get; }
-
-
-
- public string method => "thing.topo.add.notify";
- }
-
-
-
- internal class DynamicDeviceTopoNotifyResponse
- {
- public string id { get; set; }
-
-
-
-
- public int code { get; set; }
- public object data { get; set; }
- }
-
-
-
-
- internal class DynamicDeviceOnlineRequestParam
- {
-
-
-
- public string productKey { get; set; }
-
-
-
- public string deviceName { get; set; }
-
-
-
- public string clientId { get; set; }
-
-
-
- public string timestamp { get; set; }
- public string signMethod => "hmacSha1";
-
-
-
-
-
-
-
-
- public string sign { get; set; }
- public string cleanSession => "true";
- }
-
-
-
- internal class DynamicDeviceOnlineRequest
- {
- public string id { get; set; }
- [JsonPropertyName("params")]
- public DynamicDeviceOnlineRequestParam Params { get; set; }
- }
-
-
-
- internal class DynamicDeviceOnlineResponse
- {
-
-
-
-
-
-
-
-
-
-
-
-
- public int code { get; set; }
- public DynamicDevice2TupleParam data { get; set; }
- public string id { get; set; }
- public string message { get; set; }
- }
-
-
-
- internal class DynamicDeviceOfflineRequest
- {
- public string id { get; set; }
- [JsonPropertyName("params")]
- public DynamicDevice2TupleParam Params { get; set; }
- }
-
-
-
- internal class DynamicDeviceOfflineResponse
- {
- public string id { get; set; }
-
-
-
-
-
-
- public int code { get; set; }
- public string message { get; set; }
- public DynamicDevice2TupleParam data { get; set; }
- }
-
-
-
-
-
-
-
-
-
-
- public class Alink_PropertyChanging_FromLocal
- {
- public string id { get; set; }
- public string version => "1.0";
- [JsonPropertyName("params")]
- public object Params { get; set; }
- public string method => "thing.event.property.post";
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- public class Alink_EventFiring_FromLocal
- {
- private string _method;
- public Alink_EventFiring_FromLocal(string eventName)
- {
- this._method = $"thing.event.{eventName}.post";
- this.time = DateTime.Now.Ticks;
- }
- public string id { get; set; }
- public string version => "1.0";
- public object sys => new { ack = 0 };
- [JsonPropertyName("params")]
- public object Params { get; set; }
- public long time { get; set; }
- public string method => this._method;
- }
- public class Alink_ServiceCalled_FromRemote
- {
- private string _method;
- public Alink_ServiceCalled_FromRemote(string eventName)
- {
- this._method = $"thing.event.{eventName}.post";
- this.time = DateTime.Now.Ticks;
- }
- public string id { get; set; }
- public string version => "1.0";
- public object sys => new { ack = 0 };
- [JsonPropertyName("params")]
- public object Params { get; set; }
- public long time { get; set; }
- public string method => this._method;
- }
- public class Alink_ThingModel_LogicalNozzle
- {
- public int CurState { get; set; }
- public int PumpId { get; set; }
- public string ProductName { get; set; }
- public double Price { get; set; }
- public double LastSaleVol { get; set; }
- public double LastSaleAmt { get; set; }
- public double CurSaleVol { get; set; }
- public double CurSaleAmt { get; set; }
- public double TotalizerVol { get; set; }
- public int SiteLevelNozzleId { get; set; }
- public string LastSaleTime { get; set; }
- public int LogicalId { get; set; }
- }
- }
|