diff --git a/Zabbix/Entities/Item.cs b/Zabbix/Entities/Item.cs index 6015da1..03af6c2 100644 --- a/Zabbix/Entities/Item.cs +++ b/Zabbix/Entities/Item.cs @@ -39,7 +39,7 @@ public class Item : BaseEntity [JsonProperty("valuemapid")] public string? Valuemapid { get; set; } - [JsonProperty("params")] public string? Params { get; set; } + [JsonProperty("params")] public Dictionary? Params { get; set; } [JsonProperty("ipmi_sensor")] public string? IpmiSensor { get; set; } @@ -71,7 +71,7 @@ public class Item : BaseEntity [JsonProperty("url")] public string? Url { get; set; } - [JsonProperty("query_fields")] public object? QueryFields { get; set; } //TODO: map this to something else + [JsonProperty("query_fields")] public List? QueryFields { get; set; } [JsonProperty("posts")] public string? Posts { get; set; } @@ -83,7 +83,7 @@ public class Item : BaseEntity [JsonProperty("http_proxy")] public string? HttpProxy { get; set; } - [JsonProperty("headers")] public HttpField? Headers { get; set; } //TODO make this something thats not object, bug: doesnt work with list of httpfields, above and below are two more with same problem + [JsonProperty("headers")] public Dictionary? Headers { get; set; } [JsonProperty("retrieve_mode")] public int? RetrieveMode { get; set; } @@ -109,7 +109,8 @@ public class Item : BaseEntity [JsonProperty("error")] public string? Error { get; set; } - [JsonProperty("parameters")] public object? Parameters { get; set; } + [JsonProperty("parameters")] public List? Parameters { get; set; } + [JsonProperty("lastclock")] public string? Lastclock { get; set; } @@ -167,7 +168,7 @@ public class ItemPreprocessing [JsonProperty("type")] public int? Type { get; set; } - [JsonProperty("params")] public string? Params { get; set; } + [JsonProperty("params")] public Dictionary? Params { get; set; } [JsonProperty("error_handler")] public int? ErrorHandler { get; set; } @@ -177,7 +178,7 @@ public class ItemPreprocessing #region Constructors - public ItemPreprocessing(int type, string @params, int errorHandler, string errorHandlerParams) + public ItemPreprocessing(int type, Dictionary @params, int errorHandler, string errorHandlerParams) { Type = type; Params = @params; diff --git a/Zabbix/Entities/ItemPrototype.cs b/Zabbix/Entities/ItemPrototype.cs index 52c0619..dcb560b 100644 --- a/Zabbix/Entities/ItemPrototype.cs +++ b/Zabbix/Entities/ItemPrototype.cs @@ -49,7 +49,7 @@ public class ItemPrototype : BaseEntity public int? FollowRedirects { get; set; } [JsonProperty("headers")] - public HttpField? Headers { get; set; } + public Dictionary? Headers { get; set; } [JsonProperty("history")] public string? History { get; set; } @@ -73,7 +73,7 @@ public class ItemPrototype : BaseEntity public int? OutputFormat { get; set; } [JsonProperty("params")] - public string? Params { get; set; } + public Dictionary? Params { get; set; } [JsonProperty("parameters")] public IList? Parameters { get; set; } @@ -218,7 +218,7 @@ public class ItemPrototypePreprocessing public int? Type { get; set; } [JsonProperty("params")] - public string? Params { get; set; } + public Dictionary? Params { get; set; } [JsonProperty("error_handler")] public int? ErrorHandler { get; set; } @@ -230,7 +230,7 @@ public class ItemPrototypePreprocessing #region Constructors - public ItemPrototypePreprocessing(int type, string @params, int errorHandler, string errorHandlerParams) + public ItemPrototypePreprocessing(int type, Dictionary @params, int errorHandler, string errorHandlerParams) { Type = type; Params = @params; diff --git a/Zabbix/Entities/LLDRule.cs b/Zabbix/Entities/LLDRule.cs index b95526a..3d76b98 100644 --- a/Zabbix/Entities/LLDRule.cs +++ b/Zabbix/Entities/LLDRule.cs @@ -65,7 +65,7 @@ public class LldRule : BaseEntity public int? OutputFormat { get; set; } [JsonProperty("params")] - public string? Params { get; set; } + public Dictionary? Params { get; set; } [JsonProperty("password")] public string? Password { get; set; } @@ -135,7 +135,7 @@ public class LldRule : BaseEntity #region Components [JsonProperty("headers")] - public object? Headers { get; set; } + public Dictionary? Headers { get; set; } [JsonProperty("parameters")] public IList? Parameters { get; set; } @@ -272,7 +272,7 @@ public class LLdRulePreprocessing public int? Type { get; set; } [JsonProperty("params")] - public string? Params { get; set; } + public Dictionary? Params { get; set; } [JsonProperty("error_handler")] public int? ErrorHandler { get; set; } @@ -284,7 +284,7 @@ public class LLdRulePreprocessing #region Constructors - public LLdRulePreprocessing(int type, string @params, int errorHandler, string errorHandlerParams) + public LLdRulePreprocessing(int type, Dictionary @params, int errorHandler, string errorHandlerParams) { Type = type; Params = @params; diff --git a/Zabbix/Zabbix.csproj b/Zabbix/Zabbix.csproj index 05f725e..467d30c 100644 --- a/Zabbix/Zabbix.csproj +++ b/Zabbix/Zabbix.csproj @@ -8,7 +8,7 @@ Zabbix 6.0 API Library Stefan Hasler - 1.2.3 + 1.2.4 $(AssemblyName).Api.NET Library to communicate with the 6.0 Zabbix Api