// Copyright (c) Microsoft. All rights reserved. using System.Text.Json; using System.Text.Json.Serialization; using Microsoft.Agents.AI.Purview.Models.Common; using Microsoft.Agents.AI.Purview.Models.Requests; using Microsoft.Agents.AI.Purview.Models.Responses; namespace Microsoft.Agents.AI.Purview.Serialization; /// /// Source generation context for Purview serialization. /// [JsonSerializable(typeof(ProtectionScopesRequest))] [JsonSerializable(typeof(ProtectionScopesResponse))] [JsonSerializable(typeof(ProcessContentRequest))] [JsonSerializable(typeof(ProcessContentResponse))] [JsonSerializable(typeof(ContentActivitiesRequest))] [JsonSerializable(typeof(ContentActivitiesResponse))] [JsonSerializable(typeof(ProtectionScopesCacheKey))] internal sealed partial class SourceGenerationContext : JsonSerializerContext; /// /// Utility class for Purview serialization settings. /// internal static class PurviewSerializationUtils { /// /// Serialization settings for Purview. /// public static JsonSerializerOptions SerializationSettings { get; } = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNameCaseInsensitive = true, WriteIndented = false, AllowTrailingCommas = false, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, TypeInfoResolver = SourceGenerationContext.Default, }; }