@@ -48,6 +48,25 @@ partial void ProcessCompleteFileUploadResponse(
4848 global ::System . Guid fileId ,
4949 global ::NightfallAI . AutoSDKRequestOptions ? requestOptions = default ,
5050 global ::System . Threading . CancellationToken cancellationToken = default )
51+ {
52+ await CompleteFileUploadAsResponseAsync (
53+ fileId : fileId ,
54+ requestOptions : requestOptions ,
55+ cancellationToken : cancellationToken
56+ ) . ConfigureAwait ( false ) ;
57+ }
58+ /// <summary>
59+ /// Complete a file upload<br/>
60+ /// Marks a file upload session as complete after all chunks have been uploaded.
61+ /// </summary>
62+ /// <param name="fileId"></param>
63+ /// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
64+ /// <param name="cancellationToken">The token to cancel the operation with</param>
65+ /// <exception cref="global::NightfallAI.ApiException"></exception>
66+ public async global ::System . Threading . Tasks . Task < global ::NightfallAI . AutoSDKHttpResponse > CompleteFileUploadAsResponseAsync (
67+ global ::System . Guid fileId ,
68+ global ::NightfallAI . AutoSDKRequestOptions ? requestOptions = default ,
69+ global ::System . Threading . CancellationToken cancellationToken = default )
5170 {
5271 PrepareArguments (
5372 client : HttpClient ) ;
@@ -77,6 +96,7 @@ partial void ProcessCompleteFileUploadResponse(
7796
7897 global ::System . Net . Http . HttpRequestMessage __CreateHttpRequest ( )
7998 {
99+
80100 var __pathBuilder = new global ::NightfallAI . PathBuilder (
81101 path : $ "/v3/upload/{ fileId } /finish",
82102 baseUri : HttpClient . BaseAddress ) ;
@@ -150,6 +170,8 @@ partial void ProcessCompleteFileUploadResponse(
150170 attempt : __attempt ,
151171 maxAttempts : __maxAttempts ,
152172 willRetry : false ,
173+ retryDelay : null ,
174+ retryReason : global ::System . String . Empty ,
153175 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
154176 try
155177 {
@@ -160,6 +182,11 @@ partial void ProcessCompleteFileUploadResponse(
160182 }
161183 catch ( global ::System . Net . Http . HttpRequestException __exception )
162184 {
185+ var __retryDelay = global ::NightfallAI . AutoSDKRequestOptionsSupport . GetRetryDelay (
186+ clientOptions : Options ,
187+ requestOptions : requestOptions ,
188+ response : null ,
189+ attempt : __attempt ) ;
163190 var __willRetry = __attempt < __maxAttempts && ! __effectiveCancellationToken . IsCancellationRequested ;
164191 await global ::NightfallAI . AutoSDKRequestOptionsSupport . OnAfterErrorAsync (
165192 clientOptions : Options ,
@@ -177,6 +204,8 @@ partial void ProcessCompleteFileUploadResponse(
177204 attempt : __attempt ,
178205 maxAttempts : __maxAttempts ,
179206 willRetry : __willRetry ,
207+ retryDelay : __willRetry ? __retryDelay : ( global ::System . TimeSpan ? ) null ,
208+ retryReason : "exception" ,
180209 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
181210 if ( ! __willRetry )
182211 {
@@ -186,8 +215,7 @@ partial void ProcessCompleteFileUploadResponse(
186215 __httpRequest . Dispose ( ) ;
187216 __httpRequest = null ;
188217 await global ::NightfallAI . AutoSDKRequestOptionsSupport . DelayBeforeRetryAsync (
189- clientOptions : Options ,
190- requestOptions : requestOptions ,
218+ retryDelay : __retryDelay ,
191219 cancellationToken : __effectiveCancellationToken ) . ConfigureAwait ( false ) ;
192220 continue ;
193221 }
@@ -196,6 +224,11 @@ partial void ProcessCompleteFileUploadResponse(
196224 __attempt < __maxAttempts &&
197225 global ::NightfallAI . AutoSDKRequestOptionsSupport . ShouldRetryStatusCode ( __response . StatusCode ) )
198226 {
227+ var __retryDelay = global ::NightfallAI . AutoSDKRequestOptionsSupport . GetRetryDelay (
228+ clientOptions : Options ,
229+ requestOptions : requestOptions ,
230+ response : __response ,
231+ attempt : __attempt ) ;
199232 await global ::NightfallAI . AutoSDKRequestOptionsSupport . OnAfterErrorAsync (
200233 clientOptions : Options ,
201234 context : global ::NightfallAI . AutoSDKRequestOptionsSupport . CreateHookContext (
@@ -212,14 +245,15 @@ partial void ProcessCompleteFileUploadResponse(
212245 attempt : __attempt ,
213246 maxAttempts : __maxAttempts ,
214247 willRetry : true ,
248+ retryDelay : __retryDelay ,
249+ retryReason : "status:" + ( ( int ) __response . StatusCode ) . ToString ( global ::System . Globalization . CultureInfo . InvariantCulture ) ,
215250 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
216251 __response . Dispose ( ) ;
217252 __response = null ;
218253 __httpRequest . Dispose ( ) ;
219254 __httpRequest = null ;
220255 await global ::NightfallAI . AutoSDKRequestOptionsSupport . DelayBeforeRetryAsync (
221- clientOptions : Options ,
222- requestOptions : requestOptions ,
256+ retryDelay : __retryDelay ,
223257 cancellationToken : __effectiveCancellationToken ) . ConfigureAwait ( false ) ;
224258 continue ;
225259 }
@@ -259,6 +293,8 @@ partial void ProcessCompleteFileUploadResponse(
259293 attempt : __attemptNumber ,
260294 maxAttempts : __maxAttempts ,
261295 willRetry : false ,
296+ retryDelay : null ,
297+ retryReason : global ::System . String . Empty ,
262298 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
263299 }
264300 else
@@ -279,6 +315,8 @@ partial void ProcessCompleteFileUploadResponse(
279315 attempt : __attemptNumber ,
280316 maxAttempts : __maxAttempts ,
281317 willRetry : false ,
318+ retryDelay : null ,
319+ retryReason : global ::System . String . Empty ,
282320 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
283321 }
284322 // Bad request
@@ -451,6 +489,10 @@ partial void ProcessCompleteFileUploadResponse(
451489 {
452490 __response . EnsureSuccessStatusCode ( ) ;
453491
492+ return new global ::NightfallAI . AutoSDKHttpResponse (
493+ statusCode : __response . StatusCode ,
494+ headers : global ::NightfallAI . AutoSDKHttpResponse . CreateHeaders ( __response ) ,
495+ requestUri : __response . RequestMessage ? . RequestUri ) ;
454496 }
455497 catch ( global ::System . Exception __ex )
456498 {
@@ -472,6 +514,10 @@ partial void ProcessCompleteFileUploadResponse(
472514 try
473515 {
474516 __response . EnsureSuccessStatusCode ( ) ;
517+ return new global ::NightfallAI . AutoSDKHttpResponse (
518+ statusCode : __response . StatusCode ,
519+ headers : global ::NightfallAI . AutoSDKHttpResponse . CreateHeaders ( __response ) ,
520+ requestUri : __response . RequestMessage ? . RequestUri ) ;
475521 }
476522 catch ( global ::System . Exception __ex )
477523 {
0 commit comments