// Copyright (c) Microsoft. All rights reserved.
using System;
using System.Text.Json.Serialization;
namespace Microsoft.Agents.AI.Purview.Models.Common;
///
/// Base class for process content metadata.
///
[JsonDerivedType(typeof(ProcessConversationMetadata))]
[JsonDerivedType(typeof(ProcessFileMetadata))]
internal abstract class ProcessContentMetadataBase : GraphDataTypeBase
{
private const string ProcessConversationMetadataDataType = Constants.ODataGraphNamespace + ".processConversationMetadata";
///
/// Creates a new instance of ProcessContentMetadataBase.
///
/// The content that will be processed.
/// The unique identifier for the content.
/// Indicates if the content is truncated.
/// The name of the content.
/// The correlation ID for the content.
protected ProcessContentMetadataBase(ContentBase content, string identifier, bool isTruncated, string name, string correlationId) : base(ProcessConversationMetadataDataType)
{
this.Identifier = identifier;
this.IsTruncated = isTruncated;
this.Content = content;
this.Name = name;
this.CorrelationId = correlationId;
}
///
/// Gets or sets the identifier.
/// Unique id for the content. It is specific to the enforcement plane. Path is used as item unique identifier, e.g., guid of a message in the conversation, file URL, storage file path, message ID, etc.
///
[JsonPropertyName("identifier")]
public string Identifier { get; set; }
///
/// Gets or sets the content.
/// The content to be processed.
///
[JsonPropertyName("content")]
public ContentBase Content { get; set; }
///
/// Gets or sets the name.
/// Name of the content, e.g., file name or web page title.
///
[JsonPropertyName("name")]
public string Name { get; set; }
///
/// Gets or sets the correlationId.
/// Identifier to group multiple contents.
///
[JsonPropertyName("correlationId")]
public string CorrelationId { get; set; }
///
/// Gets or sets the sequenceNumber.
/// Sequence in which the content was originally generated.
///
[JsonPropertyName("sequenceNumber")]
public long? SequenceNumber { get; set; }
///
/// Gets or sets the length.
/// Content length in bytes.
///
[JsonPropertyName("length")]
public long? Length { get; set; }
///
/// Gets or sets the isTruncated.
/// Indicates if the original content has been truncated, e.g., to meet text or file size limits.
///
[JsonPropertyName("isTruncated")]
public bool IsTruncated { get; set; }
///
/// Gets or sets the createdDateTime.
/// When the content was created. E.g., file created time or the time when a message was sent.
///
[JsonPropertyName("createdDateTime")]
public DateTimeOffset CreatedDateTime { get; set; } = DateTime.UtcNow;
///
/// Gets or sets the modifiedDateTime.
/// When the content was last modified. E.g., file last modified time. For content created on the fly, such as messaging, whenModified and whenCreated are expected to be the same.
///
[JsonPropertyName("modifiedDateTime")]
public DateTimeOffset? ModifiedDateTime { get; set; } = DateTime.UtcNow;
}