/// <summary> /// Serializes this object in JSON format. /// </summary> private static void SerializeAvailability(AvailabilityTelemetry availabilityTelemetry, JsonWriter writer) { writer.WriteStartObject(); availabilityTelemetry.WriteTelemetryName(writer, AvailabilityTelemetry.TelemetryName); availabilityTelemetry.WriteEnvelopeProperties(writer); writer.WritePropertyName("data"); { writer.WriteStartObject(); writer.WriteProperty("baseType", availabilityTelemetry.BaseType); writer.WritePropertyName("baseData"); { writer.WriteStartObject(); writer.WriteProperty("ver", availabilityTelemetry.Data.ver); writer.WriteProperty("id", availabilityTelemetry.Data.id); writer.WriteProperty("name", availabilityTelemetry.Data.name); writer.WriteProperty("duration", availabilityTelemetry.Duration); writer.WriteProperty("success", availabilityTelemetry.Data.success); writer.WriteProperty("runLocation", availabilityTelemetry.Data.runLocation); writer.WriteProperty("message", availabilityTelemetry.Data.message); writer.WriteProperty("properties", availabilityTelemetry.Data.properties); writer.WriteProperty("properties", availabilityTelemetry.Data.properties); writer.WriteProperty("measurements", availabilityTelemetry.Data.measurements); writer.WriteEndObject(); } writer.WriteEndObject(); } writer.WriteEndObject(); }
/// <summary> /// Serializes this object in JSON format. /// </summary> private static void SerializeAvailability(AvailabilityTelemetry availabilityTelemetry, JsonWriter writer) { writer.WriteStartObject(); availabilityTelemetry.WriteTelemetryName(writer, AvailabilityTelemetry.TelemetryName); availabilityTelemetry.WriteEnvelopeProperties(writer); writer.WritePropertyName("data"); { writer.WriteStartObject(); writer.WriteProperty("baseType", availabilityTelemetry.BaseType); writer.WritePropertyName("baseData"); { writer.WriteStartObject(); writer.WriteProperty("ver", availabilityTelemetry.Data.ver); writer.WriteProperty("testRunId", availabilityTelemetry.Data.testRunId); writer.WriteProperty("testName", availabilityTelemetry.Data.testName); writer.WriteProperty("testTimeStamp", availabilityTelemetry.TestTimeStamp); writer.WriteProperty("duration", availabilityTelemetry.Duration); writer.WriteProperty("result", availabilityTelemetry.Data.result.ToString()); writer.WriteProperty("runLocation", availabilityTelemetry.Data.runLocation); writer.WriteProperty("message", availabilityTelemetry.Data.message); writer.WriteProperty("properties", availabilityTelemetry.Data.properties); writer.WriteEndObject(); } writer.WriteEndObject(); } writer.WriteEndObject(); }