Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 58 additions & 10 deletions src/libs/EachLabs/Generated/EachLabs.AiModelsClient.GetModel.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ partial void ProcessGetModelResponseContent(
string slug,
global::EachLabs.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await GetModelAsResponseAsync(
slug: slug,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);

return __response.Body;
}
/// <summary>
/// Get model details<br/>
/// Retrieve detailed information about a specific model by slug
/// </summary>
/// <param name="slug"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::EachLabs.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::EachLabs.AutoSDKHttpResponse<global::EachLabs.ModelDetail>> GetModelAsResponseAsync(
string slug,
global::EachLabs.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -82,11 +103,12 @@ partial void ProcessGetModelResponseContent(

global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{

var __pathBuilder = new global::EachLabs.PathBuilder(
path: "/v1/model",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddRequiredParameter("slug", slug)
.AddRequiredParameter("slug", slug)
;
var __path = __pathBuilder.ToString();
__path = global::EachLabs.AutoSDKRequestOptionsSupport.AppendQueryParameters(
Expand Down Expand Up @@ -158,6 +180,8 @@ partial void ProcessGetModelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
Expand All @@ -168,6 +192,11 @@ partial void ProcessGetModelResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
var __retryDelay = global::EachLabs.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: null,
attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::EachLabs.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
Expand All @@ -185,6 +214,8 @@ partial void ProcessGetModelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
Expand All @@ -194,8 +225,7 @@ partial void ProcessGetModelResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::EachLabs.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand All @@ -204,6 +234,11 @@ partial void ProcessGetModelResponseContent(
__attempt < __maxAttempts &&
global::EachLabs.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
var __retryDelay = global::EachLabs.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: __response,
attempt: __attempt);
await global::EachLabs.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::EachLabs.AutoSDKRequestOptionsSupport.CreateHookContext(
Expand All @@ -220,14 +255,15 @@ partial void ProcessGetModelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
retryDelay: __retryDelay,
retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::EachLabs.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand Down Expand Up @@ -267,6 +303,8 @@ partial void ProcessGetModelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
Expand All @@ -287,6 +325,8 @@ partial void ProcessGetModelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad request
Expand Down Expand Up @@ -425,9 +465,13 @@ partial void ProcessGetModelResponseContent(
{
__response.EnsureSuccessStatusCode();

return
global::EachLabs.ModelDetail.FromJson(__content, JsonSerializerContext) ??
var __value = global::EachLabs.ModelDetail.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return new global::EachLabs.AutoSDKHttpResponse<global::EachLabs.ModelDetail>(
statusCode: __response.StatusCode,
headers: global::EachLabs.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down Expand Up @@ -455,9 +499,13 @@ partial void ProcessGetModelResponseContent(
#endif
).ConfigureAwait(false);

return
await global::EachLabs.ModelDetail.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
var __value = await global::EachLabs.ModelDetail.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
return new global::EachLabs.AutoSDKHttpResponse<global::EachLabs.ModelDetail>(
statusCode: __response.StatusCode,
headers: global::EachLabs.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down
Loading