diff --git a/csharp/Microsoft.Azure.Databricks.Client.Test/ClustersApiClientTest.cs b/csharp/Microsoft.Azure.Databricks.Client.Test/ClustersApiClientTest.cs index 1562648..c541bdd 100644 --- a/csharp/Microsoft.Azure.Databricks.Client.Test/ClustersApiClientTest.cs +++ b/csharp/Microsoft.Azure.Databricks.Client.Test/ClustersApiClientTest.cs @@ -714,4 +714,38 @@ public async Task TestEvents() Times.Once() ); } + + [TestMethod] + public void TestNewClusterEventTypesDeserialization() + { + // Test that all new ClusterEventType values can be deserialized correctly + var newEventTypes = new[] + { + "NODE_BLACKLISTED", + "PINNED", + "UNPINNED", + "NODE_EXCLUDED_DECOMMISSIONED", + "ADD_NODES_FAILED", + "AUTOSCALING_BACKOFF", + "AUTOMATIC_CLUSTER_UPDATE", + "AUTOSCALING_FAILED", + "DECOMMISSION_STARTED", + "DECOMMISSION_ENDED" + }; + + foreach (var eventType in newEventTypes) + { + var json = $@" + {{ + ""cluster_id"": ""test-cluster"", + ""timestamp"": 1619471498409, + ""type"": ""{eventType}"", + ""details"": {{}} + }}"; + + var clusterEvent = JsonSerializer.Deserialize(json, Options); + Assert.IsNotNull(clusterEvent, $"Failed to deserialize ClusterEvent with type {eventType}"); + Assert.AreEqual(eventType, clusterEvent.Type.ToString(), $"ClusterEventType {eventType} did not deserialize correctly"); + } + } } \ No newline at end of file diff --git a/csharp/Microsoft.Azure.Databricks.Client/Models/ClusterEventType.cs b/csharp/Microsoft.Azure.Databricks.Client/Models/ClusterEventType.cs index b2d5e72..56a38a8 100644 --- a/csharp/Microsoft.Azure.Databricks.Client/Models/ClusterEventType.cs +++ b/csharp/Microsoft.Azure.Databricks.Client/Models/ClusterEventType.cs @@ -108,5 +108,55 @@ public enum ClusterEventType /// /// Usage report containing the total and unused instance minutes of the autoscaling cluster over the last hour. /// - AUTOSCALING_STATS_REPORT + AUTOSCALING_STATS_REPORT, + + /// + /// Indicates that a node has been blacklisted. + /// + NODE_BLACKLISTED, + + /// + /// Indicates that a cluster has been pinned. + /// + PINNED, + + /// + /// Indicates that a cluster has been unpinned. + /// + UNPINNED, + + /// + /// Indicates that a node has been excluded or decommissioned. + /// + NODE_EXCLUDED_DECOMMISSIONED, + + /// + /// Indicates that adding nodes to the cluster has failed. + /// + ADD_NODES_FAILED, + + /// + /// Indicates that autoscaling has been backed off. + /// + AUTOSCALING_BACKOFF, + + /// + /// Indicates that the cluster has been automatically updated. + /// + AUTOMATIC_CLUSTER_UPDATE, + + /// + /// Indicates that autoscaling has failed. + /// + AUTOSCALING_FAILED, + + /// + /// Indicates that node decommissioning has started. + /// + DECOMMISSION_STARTED, + + /// + /// Indicates that node decommissioning has ended. + /// + DECOMMISSION_ENDED } \ No newline at end of file