private static void SerializePageViewTelemetry(PageViewTelemetry pageViewTelemetry, JsonWriter writer) { writer.WriteStartObject(); pageViewTelemetry.WriteTelemetryName(writer, PageViewTelemetry.TelemetryName); pageViewTelemetry.WriteEnvelopeProperties(writer); writer.WritePropertyName("data"); { writer.WriteStartObject(); // TODO: MetricTelemetry should write type as this.data.baseType once Common Schema 2.0 compliant. writer.WriteProperty("baseType", pageViewTelemetry.BaseType); writer.WritePropertyName("baseData"); { writer.WriteStartObject(); writer.WriteProperty("ver", pageViewTelemetry.Data.ver); writer.WriteProperty("name", pageViewTelemetry.Data.name); writer.WriteProperty("url", pageViewTelemetry.Data.url); writer.WriteProperty("duration", pageViewTelemetry.Data.duration); writer.WriteProperty("measurements", pageViewTelemetry.Data.measurements); writer.WriteProperty("properties", pageViewTelemetry.Data.properties); writer.WriteEndObject(); } writer.WriteEndObject(); } writer.WriteEndObject(); }
private static void SerializePageViewTelemetry(PageViewTelemetry pageViewTelemetry, JsonWriter writer) { writer.WriteStartObject(); pageViewTelemetry.WriteTelemetryName(writer, "PageView"); pageViewTelemetry.WriteEnvelopeProperties(writer); writer.WritePropertyName("data"); writer.WriteStartObject(); writer.WriteProperty("baseType", pageViewTelemetry.BaseType); writer.WritePropertyName("baseData"); writer.WriteStartObject(); writer.WriteProperty("ver", pageViewTelemetry.Data.ver); writer.WriteProperty("name", pageViewTelemetry.Data.name); writer.WriteProperty("url", pageViewTelemetry.Data.url); writer.WriteProperty("duration", pageViewTelemetry.Data.duration); writer.WriteProperty("measurements", pageViewTelemetry.Data.measurements); writer.WriteProperty("properties", pageViewTelemetry.Data.properties); writer.WriteEndObject(); writer.WriteEndObject(); writer.WriteEndObject(); }