/// <summary> /// Serializes the object to JSON. /// </summary> /// <param name="writer">The <see cref="T: Newtonsoft.Json.JsonWriter" /> to write to.</param> /// <param name="obj">The object to serialize to JSON.</param> internal static void Serialize(JsonWriter writer, ApplicationHealthStateFilter obj) { // Required properties are always serialized, optional properties are serialized when not null. writer.WriteStartObject(); if (obj.ApplicationNameFilter != null) { writer.WriteProperty(obj.ApplicationNameFilter, "ApplicationNameFilter", JsonWriterExtensions.WriteStringValue); } if (obj.ApplicationTypeNameFilter != null) { writer.WriteProperty(obj.ApplicationTypeNameFilter, "ApplicationTypeNameFilter", JsonWriterExtensions.WriteStringValue); } if (obj.HealthStateFilter != null) { writer.WriteProperty(obj.HealthStateFilter, "HealthStateFilter", JsonWriterExtensions.WriteIntValue); } if (obj.ServiceFilters != null) { writer.WriteEnumerableProperty(obj.ServiceFilters, "ServiceFilters", ServiceHealthStateFilterConverter.Serialize); } if (obj.DeployedApplicationFilters != null) { writer.WriteEnumerableProperty(obj.DeployedApplicationFilters, "DeployedApplicationFilters", DeployedApplicationHealthStateFilterConverter.Serialize); } writer.WriteEndObject(); }
internal IntPtr ToNative(PinCollection pinCollection) { var nativeClusterHealthChunkQueryDescription = new NativeTypes.FABRIC_CLUSTER_HEALTH_CHUNK_QUERY_DESCRIPTION(); if (this.ClusterHealthPolicy != null) { nativeClusterHealthChunkQueryDescription.ClusterHealthPolicy = this.ClusterHealthPolicy.ToNative(pinCollection); } nativeClusterHealthChunkQueryDescription.ApplicationHealthPolicyMap = this.ApplicationHealthPolicies.ToNative(pinCollection); nativeClusterHealthChunkQueryDescription.ApplicationFilters = ApplicationHealthStateFilter.ToNativeList(pinCollection, this.ApplicationFilters); nativeClusterHealthChunkQueryDescription.NodeFilters = NodeHealthStateFilter.ToNativeList(pinCollection, this.NodeFilters); return(pinCollection.AddBlittable(nativeClusterHealthChunkQueryDescription)); }