using System.Text.Json.Serialization; using AnthropicClient.Utils; namespace AnthropicClient.Models; /// /// Represents a document source. /// public class DocumentSource { /// /// Gets the media type of the document. /// [JsonPropertyName("media_type")] public string MediaType { get; init; } = string.Empty; /// /// Gets the data of the document. /// public string Data { get; init; } = string.Empty; /// /// Gets the type of encoding of the document data. /// public string Type { get; init; } = "base64"; [JsonConstructor] internal DocumentSource() { } /// /// Initializes a new instance of the class. /// /// The media type of the document. /// The data of the document. /// Thrown when the media type is invalid. /// Thrown when the media type or data is null. /// A new instance of the class. public DocumentSource(string mediaType, string data) { ArgumentValidator.ThrowIfNull(mediaType, nameof(mediaType)); ArgumentValidator.ThrowIfNull(data, nameof(data)); MediaType = mediaType; Data = data; } }