@@ -53,6 +53,27 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
5353 string jobId ,
5454 global ::Ideogram . AutoSDKRequestOptions ? requestOptions = default ,
5555 global ::System . Threading . CancellationToken cancellationToken = default )
56+ {
57+ var __response = await GetMaybeBatchResultsAsResponseAsync (
58+ jobId : jobId ,
59+ requestOptions : requestOptions ,
60+ cancellationToken : cancellationToken
61+ ) . ConfigureAwait ( false ) ;
62+
63+ return __response . Body ;
64+ }
65+ /// <summary>
66+ /// Get Batch Magic Prompt Job Results if available.<br/>
67+ /// Gets the results of a batch magic prompt job if available.
68+ /// </summary>
69+ /// <param name="jobId"></param>
70+ /// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
71+ /// <param name="cancellationToken">The token to cancel the operation with</param>
72+ /// <exception cref="global::Ideogram.ApiException"></exception>
73+ public async global ::System . Threading . Tasks . Task < global ::Ideogram . AutoSDKHttpResponse < global ::Ideogram . InternalBatchResultsResponse > > GetMaybeBatchResultsAsResponseAsync (
74+ string jobId ,
75+ global ::Ideogram . AutoSDKRequestOptions ? requestOptions = default ,
76+ global ::System . Threading . CancellationToken cancellationToken = default )
5677 {
5778 PrepareArguments (
5879 client : HttpClient ) ;
@@ -82,6 +103,7 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
82103
83104 global ::System . Net . Http . HttpRequestMessage __CreateHttpRequest ( )
84105 {
106+
85107 var __pathBuilder = new global ::Ideogram . PathBuilder (
86108 path : $ "/internal/batch/get-maybe-batch-results/{ jobId } ",
87109 baseUri : HttpClient . BaseAddress ) ;
@@ -155,6 +177,8 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
155177 attempt : __attempt ,
156178 maxAttempts : __maxAttempts ,
157179 willRetry : false ,
180+ retryDelay : null ,
181+ retryReason : global ::System . String . Empty ,
158182 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
159183 try
160184 {
@@ -165,6 +189,11 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
165189 }
166190 catch ( global ::System . Net . Http . HttpRequestException __exception )
167191 {
192+ var __retryDelay = global ::Ideogram . AutoSDKRequestOptionsSupport . GetRetryDelay (
193+ clientOptions : Options ,
194+ requestOptions : requestOptions ,
195+ response : null ,
196+ attempt : __attempt ) ;
168197 var __willRetry = __attempt < __maxAttempts && ! __effectiveCancellationToken . IsCancellationRequested ;
169198 await global ::Ideogram . AutoSDKRequestOptionsSupport . OnAfterErrorAsync (
170199 clientOptions : Options ,
@@ -182,6 +211,8 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
182211 attempt : __attempt ,
183212 maxAttempts : __maxAttempts ,
184213 willRetry : __willRetry ,
214+ retryDelay : __willRetry ? __retryDelay : ( global ::System . TimeSpan ? ) null ,
215+ retryReason : "exception" ,
185216 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
186217 if ( ! __willRetry )
187218 {
@@ -191,8 +222,7 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
191222 __httpRequest . Dispose ( ) ;
192223 __httpRequest = null ;
193224 await global ::Ideogram . AutoSDKRequestOptionsSupport . DelayBeforeRetryAsync (
194- clientOptions : Options ,
195- requestOptions : requestOptions ,
225+ retryDelay : __retryDelay ,
196226 cancellationToken : __effectiveCancellationToken ) . ConfigureAwait ( false ) ;
197227 continue ;
198228 }
@@ -201,6 +231,11 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
201231 __attempt < __maxAttempts &&
202232 global ::Ideogram . AutoSDKRequestOptionsSupport . ShouldRetryStatusCode ( __response . StatusCode ) )
203233 {
234+ var __retryDelay = global ::Ideogram . AutoSDKRequestOptionsSupport . GetRetryDelay (
235+ clientOptions : Options ,
236+ requestOptions : requestOptions ,
237+ response : __response ,
238+ attempt : __attempt ) ;
204239 await global ::Ideogram . AutoSDKRequestOptionsSupport . OnAfterErrorAsync (
205240 clientOptions : Options ,
206241 context : global ::Ideogram . AutoSDKRequestOptionsSupport . CreateHookContext (
@@ -217,14 +252,15 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
217252 attempt : __attempt ,
218253 maxAttempts : __maxAttempts ,
219254 willRetry : true ,
255+ retryDelay : __retryDelay ,
256+ retryReason : "status:" + ( ( int ) __response . StatusCode ) . ToString ( global ::System . Globalization . CultureInfo . InvariantCulture ) ,
220257 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
221258 __response . Dispose ( ) ;
222259 __response = null ;
223260 __httpRequest . Dispose ( ) ;
224261 __httpRequest = null ;
225262 await global ::Ideogram . AutoSDKRequestOptionsSupport . DelayBeforeRetryAsync (
226- clientOptions : Options ,
227- requestOptions : requestOptions ,
263+ retryDelay : __retryDelay ,
228264 cancellationToken : __effectiveCancellationToken ) . ConfigureAwait ( false ) ;
229265 continue ;
230266 }
@@ -264,6 +300,8 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
264300 attempt : __attemptNumber ,
265301 maxAttempts : __maxAttempts ,
266302 willRetry : false ,
303+ retryDelay : null ,
304+ retryReason : global ::System . String . Empty ,
267305 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
268306 }
269307 else
@@ -284,6 +322,8 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
284322 attempt : __attemptNumber ,
285323 maxAttempts : __maxAttempts ,
286324 willRetry : false ,
325+ retryDelay : null ,
326+ retryReason : global ::System . String . Empty ,
287327 cancellationToken : __effectiveCancellationToken ) ) . ConfigureAwait ( false ) ;
288328 }
289329 //
@@ -440,9 +480,13 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
440480 {
441481 __response . EnsureSuccessStatusCode ( ) ;
442482
443- return
444- global ::Ideogram . InternalBatchResultsResponse . FromJson ( __content , JsonSerializerContext ) ??
483+ var __value = global ::Ideogram . InternalBatchResultsResponse . FromJson ( __content , JsonSerializerContext ) ??
445484 throw new global ::System . InvalidOperationException ( $ "Response deserialization failed for \" { __content } \" ") ;
485+ return new global ::Ideogram . AutoSDKHttpResponse < global ::Ideogram . InternalBatchResultsResponse > (
486+ statusCode : __response . StatusCode ,
487+ headers : global ::Ideogram . AutoSDKHttpResponse . CreateHeaders ( __response ) ,
488+ requestUri : __response . RequestMessage ? . RequestUri ,
489+ body : __value ) ;
446490 }
447491 catch ( global ::System . Exception __ex )
448492 {
@@ -470,9 +514,13 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
470514 #endif
471515 ) . ConfigureAwait ( false ) ;
472516
473- return
474- await global ::Ideogram . InternalBatchResultsResponse . FromJsonStreamAsync ( __content , JsonSerializerContext ) . ConfigureAwait ( false ) ??
517+ var __value = await global ::Ideogram . InternalBatchResultsResponse . FromJsonStreamAsync ( __content , JsonSerializerContext ) . ConfigureAwait ( false ) ??
475518 throw new global ::System . InvalidOperationException ( "Response deserialization failed." ) ;
519+ return new global ::Ideogram . AutoSDKHttpResponse < global ::Ideogram . InternalBatchResultsResponse > (
520+ statusCode : __response . StatusCode ,
521+ headers : global ::Ideogram . AutoSDKHttpResponse . CreateHeaders ( __response ) ,
522+ requestUri : __response . RequestMessage ? . RequestUri ,
523+ body : __value ) ;
476524 }
477525 catch ( global ::System . Exception __ex )
478526 {
0 commit comments