Skip to content

Commit 2fa33b2

Browse files
Jabenclaude
andcommitted
Add comprehensive XML documentation to main client methods
Completes Phase 4 by documenting the previously undocumented methods in the GotenbergSharpClient class. Documented methods: - ConvertPdfDocumentsAsync (both overloads): PDF/A conversion and transformations - FireWebhookAndForgetAsync (all 3 overloads): Async webhook processing Key improvements: - Explained "fire and forget" webhook behavior (returns when Gotenberg accepts request, not when PDF is generated) - Documented that Gotenberg POSTs generated PDF to webhook URL - Added comprehensive exception documentation for all methods - Clarified difference between request acceptance and PDF generation completion - Added remarks explaining webhook use cases All public methods in GotenbergSharpClient now have complete documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 85d4236 commit 2fa33b2

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

src/Gotenberg.Sharp.Api.Client/GotenbergSharpClient.cs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ public virtual async Task<Stream> MergeOfficeDocsAsync(
183183
return await this.MergeOfficeDocsAsync(mergeOfficeRequest, cancelToken);
184184
}
185185

186+
/// <summary>
187+
/// Converts existing PDF files to PDF/A formats or applies transformations like flattening using Gotenberg's PDF engines module.
188+
/// </summary>
189+
/// <param name="request">The PDF conversion request containing PDFs to convert and conversion settings.</param>
190+
/// <param name="cancelToken">Cancellation token for the async operation.</param>
191+
/// <returns>A stream containing the converted PDF.</returns>
192+
/// <exception cref="ArgumentNullException">Thrown when request is null.</exception>
193+
/// <exception cref="GotenbergApiException">Thrown when Gotenberg returns an error response.</exception>
186194
public virtual Task<Stream> ConvertPdfDocumentsAsync(
187195
PdfConversionRequest request,
188196
CancellationToken cancelToken = default)
@@ -192,6 +200,14 @@ public virtual Task<Stream> ConvertPdfDocumentsAsync(
192200
return this.ExecuteRequestAsync(request.CreateApiRequest(), cancelToken);
193201
}
194202

203+
/// <summary>
204+
/// Converts existing PDF files to PDF/A formats or applies transformations using a builder pattern.
205+
/// </summary>
206+
/// <param name="builder">The builder for configuring PDF conversion settings.</param>
207+
/// <param name="cancelToken">Cancellation token for the async operation.</param>
208+
/// <returns>A stream containing the converted PDF.</returns>
209+
/// <exception cref="ArgumentNullException">Thrown when builder is null.</exception>
210+
/// <exception cref="GotenbergApiException">Thrown when Gotenberg returns an error response.</exception>
195211
public virtual async Task<Stream> ConvertPdfDocumentsAsync(
196212
PdfConversionBuilder builder,
197213
CancellationToken cancelToken = default)
@@ -229,6 +245,22 @@ public virtual async Task<Stream> ConvertPdfDocumentsAsync(
229245
return null;
230246
}
231247

248+
/// <summary>
249+
/// Sends a request to Gotenberg configured for asynchronous webhook processing. Returns immediately after
250+
/// Gotenberg accepts the request. Gotenberg will POST the generated PDF to the configured webhook URL.
251+
/// </summary>
252+
/// <typeparam name="TBuilder">The builder type.</typeparam>
253+
/// <typeparam name="TRequest">The request type.</typeparam>
254+
/// <param name="builder">The builder with webhook configuration.</param>
255+
/// <param name="cancelToken">Cancellation token for the async operation.</param>
256+
/// <returns>A task that completes when Gotenberg accepts the request (not when PDF is generated).</returns>
257+
/// <exception cref="ArgumentNullException">Thrown when builder is null.</exception>
258+
/// <exception cref="InvalidOperationException">Thrown when the request doesn't have a webhook configured.</exception>
259+
/// <exception cref="GotenbergApiException">Thrown when Gotenberg returns an error response.</exception>
260+
/// <remarks>
261+
/// Use this method when you want asynchronous PDF generation with callback. Gotenberg will generate the PDF
262+
/// and POST it to your webhook URL. This method returns as soon as Gotenberg accepts the request.
263+
/// </remarks>
232264
public virtual async Task FireWebhookAndForgetAsync<TBuilder, TRequest>(
233265
BaseBuilder<TBuilder, TRequest> builder,
234266
CancellationToken cancelToken = default)
@@ -241,6 +273,16 @@ public virtual async Task FireWebhookAndForgetAsync<TBuilder, TRequest>(
241273
await this.FireWebhookAndForgetAsync(request, cancelToken);
242274
}
243275

276+
/// <summary>
277+
/// Sends a request to Gotenberg configured for asynchronous webhook processing. Returns immediately after
278+
/// Gotenberg accepts the request. Gotenberg will POST the generated PDF to the configured webhook URL.
279+
/// </summary>
280+
/// <param name="request">The request with webhook configuration.</param>
281+
/// <param name="cancelToken">Cancellation token for the async operation.</param>
282+
/// <returns>A task that completes when Gotenberg accepts the request (not when PDF is generated).</returns>
283+
/// <exception cref="ArgumentNullException">Thrown when request is null.</exception>
284+
/// <exception cref="InvalidOperationException">Thrown when the request doesn't have a webhook configured.</exception>
285+
/// <exception cref="GotenbergApiException">Thrown when Gotenberg returns an error response.</exception>
244286
public virtual async Task FireWebhookAndForgetAsync(
245287
BuildRequestBase request,
246288
CancellationToken cancelToken = default)
@@ -252,6 +294,16 @@ public virtual async Task FireWebhookAndForgetAsync(
252294
await this.FireWebhookAndForgetAsync(apiRequest, cancelToken);
253295
}
254296

297+
/// <summary>
298+
/// Sends a request to Gotenberg configured for asynchronous webhook processing. Returns immediately after
299+
/// Gotenberg accepts the request. Gotenberg will POST the generated PDF to the configured webhook URL.
300+
/// </summary>
301+
/// <param name="request">The API request with webhook configuration.</param>
302+
/// <param name="cancelToken">Cancellation token for the async operation.</param>
303+
/// <returns>A task that completes when Gotenberg accepts the request (not when PDF is generated).</returns>
304+
/// <exception cref="ArgumentNullException">Thrown when request is null.</exception>
305+
/// <exception cref="InvalidOperationException">Thrown when the request doesn't have a webhook configured.</exception>
306+
/// <exception cref="GotenbergApiException">Thrown when Gotenberg returns an error response.</exception>
255307
public virtual async Task FireWebhookAndForgetAsync(
256308
IApiRequest request,
257309
CancellationToken cancelToken = default)

0 commit comments

Comments
 (0)