From 85416aae67edc941c1a29c5147ab1c5f75ce198a Mon Sep 17 00:00:00 2001 From: Goran Obradovic Date: Sat, 9 Nov 2024 01:46:47 +0100 Subject: [PATCH] Regenerate LoadMetricInformation with double properties (#141) The following properties changed type because they were previously incorrectly defined in the swagger spec: `balancingThreshold`: `int` -> `double` `activityThreshold`: `int` -> `string` `currentClusterLoad`: `int` -> `double` `clusterCapacityRemaining`: `int` -> `double` `nodeBufferPercentage`: `int` -> `double` `bufferedClusterCapacityRemaining`: `int` -> `double` `clusterRemainingBufferedCapacity`: `int` -> `string` `minimumNodeLoad`: `int` -> `double` `maximumNodeLoad`: `int` -> `double` `plannedLoadRemoval`: `int` -> `double` Property type change is in principle a breaking change. However, previous version increment from `4.12.0` to `5.0.0` did not fix all problems so it was not usable. In that sense, this is considered a bugfix rather than a new major version (`6.0.0`). --- properties/service_fabric_common.props | 2 +- .../LoadMetricInformationConverter.cs | 60 +++++++++---------- .../Generated/LoadMetricInformation.cs | 40 ++++++------- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/properties/service_fabric_common.props b/properties/service_fabric_common.props index 08b0b00..e63a767 100644 --- a/properties/service_fabric_common.props +++ b/properties/service_fabric_common.props @@ -24,7 +24,7 @@ 5 0 - 0 + 1 0 diff --git a/src/Microsoft.ServiceFabric.Client.Http/Generated/Serialization/LoadMetricInformationConverter.cs b/src/Microsoft.ServiceFabric.Client.Http/Generated/Serialization/LoadMetricInformationConverter.cs index f26b000..ab94a8e 100644 --- a/src/Microsoft.ServiceFabric.Client.Http/Generated/Serialization/LoadMetricInformationConverter.cs +++ b/src/Microsoft.ServiceFabric.Client.Http/Generated/Serialization/LoadMetricInformationConverter.cs @@ -38,26 +38,26 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) var isBalancedAfter = default(bool?); var deviationBefore = default(double?); var deviationAfter = default(double?); - var balancingThreshold = default(int?); + var balancingThreshold = default(double?); var action = default(string); - var activityThreshold = default(int?); + var activityThreshold = default(string); var clusterCapacity = default(string); var clusterLoad = default(string); - var currentClusterLoad = default(int?); + var currentClusterLoad = default(double?); var clusterRemainingCapacity = default(string); - var clusterCapacityRemaining = default(int?); + var clusterCapacityRemaining = default(double?); var isClusterCapacityViolation = default(bool?); - var nodeBufferPercentage = default(int?); + var nodeBufferPercentage = default(double?); var clusterBufferedCapacity = default(string); - var bufferedClusterCapacityRemaining = default(int?); - var clusterRemainingBufferedCapacity = default(int?); + var bufferedClusterCapacityRemaining = default(double?); + var clusterRemainingBufferedCapacity = default(string); var minNodeLoadValue = default(string); - var minimumNodeLoad = default(int?); + var minimumNodeLoad = default(double?); var minNodeLoadNodeId = default(NodeId); var maxNodeLoadValue = default(string); - var maximumNodeLoad = default(int?); + var maximumNodeLoad = default(double?); var maxNodeLoadNodeId = default(NodeId); - var plannedLoadRemoval = default(int?); + var plannedLoadRemoval = default(double?); do { @@ -84,7 +84,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("BalancingThreshold", propName, StringComparison.OrdinalIgnoreCase) == 0) { - balancingThreshold = reader.ReadValueAsInt(); + balancingThreshold = reader.ReadValueAsDouble(); } else if (string.Compare("Action", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -92,7 +92,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("ActivityThreshold", propName, StringComparison.OrdinalIgnoreCase) == 0) { - activityThreshold = reader.ReadValueAsInt(); + activityThreshold = reader.ReadValueAsString(); } else if (string.Compare("ClusterCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -104,7 +104,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("CurrentClusterLoad", propName, StringComparison.OrdinalIgnoreCase) == 0) { - currentClusterLoad = reader.ReadValueAsInt(); + currentClusterLoad = reader.ReadValueAsDouble(); } else if (string.Compare("ClusterRemainingCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -112,7 +112,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("ClusterCapacityRemaining", propName, StringComparison.OrdinalIgnoreCase) == 0) { - clusterCapacityRemaining = reader.ReadValueAsInt(); + clusterCapacityRemaining = reader.ReadValueAsDouble(); } else if (string.Compare("IsClusterCapacityViolation", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -120,7 +120,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("NodeBufferPercentage", propName, StringComparison.OrdinalIgnoreCase) == 0) { - nodeBufferPercentage = reader.ReadValueAsInt(); + nodeBufferPercentage = reader.ReadValueAsDouble(); } else if (string.Compare("ClusterBufferedCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -128,11 +128,11 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("BufferedClusterCapacityRemaining", propName, StringComparison.OrdinalIgnoreCase) == 0) { - bufferedClusterCapacityRemaining = reader.ReadValueAsInt(); + bufferedClusterCapacityRemaining = reader.ReadValueAsDouble(); } else if (string.Compare("ClusterRemainingBufferedCapacity", propName, StringComparison.OrdinalIgnoreCase) == 0) { - clusterRemainingBufferedCapacity = reader.ReadValueAsInt(); + clusterRemainingBufferedCapacity = reader.ReadValueAsString(); } else if (string.Compare("MinNodeLoadValue", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -140,7 +140,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("MinimumNodeLoad", propName, StringComparison.OrdinalIgnoreCase) == 0) { - minimumNodeLoad = reader.ReadValueAsInt(); + minimumNodeLoad = reader.ReadValueAsDouble(); } else if (string.Compare("MinNodeLoadNodeId", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -152,7 +152,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("MaximumNodeLoad", propName, StringComparison.OrdinalIgnoreCase) == 0) { - maximumNodeLoad = reader.ReadValueAsInt(); + maximumNodeLoad = reader.ReadValueAsDouble(); } else if (string.Compare("MaxNodeLoadNodeId", propName, StringComparison.OrdinalIgnoreCase) == 0) { @@ -160,7 +160,7 @@ internal static LoadMetricInformation GetFromJsonProperties(JsonReader reader) } else if (string.Compare("PlannedLoadRemoval", propName, StringComparison.OrdinalIgnoreCase) == 0) { - plannedLoadRemoval = reader.ReadValueAsInt(); + plannedLoadRemoval = reader.ReadValueAsDouble(); } else { @@ -233,7 +233,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.BalancingThreshold != null) { - writer.WriteProperty(obj.BalancingThreshold, "BalancingThreshold", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.BalancingThreshold, "BalancingThreshold", JsonWriterExtensions.WriteDoubleValue); } if (obj.Action != null) @@ -243,7 +243,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.ActivityThreshold != null) { - writer.WriteProperty(obj.ActivityThreshold, "ActivityThreshold", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.ActivityThreshold, "ActivityThreshold", JsonWriterExtensions.WriteStringValue); } if (obj.ClusterCapacity != null) @@ -258,7 +258,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.CurrentClusterLoad != null) { - writer.WriteProperty(obj.CurrentClusterLoad, "CurrentClusterLoad", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.CurrentClusterLoad, "CurrentClusterLoad", JsonWriterExtensions.WriteDoubleValue); } if (obj.ClusterRemainingCapacity != null) @@ -268,7 +268,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.ClusterCapacityRemaining != null) { - writer.WriteProperty(obj.ClusterCapacityRemaining, "ClusterCapacityRemaining", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.ClusterCapacityRemaining, "ClusterCapacityRemaining", JsonWriterExtensions.WriteDoubleValue); } if (obj.IsClusterCapacityViolation != null) @@ -278,7 +278,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.NodeBufferPercentage != null) { - writer.WriteProperty(obj.NodeBufferPercentage, "NodeBufferPercentage", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.NodeBufferPercentage, "NodeBufferPercentage", JsonWriterExtensions.WriteDoubleValue); } if (obj.ClusterBufferedCapacity != null) @@ -288,12 +288,12 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.BufferedClusterCapacityRemaining != null) { - writer.WriteProperty(obj.BufferedClusterCapacityRemaining, "BufferedClusterCapacityRemaining", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.BufferedClusterCapacityRemaining, "BufferedClusterCapacityRemaining", JsonWriterExtensions.WriteDoubleValue); } if (obj.ClusterRemainingBufferedCapacity != null) { - writer.WriteProperty(obj.ClusterRemainingBufferedCapacity, "ClusterRemainingBufferedCapacity", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.ClusterRemainingBufferedCapacity, "ClusterRemainingBufferedCapacity", JsonWriterExtensions.WriteStringValue); } if (obj.MinNodeLoadValue != null) @@ -303,7 +303,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.MinimumNodeLoad != null) { - writer.WriteProperty(obj.MinimumNodeLoad, "MinimumNodeLoad", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.MinimumNodeLoad, "MinimumNodeLoad", JsonWriterExtensions.WriteDoubleValue); } if (obj.MinNodeLoadNodeId != null) @@ -318,7 +318,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.MaximumNodeLoad != null) { - writer.WriteProperty(obj.MaximumNodeLoad, "MaximumNodeLoad", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.MaximumNodeLoad, "MaximumNodeLoad", JsonWriterExtensions.WriteDoubleValue); } if (obj.MaxNodeLoadNodeId != null) @@ -328,7 +328,7 @@ internal static void Serialize(JsonWriter writer, LoadMetricInformation obj) if (obj.PlannedLoadRemoval != null) { - writer.WriteProperty(obj.PlannedLoadRemoval, "PlannedLoadRemoval", JsonWriterExtensions.WriteIntValue); + writer.WriteProperty(obj.PlannedLoadRemoval, "PlannedLoadRemoval", JsonWriterExtensions.WriteDoubleValue); } writer.WriteEndObject(); diff --git a/src/Microsoft.ServiceFabric.Common/Generated/LoadMetricInformation.cs b/src/Microsoft.ServiceFabric.Common/Generated/LoadMetricInformation.cs index a8637d2..a5e04aa 100644 --- a/src/Microsoft.ServiceFabric.Common/Generated/LoadMetricInformation.cs +++ b/src/Microsoft.ServiceFabric.Common/Generated/LoadMetricInformation.cs @@ -62,26 +62,26 @@ public LoadMetricInformation( bool? isBalancedAfter = default(bool?), double? deviationBefore = default(double?), double? deviationAfter = default(double?), - int? balancingThreshold = default(int?), + double? balancingThreshold = default(double?), string action = default(string), - int? activityThreshold = default(int?), + string activityThreshold = default(string), string clusterCapacity = default(string), string clusterLoad = default(string), - int? currentClusterLoad = default(int?), + double? currentClusterLoad = default(double?), string clusterRemainingCapacity = default(string), - int? clusterCapacityRemaining = default(int?), + double? clusterCapacityRemaining = default(double?), bool? isClusterCapacityViolation = default(bool?), - int? nodeBufferPercentage = default(int?), + double? nodeBufferPercentage = default(double?), string clusterBufferedCapacity = default(string), - int? bufferedClusterCapacityRemaining = default(int?), - int? clusterRemainingBufferedCapacity = default(int?), + double? bufferedClusterCapacityRemaining = default(double?), + string clusterRemainingBufferedCapacity = default(string), string minNodeLoadValue = default(string), - int? minimumNodeLoad = default(int?), + double? minimumNodeLoad = default(double?), NodeId minNodeLoadNodeId = default(NodeId), string maxNodeLoadValue = default(string), - int? maximumNodeLoad = default(int?), + double? maximumNodeLoad = default(double?), NodeId maxNodeLoadNodeId = default(NodeId), - int? plannedLoadRemoval = default(int?)) + double? plannedLoadRemoval = default(double?)) { this.Name = name; this.IsBalancedBefore = isBalancedBefore; @@ -138,7 +138,7 @@ public LoadMetricInformation( /// /// Gets the balancing threshold for a certain metric. /// - public int? BalancingThreshold { get; } + public double? BalancingThreshold { get; } /// /// Gets the current action being taken with regard to this metric @@ -148,7 +148,7 @@ public LoadMetricInformation( /// /// Gets the Activity Threshold specified for this metric in the system Cluster Manifest. /// - public int? ActivityThreshold { get; } + public string ActivityThreshold { get; } /// /// Gets the total cluster capacity for a given metric @@ -164,7 +164,7 @@ public LoadMetricInformation( /// /// Gets the total cluster load. /// - public int? CurrentClusterLoad { get; } + public double? CurrentClusterLoad { get; } /// /// Gets the remaining capacity for the metric in the cluster. In future releases of Service Fabric this parameter will @@ -175,7 +175,7 @@ public LoadMetricInformation( /// /// Gets the remaining capacity for the metric in the cluster. /// - public int? ClusterCapacityRemaining { get; } + public double? ClusterCapacityRemaining { get; } /// /// Gets indicates that the metric is currently over capacity in the cluster. @@ -185,7 +185,7 @@ public LoadMetricInformation( /// /// Gets the reserved percentage of total node capacity for this metric. /// - public int? NodeBufferPercentage { get; } + public double? NodeBufferPercentage { get; } /// /// Gets remaining capacity in the cluster excluding the reserved space. In future releases of Service Fabric this @@ -196,12 +196,12 @@ public LoadMetricInformation( /// /// Gets remaining capacity in the cluster excluding the reserved space. /// - public int? BufferedClusterCapacityRemaining { get; } + public double? BufferedClusterCapacityRemaining { get; } /// /// Gets the remaining percentage of cluster total capacity for this metric. /// - public int? ClusterRemainingBufferedCapacity { get; } + public string ClusterRemainingBufferedCapacity { get; } /// /// Gets the minimum load on any node for this metric. In future releases of Service Fabric this parameter will be @@ -212,7 +212,7 @@ public LoadMetricInformation( /// /// Gets the minimum load on any node for this metric. /// - public int? MinimumNodeLoad { get; } + public double? MinimumNodeLoad { get; } /// /// Gets the node id of the node with the minimum load for this metric. @@ -228,7 +228,7 @@ public LoadMetricInformation( /// /// Gets the maximum load on any node for this metric. /// - public int? MaximumNodeLoad { get; } + public double? MaximumNodeLoad { get; } /// /// Gets the node id of the node with the maximum load for this metric. @@ -241,6 +241,6 @@ public LoadMetricInformation( /// This kind of load is reported for replicas that are currently being moving to other nodes and for replicas that are /// currently being dropped but still use the load on the source node. /// - public int? PlannedLoadRemoval { get; } + public double? PlannedLoadRemoval { get; } } }