diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.AutoSDKHttpResponse.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.AutoSDKHttpResponse.g.cs
new file mode 100644
index 000000000..5bfdd3129
--- /dev/null
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.AutoSDKHttpResponse.g.cs
@@ -0,0 +1,121 @@
+
+#nullable enable
+
+namespace Google.Gemini
+{
+ ///
+ /// Represents a successful HTTP response with status code and headers.
+ ///
+ public partial class AutoSDKHttpResponse
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers)
+ : this(
+ statusCode: statusCode,
+ headers: headers,
+ requestUri: null)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers,
+ global::System.Uri? requestUri)
+ {
+ StatusCode = statusCode;
+ Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers));
+ RequestUri = requestUri;
+ }
+
+ ///
+ /// Gets the HTTP status code.
+ ///
+ public global::System.Net.HttpStatusCode StatusCode { get; }
+ ///
+ /// Gets the response headers.
+ ///
+ public global::System.Collections.Generic.Dictionary> Headers { get; }
+ ///
+ /// Gets the final request URI associated with the response.
+ ///
+ public global::System.Uri? RequestUri { get; }
+
+ internal static global::System.Collections.Generic.Dictionary> CreateHeaders(
+ global::System.Net.Http.HttpResponseMessage response)
+ {
+ response = response ?? throw new global::System.ArgumentNullException(nameof(response));
+
+ var headers = global::System.Linq.Enumerable.ToDictionary(
+ response.Headers,
+ static header => header.Key,
+ static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value),
+ global::System.StringComparer.OrdinalIgnoreCase);
+
+ if (response.Content?.Headers == null)
+ {
+ return headers;
+ }
+
+ foreach (var header in response.Content.Headers)
+ {
+ if (headers.TryGetValue(header.Key, out var existingValues))
+ {
+ headers[header.Key] = global::System.Linq.Enumerable.ToArray(
+ global::System.Linq.Enumerable.Concat(existingValues, header.Value));
+ }
+ else
+ {
+ headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value);
+ }
+ }
+
+ return headers;
+ }
+ }
+
+ ///
+ /// Represents a successful HTTP response with status code, headers, and body.
+ ///
+ public partial class AutoSDKHttpResponse : AutoSDKHttpResponse
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers,
+ T body)
+ : this(
+ statusCode: statusCode,
+ headers: headers,
+ requestUri: null,
+ body: body)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers,
+ global::System.Uri? requestUri,
+ T body)
+ : base(statusCode, headers, requestUri)
+ {
+ Body = body;
+ }
+
+ ///
+ /// Gets the response body.
+ ///
+ public T Body { get; }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs
index da677294a..9394f1322 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesCancel.g.cs
@@ -52,6 +52,26 @@ partial void ProcessBatchesCancelResponseContent(
string batchesId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await BatchesCancelAsResponseAsync(
+ batchesId: batchesId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> BatchesCancelAsResponseAsync(
+ string batchesId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessBatchesCancelResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/batches/{batchesId}:cancel",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessBatchesCancelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessBatchesCancelResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessBatchesCancelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessBatchesCancelResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessBatchesCancelResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessBatchesCancelResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessBatchesCancelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessBatchesCancelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessBatchesCancelResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessBatchesCancelResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs
index 586bf9288..906e51de5 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesDelete.g.cs
@@ -52,6 +52,26 @@ partial void ProcessBatchesDeleteResponseContent(
string batchesId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await BatchesDeleteAsResponseAsync(
+ batchesId: batchesId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> BatchesDeleteAsResponseAsync(
+ string batchesId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessBatchesDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/batches/{batchesId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessBatchesDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessBatchesDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessBatchesDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessBatchesDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessBatchesDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessBatchesDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessBatchesDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessBatchesDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessBatchesDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessBatchesDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs
index 80f48d018..74e2706a8 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesGet.g.cs
@@ -52,6 +52,26 @@ partial void ProcessBatchesGetResponseContent(
string batchesId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await BatchesGetAsResponseAsync(
+ batchesId: batchesId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> BatchesGetAsResponseAsync(
+ string batchesId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessBatchesGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/batches/{batchesId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessBatchesGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessBatchesGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessBatchesGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessBatchesGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessBatchesGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessBatchesGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessBatchesGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessBatchesGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessBatchesGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessBatchesGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs
index 43d7257f1..81caee073 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesList.g.cs
@@ -64,6 +64,35 @@ partial void ProcessBatchesListResponseContent(
bool? returnPartialSuccess = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await BatchesListAsResponseAsync(
+ filter: filter,
+ pageSize: pageSize,
+ pageToken: pageToken,
+ returnPartialSuccess: returnPartialSuccess,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> BatchesListAsResponseAsync(
+ string? filter = default,
+ int? pageSize = default,
+ string? pageToken = default,
+ bool? returnPartialSuccess = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -96,6 +125,7 @@ partial void ProcessBatchesListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/batches",
baseUri: HttpClient.BaseAddress);
@@ -106,12 +136,12 @@ partial void ProcessBatchesListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("filter", filter)
.AddOptionalParameter("pageSize", pageSize?.ToString())
.AddOptionalParameter("pageToken", pageToken)
- .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -169,6 +199,8 @@ partial void ProcessBatchesListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -179,6 +211,11 @@ partial void ProcessBatchesListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -196,6 +233,8 @@ partial void ProcessBatchesListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -205,8 +244,7 @@ partial void ProcessBatchesListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -215,6 +253,11 @@ partial void ProcessBatchesListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -231,14 +274,15 @@ partial void ProcessBatchesListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -278,6 +322,8 @@ partial void ProcessBatchesListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -298,6 +344,8 @@ partial void ProcessBatchesListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -322,9 +370,13 @@ partial void ProcessBatchesListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -352,9 +404,13 @@ partial void ProcessBatchesListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs
index 167bf45e0..35ccf0698 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateEmbedContentBatch.g.cs
@@ -57,6 +57,34 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
public async global::System.Threading.Tasks.Task BatchesUpdateEmbedContentBatchAsync(
string batchesId,
+ global::Google.Gemini.EmbedContentBatch request,
+ string? updateMask = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await BatchesUpdateEmbedContentBatchAsResponseAsync(
+ batchesId: batchesId,
+
+ request: request,
+ updateMask: updateMask,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Updates a batch of EmbedContent requests for batch processing.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> BatchesUpdateEmbedContentBatchAsResponseAsync(
+ string batchesId,
+
global::Google.Gemini.EmbedContentBatch request,
string? updateMask = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
@@ -94,6 +122,7 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/batches/{batchesId}:updateEmbedContentBatch",
baseUri: HttpClient.BaseAddress);
@@ -104,9 +133,9 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("updateMask", updateMask)
+ .AddOptionalParameter("updateMask", updateMask)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -169,6 +198,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -179,6 +210,11 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -196,6 +232,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -205,8 +243,7 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -215,6 +252,11 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -231,14 +273,15 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -278,6 +321,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -298,6 +343,8 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -322,9 +369,13 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.EmbedContentBatch.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.EmbedContentBatch.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -352,9 +403,13 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.EmbedContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.EmbedContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -397,21 +452,21 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
///
///
///
+ ///
+ /// Stats about the batch.
+ ///
///
/// Required. The user-defined name of this batch.
///
+ ///
+ /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.
+ ///
///
/// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
///
///
/// Configures the input to the batch request.
///
- ///
- /// The output of a batch request. This is returned in the `AsyncBatchEmbedContentResponse` or the `EmbedContentBatch.output` field.
- ///
- ///
- /// Stats about the batch.
- ///
///
/// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.
///
@@ -421,22 +476,22 @@ partial void ProcessBatchesUpdateEmbedContentBatchResponseContent(
public async global::System.Threading.Tasks.Task BatchesUpdateEmbedContentBatchAsync(
string batchesId,
string? updateMask = default,
+ global::Google.Gemini.EmbedContentBatchStats? batchStats = default,
string? displayName = default,
+ global::Google.Gemini.EmbedContentBatchOutput? output = default,
string? model = default,
global::Google.Gemini.InputEmbedContentConfig? inputConfig = default,
- global::Google.Gemini.EmbedContentBatchOutput? output = default,
- global::Google.Gemini.EmbedContentBatchStats? batchStats = default,
string? priority = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.EmbedContentBatch
{
+ BatchStats = batchStats,
DisplayName = displayName,
+ Output = output,
Model = model,
InputConfig = inputConfig,
- Output = output,
- BatchStats = batchStats,
Priority = priority,
};
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs
index fcc2c8327..05b8d8019 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.BatchesUpdateGenerateContentBatch.g.cs
@@ -57,6 +57,34 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
public async global::System.Threading.Tasks.Task BatchesUpdateGenerateContentBatchAsync(
string batchesId,
+ global::Google.Gemini.GenerateContentBatch request,
+ string? updateMask = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await BatchesUpdateGenerateContentBatchAsResponseAsync(
+ batchesId: batchesId,
+
+ request: request,
+ updateMask: updateMask,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Updates a batch of GenerateContent requests for batch processing.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> BatchesUpdateGenerateContentBatchAsResponseAsync(
+ string batchesId,
+
global::Google.Gemini.GenerateContentBatch request,
string? updateMask = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
@@ -94,6 +122,7 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/batches/{batchesId}:updateGenerateContentBatch",
baseUri: HttpClient.BaseAddress);
@@ -104,9 +133,9 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("updateMask", updateMask)
+ .AddOptionalParameter("updateMask", updateMask)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -169,6 +198,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -179,6 +210,11 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -196,6 +232,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -205,8 +243,7 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -215,6 +252,11 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -231,14 +273,15 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -278,6 +321,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -298,6 +343,8 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -322,9 +369,13 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.GenerateContentBatch.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.GenerateContentBatch.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -352,9 +403,13 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.GenerateContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.GenerateContentBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -403,18 +458,18 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
///
/// Configures the input to the batch request.
///
- ///
- /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.
- ///
- ///
- /// Required. The user-defined name of this batch.
- ///
///
/// Optional. The priority of the batch. Batches with a higher priority value will be processed before batches with a lower priority value. Negative values are allowed. Default is 0.
///
///
/// Stats about the batch.
///
+ ///
+ /// The output of a batch request. This is returned in the `BatchGenerateContentResponse` or the `GenerateContentBatch.output` field.
+ ///
+ ///
+ /// Required. The user-defined name of this batch.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -423,10 +478,10 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
string? updateMask = default,
string? model = default,
global::Google.Gemini.InputConfig? inputConfig = default,
- global::Google.Gemini.GenerateContentBatchOutput? output = default,
- string? displayName = default,
string? priority = default,
global::Google.Gemini.BatchStats? batchStats = default,
+ global::Google.Gemini.GenerateContentBatchOutput? output = default,
+ string? displayName = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
@@ -434,10 +489,10 @@ partial void ProcessBatchesUpdateGenerateContentBatchResponseContent(
{
Model = model,
InputConfig = inputConfig,
- Output = output,
- DisplayName = displayName,
Priority = priority,
BatchStats = batchStats,
+ Output = output,
+ DisplayName = displayName,
};
return await BatchesUpdateGenerateContentBatchAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs
index 9f4111fdd..3ad2dbc64 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsCreate.g.cs
@@ -50,6 +50,28 @@ partial void ProcessCachedContentsCreateResponseContent(
///
public async global::System.Threading.Tasks.Task CachedContentsCreateAsync(
+ global::Google.Gemini.CachedContent request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CachedContentsCreateAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Creates CachedContent resource.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CachedContentsCreateAsResponseAsync(
+
global::Google.Gemini.CachedContent request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -84,6 +106,7 @@ partial void ProcessCachedContentsCreateResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/cachedContents",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +177,8 @@ partial void ProcessCachedContentsCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +189,11 @@ partial void ProcessCachedContentsCreateResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +211,8 @@ partial void ProcessCachedContentsCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +222,7 @@ partial void ProcessCachedContentsCreateResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +231,11 @@ partial void ProcessCachedContentsCreateResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +252,15 @@ partial void ProcessCachedContentsCreateResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +300,8 @@ partial void ProcessCachedContentsCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +322,8 @@ partial void ProcessCachedContentsCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +348,13 @@ partial void ProcessCachedContentsCreateResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +382,13 @@ partial void ProcessCachedContentsCreateResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -380,60 +429,60 @@ partial void ProcessCachedContentsCreateResponseContent(
///
/// Creates CachedContent resource.
///
- ///
- /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
+ ///
+ /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response
+ ///
+ ///
+ /// Input only. New TTL for this resource, input only.
///
///
/// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`
///
- ///
- /// Optional. Input only. Immutable. The content to cache.
+ ///
+ /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
///
/// The Tool configuration containing parameters for specifying `Tool` use in the request.
///
- ///
- /// Input only. New TTL for this resource, input only.
+ ///
+ /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
///
///
/// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.
///
- ///
- /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
+ ///
+ /// Optional. Input only. Immutable. The content to cache.
///
///
/// Metadata on the usage of the cached content.
///
- ///
- /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task CachedContentsCreateAsync(
- string? expireTime = default,
+ global::System.Collections.Generic.IList? tools = default,
+ string? ttl = default,
string? model = default,
- global::System.Collections.Generic.IList? contents = default,
+ global::Google.Gemini.Content? systemInstruction = default,
global::Google.Gemini.ToolConfig? toolConfig = default,
- string? ttl = default,
+ string? expireTime = default,
string? displayName = default,
- global::Google.Gemini.Content? systemInstruction = default,
+ global::System.Collections.Generic.IList? contents = default,
global::Google.Gemini.CachedContentUsageMetadata? usageMetadata = default,
- global::System.Collections.Generic.IList? tools = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.CachedContent
{
- ExpireTime = expireTime,
+ Tools = tools,
+ Ttl = ttl,
Model = model,
- Contents = contents,
+ SystemInstruction = systemInstruction,
ToolConfig = toolConfig,
- Ttl = ttl,
+ ExpireTime = expireTime,
DisplayName = displayName,
- SystemInstruction = systemInstruction,
+ Contents = contents,
UsageMetadata = usageMetadata,
- Tools = tools,
};
return await CachedContentsCreateAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs
index 066a5d13c..4dd3726c2 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsDelete.g.cs
@@ -52,6 +52,26 @@ partial void ProcessCachedContentsDeleteResponseContent(
string cachedContentsId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CachedContentsDeleteAsResponseAsync(
+ cachedContentsId: cachedContentsId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes CachedContent resource.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CachedContentsDeleteAsResponseAsync(
+ string cachedContentsId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessCachedContentsDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/cachedContents/{cachedContentsId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessCachedContentsDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessCachedContentsDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessCachedContentsDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessCachedContentsDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessCachedContentsDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessCachedContentsDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessCachedContentsDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessCachedContentsDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessCachedContentsDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessCachedContentsDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs
index 00547b378..85cea00ac 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsGet.g.cs
@@ -52,6 +52,26 @@ partial void ProcessCachedContentsGetResponseContent(
string cachedContentsId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CachedContentsGetAsResponseAsync(
+ cachedContentsId: cachedContentsId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Reads CachedContent resource.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CachedContentsGetAsResponseAsync(
+ string cachedContentsId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessCachedContentsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/cachedContents/{cachedContentsId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessCachedContentsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessCachedContentsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessCachedContentsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessCachedContentsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessCachedContentsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessCachedContentsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessCachedContentsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessCachedContentsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessCachedContentsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessCachedContentsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs
index 9597aa657..4e3589577 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsList.g.cs
@@ -56,6 +56,29 @@ partial void ProcessCachedContentsListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CachedContentsListAsResponseAsync(
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists CachedContents.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CachedContentsListAsResponseAsync(
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessCachedContentsListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/cachedContents",
baseUri: HttpClient.BaseAddress);
@@ -96,10 +120,10 @@ partial void ProcessCachedContentsListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -155,6 +179,8 @@ partial void ProcessCachedContentsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +191,11 @@ partial void ProcessCachedContentsListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +213,8 @@ partial void ProcessCachedContentsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +224,7 @@ partial void ProcessCachedContentsListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +233,11 @@ partial void ProcessCachedContentsListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +254,15 @@ partial void ProcessCachedContentsListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +302,8 @@ partial void ProcessCachedContentsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +324,8 @@ partial void ProcessCachedContentsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +350,13 @@ partial void ProcessCachedContentsListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListCachedContentsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListCachedContentsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +384,13 @@ partial void ProcessCachedContentsListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListCachedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListCachedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs
index a936b016a..ebede5eff 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CachedContentsPatch.g.cs
@@ -57,6 +57,34 @@ partial void ProcessCachedContentsPatchResponseContent(
public async global::System.Threading.Tasks.Task CachedContentsPatchAsync(
string cachedContentsId,
+ global::Google.Gemini.CachedContent request,
+ string? updateMask = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CachedContentsPatchAsResponseAsync(
+ cachedContentsId: cachedContentsId,
+
+ request: request,
+ updateMask: updateMask,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Updates CachedContent resource (only expiration is updatable).
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CachedContentsPatchAsResponseAsync(
+ string cachedContentsId,
+
global::Google.Gemini.CachedContent request,
string? updateMask = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
@@ -94,6 +122,7 @@ partial void ProcessCachedContentsPatchResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/cachedContents/{cachedContentsId}",
baseUri: HttpClient.BaseAddress);
@@ -104,9 +133,9 @@ partial void ProcessCachedContentsPatchResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("updateMask", updateMask)
+ .AddOptionalParameter("updateMask", updateMask)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -169,6 +198,8 @@ partial void ProcessCachedContentsPatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -179,6 +210,11 @@ partial void ProcessCachedContentsPatchResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -196,6 +232,8 @@ partial void ProcessCachedContentsPatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -205,8 +243,7 @@ partial void ProcessCachedContentsPatchResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -215,6 +252,11 @@ partial void ProcessCachedContentsPatchResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -231,14 +273,15 @@ partial void ProcessCachedContentsPatchResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -278,6 +321,8 @@ partial void ProcessCachedContentsPatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -298,6 +343,8 @@ partial void ProcessCachedContentsPatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -322,9 +369,13 @@ partial void ProcessCachedContentsPatchResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.CachedContent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -352,9 +403,13 @@ partial void ProcessCachedContentsPatchResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.CachedContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -397,62 +452,62 @@ partial void ProcessCachedContentsPatchResponseContent(
///
///
///
- ///
- /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
+ ///
+ /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response
+ ///
+ ///
+ /// Input only. New TTL for this resource, input only.
///
///
/// Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`
///
- ///
- /// Optional. Input only. Immutable. The content to cache.
+ ///
+ /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
///
/// The Tool configuration containing parameters for specifying `Tool` use in the request.
///
- ///
- /// Input only. New TTL for this resource, input only.
+ ///
+ /// Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
///
///
/// Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.
///
- ///
- /// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
+ ///
+ /// Optional. Input only. Immutable. The content to cache.
///
///
/// Metadata on the usage of the cached content.
///
- ///
- /// Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task CachedContentsPatchAsync(
string cachedContentsId,
string? updateMask = default,
- string? expireTime = default,
+ global::System.Collections.Generic.IList? tools = default,
+ string? ttl = default,
string? model = default,
- global::System.Collections.Generic.IList? contents = default,
+ global::Google.Gemini.Content? systemInstruction = default,
global::Google.Gemini.ToolConfig? toolConfig = default,
- string? ttl = default,
+ string? expireTime = default,
string? displayName = default,
- global::Google.Gemini.Content? systemInstruction = default,
+ global::System.Collections.Generic.IList? contents = default,
global::Google.Gemini.CachedContentUsageMetadata? usageMetadata = default,
- global::System.Collections.Generic.IList? tools = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.CachedContent
{
- ExpireTime = expireTime,
+ Tools = tools,
+ Ttl = ttl,
Model = model,
- Contents = contents,
+ SystemInstruction = systemInstruction,
ToolConfig = toolConfig,
- Ttl = ttl,
+ ExpireTime = expireTime,
DisplayName = displayName,
- SystemInstruction = systemInstruction,
+ Contents = contents,
UsageMetadata = usageMetadata,
- Tools = tools,
};
return await CachedContentsPatchAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs
index 861e55d34..973b89975 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaCreate.g.cs
@@ -50,6 +50,28 @@ partial void ProcessCorporaCreateResponseContent(
///
public async global::System.Threading.Tasks.Task CorporaCreateAsync(
+ global::Google.Gemini.Corpus request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaCreateAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Creates an empty `Corpus`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaCreateAsResponseAsync(
+
global::Google.Gemini.Corpus request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -84,6 +106,7 @@ partial void ProcessCorporaCreateResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/corpora",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +177,8 @@ partial void ProcessCorporaCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +189,11 @@ partial void ProcessCorporaCreateResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +211,8 @@ partial void ProcessCorporaCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +222,7 @@ partial void ProcessCorporaCreateResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +231,11 @@ partial void ProcessCorporaCreateResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +252,15 @@ partial void ProcessCorporaCreateResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +300,8 @@ partial void ProcessCorporaCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +322,8 @@ partial void ProcessCorporaCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +348,13 @@ partial void ProcessCorporaCreateResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +382,13 @@ partial void ProcessCorporaCreateResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs
index 4d92dfc2d..23ae5a377 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaDelete.g.cs
@@ -56,6 +56,29 @@ partial void ProcessCorporaDeleteResponseContent(
bool? force = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaDeleteAsResponseAsync(
+ corporaId: corporaId,
+ force: force,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes a `Corpus`.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaDeleteAsResponseAsync(
+ string corporaId,
+ bool? force = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessCorporaDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}",
baseUri: HttpClient.BaseAddress);
@@ -96,9 +120,9 @@ partial void ProcessCorporaDeleteResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("force", force?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("force", force?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -154,6 +178,8 @@ partial void ProcessCorporaDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +190,11 @@ partial void ProcessCorporaDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +212,8 @@ partial void ProcessCorporaDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +223,7 @@ partial void ProcessCorporaDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +232,11 @@ partial void ProcessCorporaDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +253,15 @@ partial void ProcessCorporaDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +301,8 @@ partial void ProcessCorporaDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +323,8 @@ partial void ProcessCorporaDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +349,13 @@ partial void ProcessCorporaDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +383,13 @@ partial void ProcessCorporaDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs
index 28ed1f9f2..bd7f702e8 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaGet.g.cs
@@ -52,6 +52,26 @@ partial void ProcessCorporaGetResponseContent(
string corporaId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaGetAsResponseAsync(
+ corporaId: corporaId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets information about a specific `Corpus`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaGetAsResponseAsync(
+ string corporaId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessCorporaGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessCorporaGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessCorporaGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessCorporaGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessCorporaGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessCorporaGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessCorporaGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessCorporaGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessCorporaGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessCorporaGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Corpus.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessCorporaGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Corpus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs
index 8439103a9..3e2f9f336 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaList.g.cs
@@ -56,6 +56,29 @@ partial void ProcessCorporaListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaListAsResponseAsync(
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists all `Corpora` owned by the user.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaListAsResponseAsync(
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessCorporaListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/corpora",
baseUri: HttpClient.BaseAddress);
@@ -96,10 +120,10 @@ partial void ProcessCorporaListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -155,6 +179,8 @@ partial void ProcessCorporaListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +191,11 @@ partial void ProcessCorporaListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +213,8 @@ partial void ProcessCorporaListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +224,7 @@ partial void ProcessCorporaListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +233,11 @@ partial void ProcessCorporaListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +254,15 @@ partial void ProcessCorporaListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +302,8 @@ partial void ProcessCorporaListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +324,8 @@ partial void ProcessCorporaListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +350,13 @@ partial void ProcessCorporaListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListCorporaResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListCorporaResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +384,13 @@ partial void ProcessCorporaListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListCorporaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListCorporaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs
index 787a4a1a7..6630a0a7b 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaOperationsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessCorporaOperationsGetResponseContent(
string corporaId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaOperationsGetAsResponseAsync(
+ operationsId: operationsId,
+ corporaId: corporaId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaOperationsGetAsResponseAsync(
+ string operationsId,
+ string corporaId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessCorporaOperationsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}/operations/{operationsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessCorporaOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessCorporaOperationsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessCorporaOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessCorporaOperationsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessCorporaOperationsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessCorporaOperationsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessCorporaOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessCorporaOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessCorporaOperationsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessCorporaOperationsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs
index ebe07e6fc..e7da42d85 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsCreate.g.cs
@@ -54,6 +54,31 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
public async global::System.Threading.Tasks.Task CorporaPermissionsCreateAsync(
string corporaId,
+ global::Google.Gemini.Permission request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaPermissionsCreateAsResponseAsync(
+ corporaId: corporaId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create a permission to a specific resource.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaPermissionsCreateAsResponseAsync(
+ string corporaId,
+
global::Google.Gemini.Permission request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}/permissions",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,31 +439,31 @@ partial void ProcessCorporaPermissionsCreateResponseContent(
/// Create a permission to a specific resource.
///
///
- ///
- /// Required. The role granted by this permission.
- ///
///
/// Optional. Immutable. The type of the grantee.
///
///
/// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.
///
+ ///
+ /// Required. The role granted by this permission.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task CorporaPermissionsCreateAsync(
string corporaId,
- global::Google.Gemini.PermissionRole? role = default,
global::Google.Gemini.PermissionGranteeType? granteeType = default,
string? emailAddress = default,
+ global::Google.Gemini.PermissionRole? role = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.Permission
{
- Role = role,
GranteeType = granteeType,
EmailAddress = emailAddress,
+ Role = role,
};
return await CorporaPermissionsCreateAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs
index b02decf6c..28d7ac642 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsDelete.g.cs
@@ -56,6 +56,29 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
string corporaId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaPermissionsDeleteAsResponseAsync(
+ permissionsId: permissionsId,
+ corporaId: corporaId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes the permission.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaPermissionsDeleteAsResponseAsync(
+ string permissionsId,
+ string corporaId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}/permissions/{permissionsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessCorporaPermissionsDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs
index f991f64e7..b4a0eb019 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessCorporaPermissionsGetResponseContent(
string corporaId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaPermissionsGetAsResponseAsync(
+ permissionsId: permissionsId,
+ corporaId: corporaId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets information about a specific Permission.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaPermissionsGetAsResponseAsync(
+ string permissionsId,
+ string corporaId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessCorporaPermissionsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}/permissions/{permissionsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessCorporaPermissionsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessCorporaPermissionsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessCorporaPermissionsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessCorporaPermissionsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessCorporaPermissionsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessCorporaPermissionsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessCorporaPermissionsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessCorporaPermissionsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessCorporaPermissionsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessCorporaPermissionsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs
index bce88c14e..3496c6c87 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsList.g.cs
@@ -60,6 +60,32 @@ partial void ProcessCorporaPermissionsListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaPermissionsListAsResponseAsync(
+ corporaId: corporaId,
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists permissions for the specific resource.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaPermissionsListAsResponseAsync(
+ string corporaId,
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -91,6 +117,7 @@ partial void ProcessCorporaPermissionsListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}/permissions",
baseUri: HttpClient.BaseAddress);
@@ -101,10 +128,10 @@ partial void ProcessCorporaPermissionsListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -161,6 +188,8 @@ partial void ProcessCorporaPermissionsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +200,11 @@ partial void ProcessCorporaPermissionsListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +222,8 @@ partial void ProcessCorporaPermissionsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +233,7 @@ partial void ProcessCorporaPermissionsListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +242,11 @@ partial void ProcessCorporaPermissionsListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +263,15 @@ partial void ProcessCorporaPermissionsListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +311,8 @@ partial void ProcessCorporaPermissionsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +333,8 @@ partial void ProcessCorporaPermissionsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -314,9 +359,13 @@ partial void ProcessCorporaPermissionsListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListPermissionsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListPermissionsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -344,9 +393,13 @@ partial void ProcessCorporaPermissionsListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListPermissionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListPermissionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs
index 4a40647fd..cad014241 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.CorporaPermissionsPatch.g.cs
@@ -61,6 +61,37 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
string permissionsId,
string corporaId,
+ global::Google.Gemini.Permission request,
+ string? updateMask = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CorporaPermissionsPatchAsResponseAsync(
+ permissionsId: permissionsId,
+ corporaId: corporaId,
+
+ request: request,
+ updateMask: updateMask,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Updates the permission.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CorporaPermissionsPatchAsResponseAsync(
+ string permissionsId,
+ string corporaId,
+
global::Google.Gemini.Permission request,
string? updateMask = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
@@ -99,6 +130,7 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/corpora/{corporaId}/permissions/{permissionsId}",
baseUri: HttpClient.BaseAddress);
@@ -109,9 +141,9 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("updateMask", updateMask)
+ .AddOptionalParameter("updateMask", updateMask)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -175,6 +207,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -185,6 +219,11 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -202,6 +241,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -211,8 +252,7 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -221,6 +261,11 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -237,14 +282,15 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -284,6 +330,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -304,6 +352,8 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -328,9 +378,13 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Permission.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -358,9 +412,13 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Permission.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -404,15 +462,15 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
///
///
///
- ///
- /// Required. The role granted by this permission.
- ///
///
/// Optional. Immutable. The type of the grantee.
///
///
/// Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.
///
+ ///
+ /// Required. The role granted by this permission.
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -420,17 +478,17 @@ partial void ProcessCorporaPermissionsPatchResponseContent(
string permissionsId,
string corporaId,
string? updateMask = default,
- global::Google.Gemini.PermissionRole? role = default,
global::Google.Gemini.PermissionGranteeType? granteeType = default,
string? emailAddress = default,
+ global::Google.Gemini.PermissionRole? role = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.Permission
{
- Role = role,
GranteeType = granteeType,
EmailAddress = emailAddress,
+ Role = role,
};
return await CorporaPermissionsPatchAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs
index ae85044ff..52e50eddb 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicGenerateContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessDynamicGenerateContentResponseContent(
public async global::System.Threading.Tasks.Task DynamicGenerateContentAsync(
string dynamicId,
+ global::Google.Gemini.GenerateContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DynamicGenerateContentAsResponseAsync(
+ dynamicId: dynamicId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DynamicGenerateContentAsResponseAsync(
+ string dynamicId,
+
global::Google.Gemini.GenerateContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessDynamicGenerateContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/dynamic/{dynamicId}:generateContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessDynamicGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessDynamicGenerateContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessDynamicGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessDynamicGenerateContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessDynamicGenerateContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessDynamicGenerateContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessDynamicGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessDynamicGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessDynamicGenerateContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessDynamicGenerateContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,66 +439,66 @@ partial void ProcessDynamicGenerateContentResponseContent(
/// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.
///
///
- ///
- /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
+ ///
+ /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
///
- ///
- /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
+ /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
///
- ///
- /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ /// Optional. The service tier of the request.
///
///
/// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
+ ///
+ /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
///
/// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
///
- ///
- /// Optional. The service tier of the request.
+ ///
+ /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
///
- ///
- /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
+ ///
+ /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ ///
+ /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
///
///
/// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
///
- ///
- /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
- ///
- ///
- /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task DynamicGenerateContentAsync(
string dynamicId,
- global::System.Collections.Generic.IList? contents = default,
- global::Google.Gemini.ToolConfig? toolConfig = default,
- string? model = default,
+ global::Google.Gemini.GenerationConfig? generationConfig = default,
+ global::System.Collections.Generic.IList? tools = default,
+ global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
global::Google.Gemini.Content? systemInstruction = default,
+ global::Google.Gemini.ToolConfig? toolConfig = default,
string? cachedContent = default,
- global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
- global::System.Collections.Generic.IList? tools = default,
- global::System.Collections.Generic.IList? safetySettings = default,
- global::Google.Gemini.GenerationConfig? generationConfig = default,
bool? store = default,
+ string? model = default,
+ global::System.Collections.Generic.IList? contents = default,
+ global::System.Collections.Generic.IList? safetySettings = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.GenerateContentRequest
{
- Contents = contents,
- ToolConfig = toolConfig,
- Model = model,
+ GenerationConfig = generationConfig,
+ Tools = tools,
+ ServiceTier = serviceTier,
SystemInstruction = systemInstruction,
+ ToolConfig = toolConfig,
CachedContent = cachedContent,
- ServiceTier = serviceTier,
- Tools = tools,
- SafetySettings = safetySettings,
- GenerationConfig = generationConfig,
Store = store,
+ Model = model,
+ Contents = contents,
+ SafetySettings = safetySettings,
};
return await DynamicGenerateContentAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs
index 1cdac0679..d31ccfc05 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
public async global::System.Threading.Tasks.Task DynamicStreamGenerateContentAsync(
string dynamicId,
+ global::Google.Gemini.GenerateContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DynamicStreamGenerateContentAsResponseAsync(
+ dynamicId: dynamicId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DynamicStreamGenerateContentAsResponseAsync(
+ string dynamicId,
+
global::Google.Gemini.GenerateContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/dynamic/{dynamicId}:streamGenerateContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,66 +439,66 @@ partial void ProcessDynamicStreamGenerateContentResponseContent(
/// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
///
///
- ///
- /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
+ ///
+ /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
///
- ///
- /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
+ /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
///
- ///
- /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ /// Optional. The service tier of the request.
///
///
/// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
+ ///
+ /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
///
/// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
///
- ///
- /// Optional. The service tier of the request.
+ ///
+ /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
///
- ///
- /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
+ ///
+ /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ ///
+ /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
///
///
/// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
///
- ///
- /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
- ///
- ///
- /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task DynamicStreamGenerateContentAsync(
string dynamicId,
- global::System.Collections.Generic.IList? contents = default,
- global::Google.Gemini.ToolConfig? toolConfig = default,
- string? model = default,
+ global::Google.Gemini.GenerationConfig? generationConfig = default,
+ global::System.Collections.Generic.IList? tools = default,
+ global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
global::Google.Gemini.Content? systemInstruction = default,
+ global::Google.Gemini.ToolConfig? toolConfig = default,
string? cachedContent = default,
- global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
- global::System.Collections.Generic.IList? tools = default,
- global::System.Collections.Generic.IList? safetySettings = default,
- global::Google.Gemini.GenerationConfig? generationConfig = default,
bool? store = default,
+ string? model = default,
+ global::System.Collections.Generic.IList? contents = default,
+ global::System.Collections.Generic.IList? safetySettings = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.GenerateContentRequest
{
- Contents = contents,
- ToolConfig = toolConfig,
- Model = model,
+ GenerationConfig = generationConfig,
+ Tools = tools,
+ ServiceTier = serviceTier,
SystemInstruction = systemInstruction,
+ ToolConfig = toolConfig,
CachedContent = cachedContent,
- ServiceTier = serviceTier,
- Tools = tools,
- SafetySettings = safetySettings,
- GenerationConfig = generationConfig,
Store = store,
+ Model = model,
+ Contents = contents,
+ SafetySettings = safetySettings,
};
return await DynamicStreamGenerateContentAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs
index 9d3514422..862a9a375 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.DynamicStreamGenerateContentAsStream.g.cs
@@ -84,6 +84,7 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/dynamic/{dynamicId}:streamGenerateContent",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +156,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +168,11 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +190,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +201,7 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +210,11 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +231,15 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +279,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +301,8 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -360,66 +379,66 @@ partial void ProcessDynamicStreamGenerateContentAsStreamResponse(
/// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
///
///
- ///
- /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
+ ///
+ /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
///
- ///
- /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
+ /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
///
- ///
- /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ /// Optional. The service tier of the request.
///
///
/// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
+ ///
+ /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
///
/// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
///
- ///
- /// Optional. The service tier of the request.
+ ///
+ /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
///
- ///
- /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
+ ///
+ /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ ///
+ /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
///
///
/// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
///
- ///
- /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
- ///
- ///
- /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Collections.Generic.IAsyncEnumerable DynamicStreamGenerateContentAsStreamAsync(
string dynamicId,
- global::System.Collections.Generic.IList? contents = default,
- global::Google.Gemini.ToolConfig? toolConfig = default,
- string? model = default,
+ global::Google.Gemini.GenerationConfig? generationConfig = default,
+ global::System.Collections.Generic.IList? tools = default,
+ global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
global::Google.Gemini.Content? systemInstruction = default,
+ global::Google.Gemini.ToolConfig? toolConfig = default,
string? cachedContent = default,
- global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
- global::System.Collections.Generic.IList? tools = default,
- global::System.Collections.Generic.IList? safetySettings = default,
- global::Google.Gemini.GenerationConfig? generationConfig = default,
bool? store = default,
+ string? model = default,
+ global::System.Collections.Generic.IList? contents = default,
+ global::System.Collections.Generic.IList? safetySettings = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.GenerateContentRequest
{
- Contents = contents,
- ToolConfig = toolConfig,
- Model = model,
+ GenerationConfig = generationConfig,
+ Tools = tools,
+ ServiceTier = serviceTier,
SystemInstruction = systemInstruction,
+ ToolConfig = toolConfig,
CachedContent = cachedContent,
- ServiceTier = serviceTier,
- Tools = tools,
- SafetySettings = safetySettings,
- GenerationConfig = generationConfig,
Store = store,
+ Model = model,
+ Contents = contents,
+ SafetySettings = safetySettings,
};
var __enumerable = DynamicStreamGenerateContentAsStreamAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs
index 06509fe63..22ea3ac6c 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresCreate.g.cs
@@ -50,6 +50,28 @@ partial void ProcessFileSearchStoresCreateResponseContent(
///
public async global::System.Threading.Tasks.Task FileSearchStoresCreateAsync(
+ global::Google.Gemini.FileSearchStore request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresCreateAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Creates an empty `FileSearchStore`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresCreateAsResponseAsync(
+
global::Google.Gemini.FileSearchStore request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -84,6 +106,7 @@ partial void ProcessFileSearchStoresCreateResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/fileSearchStores",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +177,8 @@ partial void ProcessFileSearchStoresCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +189,11 @@ partial void ProcessFileSearchStoresCreateResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +211,8 @@ partial void ProcessFileSearchStoresCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +222,7 @@ partial void ProcessFileSearchStoresCreateResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +231,11 @@ partial void ProcessFileSearchStoresCreateResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +252,15 @@ partial void ProcessFileSearchStoresCreateResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +300,8 @@ partial void ProcessFileSearchStoresCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +322,8 @@ partial void ProcessFileSearchStoresCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +348,13 @@ partial void ProcessFileSearchStoresCreateResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +382,13 @@ partial void ProcessFileSearchStoresCreateResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs
index 2b47229d5..f50d4a6ab 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDelete.g.cs
@@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
bool? force = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresDeleteAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+ force: force,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes a `FileSearchStore`.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresDeleteAsResponseAsync(
+ string fileSearchStoresId,
+ bool? force = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}",
baseUri: HttpClient.BaseAddress);
@@ -96,9 +120,9 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("force", force?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("force", force?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -154,6 +178,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +190,11 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +212,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +223,7 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +232,11 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +253,15 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +301,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +323,8 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +349,13 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +383,13 @@ partial void ProcessFileSearchStoresDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs
index e711942c7..69e35977a 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsDelete.g.cs
@@ -60,6 +60,32 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
bool? force = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresDocumentsDeleteAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+ documentsId: documentsId,
+ force: force,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes a `Document`.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresDocumentsDeleteAsResponseAsync(
+ string fileSearchStoresId,
+ string documentsId,
+ bool? force = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -91,6 +117,7 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}",
baseUri: HttpClient.BaseAddress);
@@ -101,9 +128,9 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("force", force?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("force", force?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -160,6 +187,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +199,11 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +221,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +232,7 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +241,11 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +262,15 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +310,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +332,8 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +358,13 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +392,13 @@ partial void ProcessFileSearchStoresDocumentsDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs
index b888ab22b..a5bc674f5 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
string documentsId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresDocumentsGetAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+ documentsId: documentsId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets information about a specific `Document`.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresDocumentsGetAsResponseAsync(
+ string fileSearchStoresId,
+ string documentsId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}/documents/{documentsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Document.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Document.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessFileSearchStoresDocumentsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Document.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs
index 89330b58b..fea2c4c7f 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresDocumentsList.g.cs
@@ -60,6 +60,32 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresDocumentsListAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists all `Document`s in a `Corpus`.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresDocumentsListAsResponseAsync(
+ string fileSearchStoresId,
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -91,6 +117,7 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}/documents",
baseUri: HttpClient.BaseAddress);
@@ -101,10 +128,10 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -161,6 +188,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +200,11 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +222,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +233,7 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +242,11 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +263,15 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +311,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +333,8 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -314,9 +359,13 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListDocumentsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListDocumentsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -344,9 +393,13 @@ partial void ProcessFileSearchStoresDocumentsListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListDocumentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs
index 329ad3d3c..d3efcc130 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresGet.g.cs
@@ -52,6 +52,26 @@ partial void ProcessFileSearchStoresGetResponseContent(
string fileSearchStoresId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresGetAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets information about a specific `FileSearchStore`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresGetAsResponseAsync(
+ string fileSearchStoresId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessFileSearchStoresGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessFileSearchStoresGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessFileSearchStoresGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessFileSearchStoresGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessFileSearchStoresGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessFileSearchStoresGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessFileSearchStoresGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessFileSearchStoresGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessFileSearchStoresGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessFileSearchStoresGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.FileSearchStore.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessFileSearchStoresGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.FileSearchStore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs
index e43ae79a3..2f8953417 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresImportFile.g.cs
@@ -54,6 +54,31 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
public async global::System.Threading.Tasks.Task FileSearchStoresImportFileAsync(
string fileSearchStoresId,
+ global::Google.Gemini.ImportFileRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresImportFileAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Imports a `File` from File Service to a `FileSearchStore`.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresImportFileAsResponseAsync(
+ string fileSearchStoresId,
+
global::Google.Gemini.ImportFileRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}:importFile",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,31 +439,31 @@ partial void ProcessFileSearchStoresImportFileResponseContent(
/// Imports a `File` from File Service to a `FileSearchStore`.
///
///
- ///
- /// Custom metadata to be associated with the file.
+ ///
+ /// Required. The name of the `File` to import. Example: `files/abc-123`
///
///
/// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto
///
- ///
- /// Required. The name of the `File` to import. Example: `files/abc-123`
+ ///
+ /// Custom metadata to be associated with the file.
///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task FileSearchStoresImportFileAsync(
string fileSearchStoresId,
- global::System.Collections.Generic.IList? customMetadata = default,
- global::Google.Gemini.ChunkingConfig? chunkingConfig = default,
string? fileName = default,
+ global::Google.Gemini.ChunkingConfig? chunkingConfig = default,
+ global::System.Collections.Generic.IList? customMetadata = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.ImportFileRequest
{
- CustomMetadata = customMetadata,
- ChunkingConfig = chunkingConfig,
FileName = fileName,
+ ChunkingConfig = chunkingConfig,
+ CustomMetadata = customMetadata,
};
return await FileSearchStoresImportFileAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs
index 344fa4dd4..d18e08ce6 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresList.g.cs
@@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresListAsResponseAsync(
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists all `FileSearchStores` owned by the user.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresListAsResponseAsync(
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/fileSearchStores",
baseUri: HttpClient.BaseAddress);
@@ -96,10 +120,10 @@ partial void ProcessFileSearchStoresListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -155,6 +179,8 @@ partial void ProcessFileSearchStoresListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +191,11 @@ partial void ProcessFileSearchStoresListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +213,8 @@ partial void ProcessFileSearchStoresListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +224,7 @@ partial void ProcessFileSearchStoresListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +233,11 @@ partial void ProcessFileSearchStoresListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +254,15 @@ partial void ProcessFileSearchStoresListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +302,8 @@ partial void ProcessFileSearchStoresListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +324,8 @@ partial void ProcessFileSearchStoresListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +350,13 @@ partial void ProcessFileSearchStoresListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListFileSearchStoresResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListFileSearchStoresResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +384,13 @@ partial void ProcessFileSearchStoresListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListFileSearchStoresResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListFileSearchStoresResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs
index 473e7eb0c..88e4c2227 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresOperationsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
string fileSearchStoresId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresOperationsGetAsResponseAsync(
+ operationsId: operationsId,
+ fileSearchStoresId: fileSearchStoresId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresOperationsGetAsResponseAsync(
+ string operationsId,
+ string fileSearchStoresId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}/operations/{operationsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessFileSearchStoresOperationsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs
index b65a9f0a9..8b07669fe 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FileSearchStoresUploadOperationsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
string fileSearchStoresId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FileSearchStoresUploadOperationsGetAsResponseAsync(
+ operationsId: operationsId,
+ fileSearchStoresId: fileSearchStoresId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FileSearchStoresUploadOperationsGetAsResponseAsync(
+ string operationsId,
+ string fileSearchStoresId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}/upload/operations/{operationsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessFileSearchStoresUploadOperationsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs
index e94c3f8fe..cf7d15254 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesDelete.g.cs
@@ -52,6 +52,26 @@ partial void ProcessFilesDeleteResponseContent(
string filesId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FilesDeleteAsResponseAsync(
+ filesId: filesId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Deletes the `File`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FilesDeleteAsResponseAsync(
+ string filesId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessFilesDeleteResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/files/{filesId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessFilesDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessFilesDeleteResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessFilesDeleteResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessFilesDeleteResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessFilesDeleteResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessFilesDeleteResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessFilesDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessFilesDeleteResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessFilesDeleteResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Empty.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessFilesDeleteResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Empty.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs
index f9654b778..578919ac6 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesGet.g.cs
@@ -52,6 +52,26 @@ partial void ProcessFilesGetResponseContent(
string filesId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FilesGetAsResponseAsync(
+ filesId: filesId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the metadata for the given `File`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FilesGetAsResponseAsync(
+ string filesId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessFilesGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/files/{filesId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessFilesGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessFilesGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessFilesGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessFilesGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessFilesGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessFilesGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessFilesGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessFilesGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessFilesGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.File.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.File.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessFilesGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.File.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.File.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs
index 84d9db128..a70c73c45 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesList.g.cs
@@ -56,6 +56,29 @@ partial void ProcessFilesListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FilesListAsResponseAsync(
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists the metadata for `File`s owned by the requesting project.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FilesListAsResponseAsync(
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessFilesListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/files",
baseUri: HttpClient.BaseAddress);
@@ -96,10 +120,10 @@ partial void ProcessFilesListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -155,6 +179,8 @@ partial void ProcessFilesListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +191,11 @@ partial void ProcessFilesListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +213,8 @@ partial void ProcessFilesListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +224,7 @@ partial void ProcessFilesListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +233,11 @@ partial void ProcessFilesListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +254,15 @@ partial void ProcessFilesListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +302,8 @@ partial void ProcessFilesListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +324,8 @@ partial void ProcessFilesListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +350,13 @@ partial void ProcessFilesListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListFilesResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListFilesResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +384,13 @@ partial void ProcessFilesListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs
index 7f4208962..3bac9d27f 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.FilesRegister.g.cs
@@ -50,6 +50,28 @@ partial void ProcessFilesRegisterResponseContent(
///
public async global::System.Threading.Tasks.Task FilesRegisterAsync(
+ global::Google.Gemini.RegisterFilesRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await FilesRegisterAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Registers a Google Cloud Storage files with FileService. The user is expected to provide Google Cloud Storage URIs and will receive a File resource for each URI in return. Note that the files are not copied, just registered with File API. If one file fails to register, the whole request fails.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> FilesRegisterAsResponseAsync(
+
global::Google.Gemini.RegisterFilesRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -84,6 +106,7 @@ partial void ProcessFilesRegisterResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/files:register",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +177,8 @@ partial void ProcessFilesRegisterResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +189,11 @@ partial void ProcessFilesRegisterResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +211,8 @@ partial void ProcessFilesRegisterResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +222,7 @@ partial void ProcessFilesRegisterResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +231,11 @@ partial void ProcessFilesRegisterResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +252,15 @@ partial void ProcessFilesRegisterResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +300,8 @@ partial void ProcessFilesRegisterResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +322,8 @@ partial void ProcessFilesRegisterResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +348,13 @@ partial void ProcessFilesRegisterResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.RegisterFilesResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.RegisterFilesResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +382,13 @@ partial void ProcessFilesRegisterResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.RegisterFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.RegisterFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs
index d4dd9aae2..7ed45a64c 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesList.g.cs
@@ -56,6 +56,29 @@ partial void ProcessGeneratedFilesListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GeneratedFilesListAsResponseAsync(
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists the generated files owned by the requesting project.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GeneratedFilesListAsResponseAsync(
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessGeneratedFilesListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/generatedFiles",
baseUri: HttpClient.BaseAddress);
@@ -96,10 +120,10 @@ partial void ProcessGeneratedFilesListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -155,6 +179,8 @@ partial void ProcessGeneratedFilesListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +191,11 @@ partial void ProcessGeneratedFilesListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +213,8 @@ partial void ProcessGeneratedFilesListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +224,7 @@ partial void ProcessGeneratedFilesListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +233,11 @@ partial void ProcessGeneratedFilesListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +254,15 @@ partial void ProcessGeneratedFilesListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +302,8 @@ partial void ProcessGeneratedFilesListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +324,8 @@ partial void ProcessGeneratedFilesListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +350,13 @@ partial void ProcessGeneratedFilesListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListGeneratedFilesResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListGeneratedFilesResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +384,13 @@ partial void ProcessGeneratedFilesListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListGeneratedFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListGeneratedFilesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs
index 80610df39..54f4957b1 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.GeneratedFilesOperationsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
string generatedFilesId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GeneratedFilesOperationsGetAsResponseAsync(
+ operationsId: operationsId,
+ generatedFilesId: generatedFilesId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GeneratedFilesOperationsGetAsResponseAsync(
+ string operationsId,
+ string generatedFilesId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/generatedFiles/{generatedFilesId}/operations/{operationsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessGeneratedFilesOperationsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs
index f8ffaa2a5..c80395b5d 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUpload.g.cs
@@ -50,6 +50,28 @@ partial void ProcessMediaUploadResponseContent(
///
public async global::System.Threading.Tasks.Task MediaUploadAsync(
+ global::Google.Gemini.CreateFileRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await MediaUploadAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Creates a `File`.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> MediaUploadAsResponseAsync(
+
global::Google.Gemini.CreateFileRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -84,6 +106,7 @@ partial void ProcessMediaUploadResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/files",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +177,8 @@ partial void ProcessMediaUploadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +189,11 @@ partial void ProcessMediaUploadResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +211,8 @@ partial void ProcessMediaUploadResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +222,7 @@ partial void ProcessMediaUploadResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +231,11 @@ partial void ProcessMediaUploadResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +252,15 @@ partial void ProcessMediaUploadResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +300,8 @@ partial void ProcessMediaUploadResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +322,8 @@ partial void ProcessMediaUploadResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -307,9 +348,13 @@ partial void ProcessMediaUploadResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.CreateFileResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.CreateFileResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -337,9 +382,13 @@ partial void ProcessMediaUploadResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.CreateFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.CreateFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs
index 5dc8e5e80..76b471baf 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.MediaUploadToFileSearchStore.g.cs
@@ -54,6 +54,31 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
public async global::System.Threading.Tasks.Task MediaUploadToFileSearchStoreAsync(
string fileSearchStoresId,
+ global::Google.Gemini.UploadToFileSearchStoreRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await MediaUploadToFileSearchStoreAsResponseAsync(
+ fileSearchStoresId: fileSearchStoresId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> MediaUploadToFileSearchStoreAsResponseAsync(
+ string fileSearchStoresId,
+
global::Google.Gemini.UploadToFileSearchStoreRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/fileSearchStores/{fileSearchStoresId}:uploadToFileSearchStore",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.CustomLongRunningOperation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.CustomLongRunningOperation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.CustomLongRunningOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.CustomLongRunningOperation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,15 +439,15 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
/// Uploads data to a FileSearchStore, preprocesses and chunks before storing it in a FileSearchStore Document.
///
///
- ///
- /// Custom metadata to be associated with the data.
- ///
///
/// Parameters for telling the service how to chunk the file. inspired by google3/cloud/ai/platform/extension/lib/retrieval/config/chunker_config.proto
///
///
/// Optional. Display name of the created document.
///
+ ///
+ /// Custom metadata to be associated with the data.
+ ///
///
/// Optional. MIME type of the data. If not provided, it will be inferred from the uploaded content.
///
@@ -404,18 +456,18 @@ partial void ProcessMediaUploadToFileSearchStoreResponseContent(
///
public async global::System.Threading.Tasks.Task MediaUploadToFileSearchStoreAsync(
string fileSearchStoresId,
- global::System.Collections.Generic.IList? customMetadata = default,
global::Google.Gemini.ChunkingConfig? chunkingConfig = default,
string? displayName = default,
+ global::System.Collections.Generic.IList? customMetadata = default,
string? mimeType = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.UploadToFileSearchStoreRequest
{
- CustomMetadata = customMetadata,
ChunkingConfig = chunkingConfig,
DisplayName = displayName,
+ CustomMetadata = customMetadata,
MimeType = mimeType,
};
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs
index 76ccdaf8f..9524ea980 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsAsyncBatchEmbedContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
public async global::System.Threading.Tasks.Task ModelsAsyncBatchEmbedContentAsync(
string modelsId,
+ global::Google.Gemini.AsyncBatchEmbedContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsAsyncBatchEmbedContentAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsAsyncBatchEmbedContentAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.AsyncBatchEmbedContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:asyncBatchEmbedContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessModelsAsyncBatchEmbedContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs
index efdf231f3..ccfc8ad98 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchEmbedContents.g.cs
@@ -54,6 +54,31 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
public async global::System.Threading.Tasks.Task ModelsBatchEmbedContentsAsync(
string modelsId,
+ global::Google.Gemini.BatchEmbedContentsRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsBatchEmbedContentsAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsBatchEmbedContentsAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.BatchEmbedContentsRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:batchEmbedContents",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.BatchEmbedContentsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.BatchEmbedContentsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessModelsBatchEmbedContentsResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.BatchEmbedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.BatchEmbedContentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs
index 07b077e90..3534f3c6c 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsBatchGenerateContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
public async global::System.Threading.Tasks.Task ModelsBatchGenerateContentAsync(
string modelsId,
+ global::Google.Gemini.BatchGenerateContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsBatchGenerateContentAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Enqueues a batch of `GenerateContent` requests for batch processing.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsBatchGenerateContentAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.BatchGenerateContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:batchGenerateContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessModelsBatchGenerateContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs
index 293eab140..9a48aa82d 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsCountTokens.g.cs
@@ -54,6 +54,31 @@ partial void ProcessModelsCountTokensResponseContent(
public async global::System.Threading.Tasks.Task ModelsCountTokensAsync(
string modelsId,
+ global::Google.Gemini.CountTokensRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsCountTokensAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsCountTokensAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.CountTokensRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessModelsCountTokensResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:countTokens",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessModelsCountTokensResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessModelsCountTokensResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessModelsCountTokensResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessModelsCountTokensResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessModelsCountTokensResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessModelsCountTokensResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessModelsCountTokensResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessModelsCountTokensResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessModelsCountTokensResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.CountTokensResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.CountTokensResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessModelsCountTokensResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.CountTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.CountTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs
index 90f56f580..29ce048ad 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsEmbedContent.g.cs
@@ -56,6 +56,31 @@ partial void ProcessModelsEmbedContentResponseContent(
public async global::System.Threading.Tasks.Task ModelsEmbedContentAsync(
string modelsId,
+ global::Google.Gemini.EmbedContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsEmbedContentAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsEmbedContentAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.EmbedContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -91,6 +116,7 @@ partial void ProcessModelsEmbedContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:embedContent",
baseUri: HttpClient.BaseAddress);
@@ -162,6 +188,8 @@ partial void ProcessModelsEmbedContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -172,6 +200,11 @@ partial void ProcessModelsEmbedContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -189,6 +222,8 @@ partial void ProcessModelsEmbedContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -198,8 +233,7 @@ partial void ProcessModelsEmbedContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -208,6 +242,11 @@ partial void ProcessModelsEmbedContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -224,14 +263,15 @@ partial void ProcessModelsEmbedContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -271,6 +311,8 @@ partial void ProcessModelsEmbedContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -291,6 +333,8 @@ partial void ProcessModelsEmbedContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -315,9 +359,13 @@ partial void ProcessModelsEmbedContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.EmbedContentResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.EmbedContentResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -345,9 +393,13 @@ partial void ProcessModelsEmbedContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.EmbedContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.EmbedContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs
index 8671c5c76..984aec483 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGenerateContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessModelsGenerateContentResponseContent(
public async global::System.Threading.Tasks.Task ModelsGenerateContentAsync(
string modelsId,
+ global::Google.Gemini.GenerateContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsGenerateContentAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsGenerateContentAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.GenerateContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessModelsGenerateContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:generateContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessModelsGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessModelsGenerateContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessModelsGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessModelsGenerateContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessModelsGenerateContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessModelsGenerateContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessModelsGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessModelsGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessModelsGenerateContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessModelsGenerateContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,66 +439,66 @@ partial void ProcessModelsGenerateContentResponseContent(
/// Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.
///
///
- ///
- /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
+ ///
+ /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
///
- ///
- /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
+ /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
///
- ///
- /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ /// Optional. The service tier of the request.
///
///
/// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
+ ///
+ /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
///
/// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
///
- ///
- /// Optional. The service tier of the request.
+ ///
+ /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
///
- ///
- /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
+ ///
+ /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ ///
+ /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
///
///
/// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
///
- ///
- /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
- ///
- ///
- /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task ModelsGenerateContentAsync(
string modelsId,
- global::System.Collections.Generic.IList? contents = default,
- global::Google.Gemini.ToolConfig? toolConfig = default,
- string? model = default,
+ global::Google.Gemini.GenerationConfig? generationConfig = default,
+ global::System.Collections.Generic.IList? tools = default,
+ global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
global::Google.Gemini.Content? systemInstruction = default,
+ global::Google.Gemini.ToolConfig? toolConfig = default,
string? cachedContent = default,
- global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
- global::System.Collections.Generic.IList? tools = default,
- global::System.Collections.Generic.IList? safetySettings = default,
- global::Google.Gemini.GenerationConfig? generationConfig = default,
bool? store = default,
+ string? model = default,
+ global::System.Collections.Generic.IList? contents = default,
+ global::System.Collections.Generic.IList? safetySettings = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.GenerateContentRequest
{
- Contents = contents,
- ToolConfig = toolConfig,
- Model = model,
+ GenerationConfig = generationConfig,
+ Tools = tools,
+ ServiceTier = serviceTier,
SystemInstruction = systemInstruction,
+ ToolConfig = toolConfig,
CachedContent = cachedContent,
- ServiceTier = serviceTier,
- Tools = tools,
- SafetySettings = safetySettings,
- GenerationConfig = generationConfig,
Store = store,
+ Model = model,
+ Contents = contents,
+ SafetySettings = safetySettings,
};
return await ModelsGenerateContentAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs
index 1f29ce891..67d0011e4 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsGet.g.cs
@@ -52,6 +52,26 @@ partial void ProcessModelsGetResponseContent(
string modelsId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsGetAsResponseAsync(
+ modelsId: modelsId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsGetAsResponseAsync(
+ string modelsId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessModelsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}",
baseUri: HttpClient.BaseAddress);
@@ -145,6 +166,8 @@ partial void ProcessModelsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -155,6 +178,11 @@ partial void ProcessModelsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -172,6 +200,8 @@ partial void ProcessModelsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -181,8 +211,7 @@ partial void ProcessModelsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -191,6 +220,11 @@ partial void ProcessModelsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -207,14 +241,15 @@ partial void ProcessModelsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -254,6 +289,8 @@ partial void ProcessModelsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -274,6 +311,8 @@ partial void ProcessModelsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -298,9 +337,13 @@ partial void ProcessModelsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Model.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Model.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -328,9 +371,13 @@ partial void ProcessModelsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Model.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Model.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs
index 42a38def6..ba152c3c6 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsList.g.cs
@@ -56,6 +56,29 @@ partial void ProcessModelsListResponseContent(
string? pageToken = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsListAsResponseAsync(
+ pageSize: pageSize,
+ pageToken: pageToken,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsListAsResponseAsync(
+ int? pageSize = default,
+ string? pageToken = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessModelsListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/models",
baseUri: HttpClient.BaseAddress);
@@ -96,10 +120,10 @@ partial void ProcessModelsListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("pageSize", pageSize?.ToString())
- .AddOptionalParameter("pageToken", pageToken)
+ .AddOptionalParameter("pageToken", pageToken)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -155,6 +179,8 @@ partial void ProcessModelsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +191,11 @@ partial void ProcessModelsListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +213,8 @@ partial void ProcessModelsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +224,7 @@ partial void ProcessModelsListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +233,11 @@ partial void ProcessModelsListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +254,15 @@ partial void ProcessModelsListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +302,8 @@ partial void ProcessModelsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +324,8 @@ partial void ProcessModelsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +350,13 @@ partial void ProcessModelsListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListModelsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListModelsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +384,13 @@ partial void ProcessModelsListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs
index 4d6cea65c..1156ceda8 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsGet.g.cs
@@ -56,6 +56,29 @@ partial void ProcessModelsOperationsGetResponseContent(
string modelsId,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsOperationsGetAsResponseAsync(
+ operationsId: operationsId,
+ modelsId: modelsId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsOperationsGetAsResponseAsync(
+ string operationsId,
+ string modelsId,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -86,6 +109,7 @@ partial void ProcessModelsOperationsGetResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}/operations/{operationsId}",
baseUri: HttpClient.BaseAddress);
@@ -151,6 +175,8 @@ partial void ProcessModelsOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -161,6 +187,11 @@ partial void ProcessModelsOperationsGetResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -178,6 +209,8 @@ partial void ProcessModelsOperationsGetResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -187,8 +220,7 @@ partial void ProcessModelsOperationsGetResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -197,6 +229,11 @@ partial void ProcessModelsOperationsGetResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -213,14 +250,15 @@ partial void ProcessModelsOperationsGetResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -260,6 +298,8 @@ partial void ProcessModelsOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -280,6 +320,8 @@ partial void ProcessModelsOperationsGetResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -304,9 +346,13 @@ partial void ProcessModelsOperationsGetResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -334,9 +380,13 @@ partial void ProcessModelsOperationsGetResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs
index 4d6524aaf..f35c292e5 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsOperationsList.g.cs
@@ -68,6 +68,38 @@ partial void ProcessModelsOperationsListResponseContent(
bool? returnPartialSuccess = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsOperationsListAsResponseAsync(
+ modelsId: modelsId,
+ filter: filter,
+ pageSize: pageSize,
+ pageToken: pageToken,
+ returnPartialSuccess: returnPartialSuccess,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsOperationsListAsResponseAsync(
+ string modelsId,
+ string? filter = default,
+ int? pageSize = default,
+ string? pageToken = default,
+ bool? returnPartialSuccess = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -101,6 +133,7 @@ partial void ProcessModelsOperationsListResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}/operations",
baseUri: HttpClient.BaseAddress);
@@ -111,12 +144,12 @@ partial void ProcessModelsOperationsListResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
.AddOptionalParameter("filter", filter)
.AddOptionalParameter("pageSize", pageSize?.ToString())
.AddOptionalParameter("pageToken", pageToken)
- .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("returnPartialSuccess", returnPartialSuccess?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -175,6 +208,8 @@ partial void ProcessModelsOperationsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -185,6 +220,11 @@ partial void ProcessModelsOperationsListResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -202,6 +242,8 @@ partial void ProcessModelsOperationsListResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -211,8 +253,7 @@ partial void ProcessModelsOperationsListResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -221,6 +262,11 @@ partial void ProcessModelsOperationsListResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -237,14 +283,15 @@ partial void ProcessModelsOperationsListResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -284,6 +331,8 @@ partial void ProcessModelsOperationsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -304,6 +353,8 @@ partial void ProcessModelsOperationsListResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -328,9 +379,13 @@ partial void ProcessModelsOperationsListResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.ListOperationsResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -358,9 +413,13 @@ partial void ProcessModelsOperationsListResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.ListOperationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs
index 4fcda93f6..3f57c3d97 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
public async global::System.Threading.Tasks.Task ModelsStreamGenerateContentAsync(
string modelsId,
+ global::Google.Gemini.GenerateContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ModelsStreamGenerateContentAsResponseAsync(
+ modelsId: modelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ModelsStreamGenerateContentAsResponseAsync(
+ string modelsId,
+
global::Google.Gemini.GenerateContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:streamGenerateContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.GenerateContentResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.GenerateContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -387,66 +439,66 @@ partial void ProcessModelsStreamGenerateContentResponseContent(
/// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
///
///
- ///
- /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
+ ///
+ /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
///
- ///
- /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
+ /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
///
- ///
- /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ /// Optional. The service tier of the request.
///
///
/// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
+ ///
+ /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
///
/// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
///
- ///
- /// Optional. The service tier of the request.
+ ///
+ /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
///
- ///
- /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
+ ///
+ /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ ///
+ /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
///
///
/// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
///
- ///
- /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
- ///
- ///
- /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Threading.Tasks.Task ModelsStreamGenerateContentAsync(
string modelsId,
- global::System.Collections.Generic.IList? contents = default,
- global::Google.Gemini.ToolConfig? toolConfig = default,
- string? model = default,
+ global::Google.Gemini.GenerationConfig? generationConfig = default,
+ global::System.Collections.Generic.IList? tools = default,
+ global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
global::Google.Gemini.Content? systemInstruction = default,
+ global::Google.Gemini.ToolConfig? toolConfig = default,
string? cachedContent = default,
- global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
- global::System.Collections.Generic.IList? tools = default,
- global::System.Collections.Generic.IList? safetySettings = default,
- global::Google.Gemini.GenerationConfig? generationConfig = default,
bool? store = default,
+ string? model = default,
+ global::System.Collections.Generic.IList? contents = default,
+ global::System.Collections.Generic.IList? safetySettings = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.GenerateContentRequest
{
- Contents = contents,
- ToolConfig = toolConfig,
- Model = model,
+ GenerationConfig = generationConfig,
+ Tools = tools,
+ ServiceTier = serviceTier,
SystemInstruction = systemInstruction,
+ ToolConfig = toolConfig,
CachedContent = cachedContent,
- ServiceTier = serviceTier,
- Tools = tools,
- SafetySettings = safetySettings,
- GenerationConfig = generationConfig,
Store = store,
+ Model = model,
+ Contents = contents,
+ SafetySettings = safetySettings,
};
return await ModelsStreamGenerateContentAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs
index dcd8f9462..cdf8cdb97 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.ModelsStreamGenerateContentAsStream.g.cs
@@ -84,6 +84,7 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/models/{modelsId}:streamGenerateContent",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +156,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +168,11 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +190,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +201,7 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +210,11 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +231,15 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +279,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +301,8 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -360,66 +379,66 @@ partial void ProcessModelsStreamGenerateContentAsStreamResponse(
/// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.
///
///
- ///
- /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
+ ///
+ /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
///
- ///
- /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
+ /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
///
- ///
- /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ /// Optional. The service tier of the request.
///
///
/// The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
///
+ ///
+ /// The Tool configuration containing parameters for specifying `Tool` use in the request.
+ ///
///
/// Optional. The name of the content [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context to serve the prediction. Format: `cachedContents/{cachedContent}`
///
- ///
- /// Optional. The service tier of the request.
+ ///
+ /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
///
- ///
- /// Optional. A list of `Tools` the `Model` may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the `Model`. Supported `Tool`s are `Function` and `code_execution`. Refer to the [Function calling](https://ai.google.dev/gemini-api/docs/function-calling) and the [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) guides to learn more.
+ ///
+ /// Required. The name of the `Model` to use for generating the completion. Format: `models/{model}`.
+ ///
+ ///
+ /// Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), this is a repeated field that contains the conversation history and the latest request.
///
///
/// Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) for detailed information on available safety settings. Also refer to the [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to learn how to incorporate safety considerations in your AI applications.
///
- ///
- /// Configuration options for model generation and outputs. Not all parameters are configurable for every model.
- ///
- ///
- /// Optional. Configures the logging behavior for a given request. If set, it takes precedence over the project-level logging config.
- ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
public async global::System.Collections.Generic.IAsyncEnumerable ModelsStreamGenerateContentAsStreamAsync(
string modelsId,
- global::System.Collections.Generic.IList? contents = default,
- global::Google.Gemini.ToolConfig? toolConfig = default,
- string? model = default,
+ global::Google.Gemini.GenerationConfig? generationConfig = default,
+ global::System.Collections.Generic.IList? tools = default,
+ global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
global::Google.Gemini.Content? systemInstruction = default,
+ global::Google.Gemini.ToolConfig? toolConfig = default,
string? cachedContent = default,
- global::Google.Gemini.GenerateContentRequestServiceTier? serviceTier = default,
- global::System.Collections.Generic.IList? tools = default,
- global::System.Collections.Generic.IList? safetySettings = default,
- global::Google.Gemini.GenerationConfig? generationConfig = default,
bool? store = default,
+ string? model = default,
+ global::System.Collections.Generic.IList? contents = default,
+ global::System.Collections.Generic.IList? safetySettings = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::Google.Gemini.GenerateContentRequest
{
- Contents = contents,
- ToolConfig = toolConfig,
- Model = model,
+ GenerationConfig = generationConfig,
+ Tools = tools,
+ ServiceTier = serviceTier,
SystemInstruction = systemInstruction,
+ ToolConfig = toolConfig,
CachedContent = cachedContent,
- ServiceTier = serviceTier,
- Tools = tools,
- SafetySettings = safetySettings,
- GenerationConfig = generationConfig,
Store = store,
+ Model = model,
+ Contents = contents,
+ SafetySettings = safetySettings,
};
var __enumerable = ModelsStreamGenerateContentAsStreamAsync(
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs
index 168d8267b..8293d35fc 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsAsyncBatchEmbedContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
public async global::System.Threading.Tasks.Task TunedModelsAsyncBatchEmbedContentAsync(
string tunedModelsId,
+ global::Google.Gemini.AsyncBatchEmbedContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await TunedModelsAsyncBatchEmbedContentAsResponseAsync(
+ tunedModelsId: tunedModelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Enqueues a batch of `EmbedContent` requests for batch processing. We have a `BatchEmbedContents` handler in `GenerativeService`, but it was synchronized. So we name this one to be `Async` to avoid confusion.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> TunedModelsAsyncBatchEmbedContentAsResponseAsync(
+ string tunedModelsId,
+
global::Google.Gemini.AsyncBatchEmbedContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/tunedModels/{tunedModelsId}:asyncBatchEmbedContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessTunedModelsAsyncBatchEmbedContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs
index 2f1f3af62..7adc1bb51 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsBatchGenerateContent.g.cs
@@ -54,6 +54,31 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
public async global::System.Threading.Tasks.Task TunedModelsBatchGenerateContentAsync(
string tunedModelsId,
+ global::Google.Gemini.BatchGenerateContentRequest request,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await TunedModelsBatchGenerateContentAsResponseAsync(
+ tunedModelsId: tunedModelsId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Enqueues a batch of `GenerateContent` requests for batch processing.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> TunedModelsBatchGenerateContentAsResponseAsync(
+ string tunedModelsId,
+
global::Google.Gemini.BatchGenerateContentRequest request,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -89,6 +114,7 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: $"/tunedModels/{tunedModelsId}:batchGenerateContent",
baseUri: HttpClient.BaseAddress);
@@ -160,6 +186,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -170,6 +198,11 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -187,6 +220,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -196,8 +231,7 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -206,6 +240,11 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -222,14 +261,15 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -269,6 +309,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -289,6 +331,8 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -313,9 +357,13 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -343,9 +391,13 @@ partial void ProcessTunedModelsBatchGenerateContentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Google.Gemini.Operation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Google.Gemini.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Google.Gemini.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs
index 039dc27aa..8bf55405b 100644
--- a/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs
+++ b/src/libs/Google.Gemini/Generated/Google.Gemini.GeminiClient.TunedModelsCreate.g.cs
@@ -53,6 +53,31 @@ partial void ProcessTunedModelsCreateResponseContent(
///
public async global::System.Threading.Tasks.Task TunedModelsCreateAsync(
+ global::Google.Gemini.TunedModel request,
+ string? tunedModelId = default,
+ global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await TunedModelsCreateAsResponseAsync(
+
+ request: request,
+ tunedModelId: tunedModelId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> TunedModelsCreateAsResponseAsync(
+
global::Google.Gemini.TunedModel request,
string? tunedModelId = default,
global::Google.Gemini.AutoSDKRequestOptions? requestOptions = default,
@@ -89,6 +114,7 @@ partial void ProcessTunedModelsCreateResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Google.Gemini.PathBuilder(
path: "/tunedModels",
baseUri: HttpClient.BaseAddress);
@@ -99,9 +125,9 @@ partial void ProcessTunedModelsCreateResponseContent(
{
__pathBuilder = __pathBuilder.AddRequiredParameter(__authorization.Name, __authorization.Value);
}
- }
+ }
__pathBuilder
- .AddOptionalParameter("tunedModelId", tunedModelId)
+ .AddOptionalParameter("tunedModelId", tunedModelId)
;
var __path = __pathBuilder.ToString();
__path = global::Google.Gemini.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -163,6 +189,8 @@ partial void ProcessTunedModelsCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -173,6 +201,11 @@ partial void ProcessTunedModelsCreateResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -190,6 +223,8 @@ partial void ProcessTunedModelsCreateResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -199,8 +234,7 @@ partial void ProcessTunedModelsCreateResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -209,6 +243,11 @@ partial void ProcessTunedModelsCreateResponseContent(
__attempt < __maxAttempts &&
global::Google.Gemini.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Google.Gemini.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Google.Gemini.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Google.Gemini.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -225,14 +264,15 @@ partial void ProcessTunedModelsCreateResponseContent(
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::Google.Gemini.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -272,6 +312,8 @@ partial void ProcessTunedModelsCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -292,6 +334,8 @@ partial void ProcessTunedModelsCreateResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -316,9 +360,13 @@ partial void ProcessTunedModelsCreateResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Google.Gemini.Operation.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Google.Gemini.AutoSDKHttpResponse