Refactor: Standardize method names across clients

Renamed methods across multiple client classes for consistency,
shortening and aligning naming conventions (e.g., `CheckAttachmentsAsync` → `CheckAsync`, `ValidatePdfAsync` → `ValidateAsync`).

Updated corresponding interfaces, unit tests, and documentation
to reflect the new method names. Standardized method signatures
to support both `Stream` and `byte[]` overloads consistently.

Improved error handling in tests and updated examples in the
README for batch processing and validation scenarios. Enhanced
API endpoint overview for clarity.
This commit is contained in:
2026-08-31 03:40:43 +02:00
parent f51fde6a23
commit 189622c476
18 changed files with 262 additions and 262 deletions

View File

@@ -14,7 +14,7 @@ public interface IPdfAttachmentClient
/// <param name="pdfStream">PDF file stream</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Attachment check result with metadata</returns>
Task<AttachmentCheckResult> CheckAttachmentsAsync(Stream pdfStream, CancellationToken cancellationToken = default);
Task<AttachmentCheckResult> CheckAsync(Stream pdfStream, CancellationToken cancellationToken = default);
/// <summary>
/// Checks if PDF contains attachments (Base64).
@@ -22,7 +22,7 @@ public interface IPdfAttachmentClient
/// <param name="pdfBytes">PDF file as byte array</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Attachment check result with metadata</returns>
Task<AttachmentCheckResult> CheckAttachmentsAsync(byte[] pdfBytes, CancellationToken cancellationToken = default);
Task<AttachmentCheckResult> CheckAsync(byte[] pdfBytes, CancellationToken cancellationToken = default);
/// <summary>
/// Extracts all embedded attachments from a PDF (multipart).
@@ -31,7 +31,7 @@ public interface IPdfAttachmentClient
/// <param name="pdfStream">PDF file stream</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Dictionary of file name ? content stream for each extracted attachment</returns>
Task<Dictionary<string, Stream>> ExtractAttachmentsAsync(Stream pdfStream, CancellationToken cancellationToken = default);
Task<Dictionary<string, Stream>> ExtractAsync(Stream pdfStream, CancellationToken cancellationToken = default);
/// <summary>
/// Extracts all embedded attachments from a PDF (Base64).
@@ -40,7 +40,7 @@ public interface IPdfAttachmentClient
/// <param name="pdfBytes">PDF file as byte array</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Dictionary of file name ? content stream for each extracted attachment</returns>
Task<Dictionary<string, Stream>> ExtractAttachmentsAsync(byte[] pdfBytes, CancellationToken cancellationToken = default);
Task<Dictionary<string, Stream>> ExtractAsync(byte[] pdfBytes, CancellationToken cancellationToken = default);
/// <summary>
/// Adds attachments to PDF (multipart). ?? Not implemented yet in API.
@@ -50,7 +50,7 @@ public interface IPdfAttachmentClient
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Modified PDF as stream</returns>
[Obsolete("API endpoint not implemented yet")]
Task<Stream> AddAttachmentsAsync(Stream pdfStream, List<AttachmentRequestDto> attachments, CancellationToken cancellationToken = default);
Task<Stream> AddAsync(Stream pdfStream, List<AttachmentRequestDto> attachments, CancellationToken cancellationToken = default);
/// <summary>
/// Adds attachments to PDF (Base64). ?? Not implemented yet in API.
@@ -60,5 +60,5 @@ public interface IPdfAttachmentClient
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>Modified PDF as stream</returns>
[Obsolete("API endpoint not implemented yet")]
Task<Stream> AddAttachmentsAsync(byte[] pdfBytes, List<AttachmentRequestDto> attachments, CancellationToken cancellationToken = default);
Task<Stream> AddAsync(byte[] pdfBytes, List<AttachmentRequestDto> attachments, CancellationToken cancellationToken = default);
}