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