diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.Get3.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.Get3.g.cs
new file mode 100644
index 0000000..4752424
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.Get3.g.cs
@@ -0,0 +1,581 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesArtifactsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Get3SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Get3SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_Get3SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_Get3SecurityRequirement0,
+ s_Get3SecurityRequirement1,
+ };
+ partial void PrepareGet3Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref string artifactId);
+ partial void PrepareGet3Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ string artifactId);
+ partial void ProcessGet3Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessGet3ResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get artifact on alias-routed session
+ /// Retrieve an artifact stored in a session originally created via this alias, including metadata and base64-encoded file content.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Example: art_report_pdf_a3f2
+ ///
+ /// 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 Get3Async(
+ string aliasKey,
+ string sessionKey,
+ string artifactId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await Get3AsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ artifactId: artifactId,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get artifact on alias-routed session
+ /// Retrieve an artifact stored in a session originally created via this alias, including metadata and base64-encoded file content.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Example: art_report_pdf_a3f2
+ ///
+ /// 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> Get3AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string artifactId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareGet3Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ artifactId: ref artifactId);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_Get3SecurityRequirements,
+ operationName: "Get3Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts/{artifactId}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareGet3Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ artifactId: artifactId!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get3",
+ methodName: "Get3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts/{artifactId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get3",
+ methodName: "Get3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts/{artifactId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get3",
+ methodName: "Get3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts/{artifactId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessGet3Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get3",
+ methodName: "Get3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts/{artifactId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get3",
+ methodName: "Get3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts/{artifactId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow accessing this artifact.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias, session, or artifact not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessGet3ResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.SessionArtifact.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.SessionArtifact.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.List3.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.List3.g.cs
new file mode 100644
index 0000000..e956825
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.List3.g.cs
@@ -0,0 +1,622 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesArtifactsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_List3SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_List3SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_List3SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_List3SecurityRequirement0,
+ s_List3SecurityRequirement1,
+ };
+ partial void PrepareList3Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref int? limit,
+ ref string? pageKey,
+ ref global::Vectara.ListAliasRoutedSessionArtifactsSortBy? sortBy,
+ ref global::Vectara.ListAliasRoutedSessionArtifactsOrderBy? orderBy);
+ partial void PrepareList3Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ int? limit,
+ string? pageKey,
+ global::Vectara.ListAliasRoutedSessionArtifactsSortBy? sortBy,
+ global::Vectara.ListAliasRoutedSessionArtifactsOrderBy? orderBy);
+ partial void ProcessList3Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessList3ResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List artifacts on alias-routed session
+ /// List artifacts stored in a session originally created via this alias. Artifacts are files either uploaded by the user, or generated within the session.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Default Value: created_at
+ ///
+ ///
+ /// Default Value: desc
+ ///
+ /// 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 List3Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsSortBy? sortBy = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsOrderBy? orderBy = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await List3AsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ limit: limit,
+ pageKey: pageKey,
+ sortBy: sortBy,
+ orderBy: orderBy,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List artifacts on alias-routed session
+ /// List artifacts stored in a session originally created via this alias. Artifacts are files either uploaded by the user, or generated within the session.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Default Value: created_at
+ ///
+ ///
+ /// Default Value: desc
+ ///
+ /// 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> List3AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsSortBy? sortBy = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsOrderBy? orderBy = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareList3Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ limit: ref limit,
+ pageKey: ref pageKey,
+ sortBy: ref sortBy,
+ orderBy: ref orderBy);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_List3SecurityRequirements,
+ operationName: "List3Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts",
+ baseUri: HttpClient.BaseAddress);
+ __pathBuilder
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("page_key", pageKey)
+ .AddOptionalParameter("sort_by", sortBy?.ToValueString())
+ .AddOptionalParameter("order_by", orderBy?.ToValueString())
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareList3Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ limit: limit,
+ pageKey: pageKey,
+ sortBy: sortBy,
+ orderBy: orderBy);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List3",
+ methodName: "List3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List3",
+ methodName: "List3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List3",
+ methodName: "List3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessList3Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List3",
+ methodName: "List3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List3",
+ methodName: "List3Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/artifacts\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow listing artifacts on this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias or session not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessList3ResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.ListSessionArtifactsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.ListSessionArtifactsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.g.cs
new file mode 100644
index 0000000..654fe04
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesArtifactsClient.g.cs
@@ -0,0 +1,139 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class AgentAliasesArtifactsClient : global::Vectara.IAgentAliasesArtifactsClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.vectara.io/";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator AutoSDKOAuth2State { get; set; } = new global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the AgentAliasesArtifactsClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesArtifactsClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesArtifactsClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesArtifactsClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesArtifactsClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesArtifactsClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Vectara.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Create.g.cs
new file mode 100644
index 0000000..8b137eb
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Create.g.cs
@@ -0,0 +1,660 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_CreateSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_CreateSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_CreateSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_CreateSecurityRequirement0,
+ s_CreateSecurityRequirement1,
+ };
+ partial void PrepareCreateArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ global::Vectara.CreateAgentAliasRequest request);
+ partial void PrepareCreateRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ global::Vectara.CreateAgentAliasRequest request);
+ partial void ProcessCreateResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessCreateResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Create an alias
+ /// Create a new alias. Aliases are routing primitives that map a public name to one or more underlying agents under a configurable policy. When a session is created through an alias (via `POST /v2/agent_aliases/{alias_key}/sessions`), the alias's policy decides which underlying agent runs that session.
+ /// Common patterns:
+ /// - **Direct alias** — a `routed` policy with one rule and one target. Identical in behavior to invoking the agent directly.
+ /// - **Canary rollout** — a `routed` policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
+ /// - **Tenant routing** — a `routed` policy with multiple rules, each matching on session metadata (e.g. `session.metadata.tenant`).
+ ///
+ ///
+ ///
+ ///
+ /// 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 CreateAsync(
+
+ global::Vectara.CreateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateAsResponseAsync(
+
+ request: request,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create an alias
+ /// Create a new alias. Aliases are routing primitives that map a public name to one or more underlying agents under a configurable policy. When a session is created through an alias (via `POST /v2/agent_aliases/{alias_key}/sessions`), the alias's policy decides which underlying agent runs that session.
+ /// Common patterns:
+ /// - **Direct alias** — a `routed` policy with one rule and one target. Identical in behavior to invoking the agent directly.
+ /// - **Canary rollout** — a `routed` policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
+ /// - **Tenant routing** — a `routed` policy with multiple rules, each matching on session metadata (e.g. `session.metadata.tenant`).
+ ///
+ ///
+ ///
+ ///
+ /// 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> CreateAsResponseAsync(
+
+ global::Vectara.CreateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreateArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_CreateSecurityRequirements,
+ operationName: "CreateAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: "/v2/agent_aliases",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreateRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create",
+ methodName: "CreateAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create",
+ methodName: "CreateAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create",
+ methodName: "CreateAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreateResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create",
+ methodName: "CreateAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create",
+ methodName: "CreateAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Request was malformed or the policy is invalid.
+ if ((int)__response.StatusCode == 400)
+ {
+ string? __content_400 = null;
+ global::System.Exception? __exception_400 = null;
+ global::Vectara.BadRequestError? __value_400 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ else
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_400 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_400,
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Permissions do not allow creating aliases.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // An alias with this key already exists.
+ if ((int)__response.StatusCode == 409)
+ {
+ string? __content_409 = null;
+ global::System.Exception? __exception_409 = null;
+ global::Vectara.Error? __value_409 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_409 = global::Vectara.Error.FromJson(__content_409, JsonSerializerContext);
+ }
+ else
+ {
+ __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_409 = global::Vectara.Error.FromJson(__content_409, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_409 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_409 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_409,
+ responseBody: __content_409,
+ responseObject: __value_409,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessCreateResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentAlias.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentAlias.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Create an alias
+ /// Create a new alias. Aliases are routing primitives that map a public name to one or more underlying agents under a configurable policy. When a session is created through an alias (via `POST /v2/agent_aliases/{alias_key}/sessions`), the alias's policy decides which underlying agent runs that session.
+ /// Common patterns:
+ /// - **Direct alias** — a `routed` policy with one rule and one target. Identical in behavior to invoking the agent directly.
+ /// - **Canary rollout** — a `routed` policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
+ /// - **Tenant routing** — a `routed` policy with multiple rules, each matching on session metadata (e.g. `session.metadata.tenant`).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ ///
+ /// A routing policy. The `type` discriminator determines which fields apply:
+ /// * `routed` — evaluate ordered rules; the first rule whose `match` expression evaluates to true is selected. The selected rule's `targets` are then used (one agent for `single`, hashed by `partition_by` for `weighted`). Rules with omitted `match` are catch-all rules (typically last).
+ /// Most use cases (direct, weighted/canary, conditional, conditional+canary) collapse into `routed`.
+ ///
+ ///
+ /// Default Value: true
+ ///
+ ///
+ /// 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 CreateAsync(
+ string key,
+ string name,
+ global::Vectara.RoutedAliasPolicy policy,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? description = default,
+ bool? enabled = default,
+ object? metadata = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Vectara.CreateAgentAliasRequest
+ {
+ Key = key,
+ Name = name,
+ Description = description,
+ Policy = policy,
+ Enabled = enabled,
+ Metadata = metadata,
+ };
+
+ return await CreateAsync(
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Delete.g.cs
new file mode 100644
index 0000000..d217e88
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Delete.g.cs
@@ -0,0 +1,567 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_DeleteSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_DeleteSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_DeleteSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_DeleteSecurityRequirement0,
+ s_DeleteSecurityRequirement1,
+ };
+ partial void PrepareDeleteArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey);
+ partial void PrepareDeleteRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey);
+ partial void ProcessDeleteResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ ///
+ /// Delete an alias
+ /// Delete an alias. The underlying agents the alias points at are not affected. Returns 409 if any live resources still reference this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// 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 DeleteAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteAsResponseAsync(
+ aliasKey: aliasKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete an alias
+ /// Delete an alias. The underlying agents the alias points at are not affected. Returns 409 if any live resources still reference this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// 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 DeleteAsResponseAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeleteArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeleteSecurityRequirements,
+ operationName: "DeleteAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Delete,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeleteRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete",
+ methodName: "DeleteAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete",
+ methodName: "DeleteAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete",
+ methodName: "DeleteAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeleteResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete",
+ methodName: "DeleteAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete",
+ methodName: "DeleteAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow deleting this alias.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // The alias was not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // The alias has live references (e.g. connectors) that prevent deletion.
+ if ((int)__response.StatusCode == 409)
+ {
+ string? __content_409 = null;
+ global::System.Exception? __exception_409 = null;
+ global::Vectara.Error? __value_409 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_409 = global::Vectara.Error.FromJson(__content_409, JsonSerializerContext);
+ }
+ else
+ {
+ __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_409 = global::Vectara.Error.FromJson(__content_409, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_409 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_409 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_409,
+ responseBody: __content_409,
+ responseObject: __value_409,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Get.g.cs
new file mode 100644
index 0000000..3aab233
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Get.g.cs
@@ -0,0 +1,553 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_GetSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_GetSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_GetSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_GetSecurityRequirement0,
+ s_GetSecurityRequirement1,
+ };
+ partial void PrepareGetArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey);
+ partial void PrepareGetRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey);
+ partial void ProcessGetResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessGetResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get an alias
+ /// Retrieve a specific alias including its policy.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// 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 GetAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetAsResponseAsync(
+ aliasKey: aliasKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get an alias
+ /// Retrieve a specific alias including its policy.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// 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> GetAsResponseAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareGetArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_GetSecurityRequirements,
+ operationName: "GetAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareGetRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get",
+ methodName: "GetAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get",
+ methodName: "GetAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get",
+ methodName: "GetAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessGetResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get",
+ methodName: "GetAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get",
+ methodName: "GetAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow viewing this alias.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // The alias was not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessGetResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentAlias.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentAlias.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.List.g.cs
new file mode 100644
index 0000000..2587058
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.List.g.cs
@@ -0,0 +1,555 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_ListSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_ListSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_ListSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_ListSecurityRequirement0,
+ s_ListSecurityRequirement1,
+ };
+ partial void PrepareListArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref int? limit,
+ ref string? pageKey,
+ ref string? filter,
+ ref bool? enabled);
+ partial void PrepareListRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ int? limit,
+ string? pageKey,
+ string? filter,
+ bool? enabled);
+ partial void ProcessListResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessListResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List aliases
+ /// List all aliases owned by the current customer.
+ ///
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Example: support.*
+ ///
+ ///
+ /// Example: true
+ ///
+ /// 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 ListAsync(
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ string? filter = default,
+ bool? enabled = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAsResponseAsync(
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ limit: limit,
+ pageKey: pageKey,
+ filter: filter,
+ enabled: enabled,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List aliases
+ /// List all aliases owned by the current customer.
+ ///
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Example: support.*
+ ///
+ ///
+ /// Example: true
+ ///
+ /// 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> ListAsResponseAsync(
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ string? filter = default,
+ bool? enabled = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareListArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ limit: ref limit,
+ pageKey: ref pageKey,
+ filter: ref filter,
+ enabled: ref enabled);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ListSecurityRequirements,
+ operationName: "ListAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: "/v2/agent_aliases",
+ baseUri: HttpClient.BaseAddress);
+ __pathBuilder
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("page_key", pageKey)
+ .AddOptionalParameter("filter", filter)
+ .AddOptionalParameter("enabled", enabled?.ToString().ToLowerInvariant())
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareListRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ limit: limit,
+ pageKey: pageKey,
+ filter: filter,
+ enabled: enabled);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List",
+ methodName: "ListAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List",
+ methodName: "ListAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List",
+ methodName: "ListAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessListResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List",
+ methodName: "ListAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List",
+ methodName: "ListAsync",
+ pathTemplate: "\"/v2/agent_aliases\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow listing aliases.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessListResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.ListAgentAliasesResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.ListAgentAliasesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.ReplacePolicy.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.ReplacePolicy.g.cs
new file mode 100644
index 0000000..d7afa9c
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.ReplacePolicy.g.cs
@@ -0,0 +1,652 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_ReplacePolicySecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_ReplacePolicySecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_ReplacePolicySecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_ReplacePolicySecurityRequirement0,
+ s_ReplacePolicySecurityRequirement1,
+ };
+ partial void PrepareReplacePolicyArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ global::Vectara.ReplaceAliasPolicyRequest request);
+ partial void PrepareReplacePolicyRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ global::Vectara.ReplaceAliasPolicyRequest request);
+ partial void ProcessReplacePolicyResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessReplacePolicyResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Replace an alias's routing policy
+ /// Atomically replace the alias's routing policy and stickiness configuration. Replacement is whole-object; partial merging is not supported.
+ /// Use this endpoint to flip canary weights, change tenant routing, etc. The change is atomic: in-flight sessions resolved before the change keep their resolved agent (resolution is once-at-creation).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// 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 ReplacePolicyAsync(
+ string aliasKey,
+
+ global::Vectara.ReplaceAliasPolicyRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ReplacePolicyAsResponseAsync(
+ aliasKey: aliasKey,
+
+ request: request,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Replace an alias's routing policy
+ /// Atomically replace the alias's routing policy and stickiness configuration. Replacement is whole-object; partial merging is not supported.
+ /// Use this endpoint to flip canary weights, change tenant routing, etc. The change is atomic: in-flight sessions resolved before the change keep their resolved agent (resolution is once-at-creation).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// 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> ReplacePolicyAsResponseAsync(
+ string aliasKey,
+
+ global::Vectara.ReplaceAliasPolicyRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareReplacePolicyArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ReplacePolicySecurityRequirements,
+ operationName: "ReplacePolicyAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/policy",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Put,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareReplacePolicyRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ReplacePolicy",
+ methodName: "ReplacePolicyAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/policy\"",
+ httpMethod: "PUT",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ReplacePolicy",
+ methodName: "ReplacePolicyAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/policy\"",
+ httpMethod: "PUT",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ReplacePolicy",
+ methodName: "ReplacePolicyAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/policy\"",
+ httpMethod: "PUT",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessReplacePolicyResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ReplacePolicy",
+ methodName: "ReplacePolicyAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/policy\"",
+ httpMethod: "PUT",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ReplacePolicy",
+ methodName: "ReplacePolicyAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/policy\"",
+ httpMethod: "PUT",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // The new policy is invalid.
+ if ((int)__response.StatusCode == 400)
+ {
+ string? __content_400 = null;
+ global::System.Exception? __exception_400 = null;
+ global::Vectara.BadRequestError? __value_400 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ else
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_400 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_400,
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Permissions do not allow modifying this alias.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // The alias was not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessReplacePolicyResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentAlias.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentAlias.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Replace an alias's routing policy
+ /// Atomically replace the alias's routing policy and stickiness configuration. Replacement is whole-object; partial merging is not supported.
+ /// Use this endpoint to flip canary weights, change tenant routing, etc. The change is atomic: in-flight sessions resolved before the change keep their resolved agent (resolution is once-at-creation).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A routing policy. The `type` discriminator determines which fields apply:
+ /// * `routed` — evaluate ordered rules; the first rule whose `match` expression evaluates to true is selected. The selected rule's `targets` are then used (one agent for `single`, hashed by `partition_by` for `weighted`). Rules with omitted `match` are catch-all rules (typically last).
+ /// Most use cases (direct, weighted/canary, conditional, conditional+canary) collapse into `routed`.
+ ///
+ /// 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 ReplacePolicyAsync(
+ string aliasKey,
+ global::Vectara.RoutedAliasPolicy policy,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Vectara.ReplaceAliasPolicyRequest
+ {
+ Policy = policy,
+ };
+
+ return await ReplacePolicyAsync(
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Update.g.cs
new file mode 100644
index 0000000..f682548
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.Update.g.cs
@@ -0,0 +1,617 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_UpdateSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_UpdateSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_UpdateSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_UpdateSecurityRequirement0,
+ s_UpdateSecurityRequirement1,
+ };
+ partial void PrepareUpdateArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ global::Vectara.UpdateAgentAliasRequest request);
+ partial void PrepareUpdateRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ global::Vectara.UpdateAgentAliasRequest request);
+ partial void ProcessUpdateResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessUpdateResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Update an alias's metadata
+ /// Update an alias's metadata fields (name, description, enabled, metadata). To replace the routing policy, use `PUT /v2/agent_aliases/{alias_key}/policy` — policies are atomic and not partially updatable.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// 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 UpdateAsync(
+ string aliasKey,
+
+ global::Vectara.UpdateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UpdateAsResponseAsync(
+ aliasKey: aliasKey,
+
+ request: request,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update an alias's metadata
+ /// Update an alias's metadata fields (name, description, enabled, metadata). To replace the routing policy, use `PUT /v2/agent_aliases/{alias_key}/policy` — policies are atomic and not partially updatable.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// 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> UpdateAsResponseAsync(
+ string aliasKey,
+
+ global::Vectara.UpdateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareUpdateArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_UpdateSecurityRequirements,
+ operationName: "UpdateAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: new global::System.Net.Http.HttpMethod("PATCH"),
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareUpdateRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update",
+ methodName: "UpdateAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update",
+ methodName: "UpdateAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update",
+ methodName: "UpdateAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessUpdateResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update",
+ methodName: "UpdateAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update",
+ methodName: "UpdateAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow modifying this alias.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // The alias was not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessUpdateResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentAlias.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentAlias.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Update an alias's metadata
+ /// Update an alias's metadata fields (name, description, enabled, metadata). To replace the routing policy, use `PUT /v2/agent_aliases/{alias_key}/policy` — policies are atomic and not partially updatable.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// 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 UpdateAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? name = default,
+ string? description = default,
+ bool? enabled = default,
+ object? metadata = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Vectara.UpdateAgentAliasRequest
+ {
+ Name = name,
+ Description = description,
+ Enabled = enabled,
+ Metadata = metadata,
+ };
+
+ return await UpdateAsync(
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.g.cs
new file mode 100644
index 0000000..99cbea5
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesClient.g.cs
@@ -0,0 +1,139 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class AgentAliasesClient : global::Vectara.IAgentAliasesClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.vectara.io/";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator AutoSDKOAuth2State { get; set; } = new global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the AgentAliasesClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Vectara.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.Hide.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.Hide.g.cs
new file mode 100644
index 0000000..09a6afe
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.Hide.g.cs
@@ -0,0 +1,577 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesEventsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_HideSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_HideSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_HideSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_HideSecurityRequirement0,
+ s_HideSecurityRequirement1,
+ };
+ partial void PrepareHideArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref string eventId);
+ partial void PrepareHideRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ string eventId);
+ partial void ProcessHideResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessHideResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Hide event on alias-routed session
+ /// Manually hide an event on a session originally created via this alias. Sets hide_reason to 'manual'.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 HideAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await HideAsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ eventId: eventId,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Hide event on alias-routed session
+ /// Manually hide an event on a session originally created via this alias. Sets hide_reason to 'manual'.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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> HideAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareHideArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ eventId: ref eventId);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_HideSecurityRequirements,
+ operationName: "HideAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/hide",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareHideRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ eventId: eventId!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Hide",
+ methodName: "HideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/hide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Hide",
+ methodName: "HideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/hide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Hide",
+ methodName: "HideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/hide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessHideResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Hide",
+ methodName: "HideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/hide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Hide",
+ methodName: "HideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/hide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow hiding events on this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias, session, or event not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessHideResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.Unhide.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.Unhide.g.cs
new file mode 100644
index 0000000..e244f92
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.Unhide.g.cs
@@ -0,0 +1,577 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesEventsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_UnhideSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_UnhideSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_UnhideSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_UnhideSecurityRequirement0,
+ s_UnhideSecurityRequirement1,
+ };
+ partial void PrepareUnhideArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref string eventId);
+ partial void PrepareUnhideRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ string eventId);
+ partial void ProcessUnhideResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessUnhideResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Unhide event on alias-routed session
+ /// Unhide a hidden event on a session originally created via this alias. Clears the hide_reason.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 UnhideAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UnhideAsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ eventId: eventId,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Unhide event on alias-routed session
+ /// Unhide a hidden event on a session originally created via this alias. Clears the hide_reason.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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> UnhideAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareUnhideArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ eventId: ref eventId);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_UnhideSecurityRequirements,
+ operationName: "UnhideAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/unhide",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareUnhideRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ eventId: eventId!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Unhide",
+ methodName: "UnhideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/unhide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Unhide",
+ methodName: "UnhideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/unhide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Unhide",
+ methodName: "UnhideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/unhide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessUnhideResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Unhide",
+ methodName: "UnhideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/unhide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Unhide",
+ methodName: "UnhideAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}/unhide\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow unhiding events on this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias, session, or event not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessUnhideResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.g.cs
new file mode 100644
index 0000000..2003e58
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesEventsClient.g.cs
@@ -0,0 +1,139 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class AgentAliasesEventsClient : global::Vectara.IAgentAliasesEventsClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.vectara.io/";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator AutoSDKOAuth2State { get; set; } = new global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the AgentAliasesEventsClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesEventsClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesEventsClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesEventsClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesEventsClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesEventsClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Vectara.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Create2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Create2.g.cs
new file mode 100644
index 0000000..020ea15
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Create2.g.cs
@@ -0,0 +1,697 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Create2SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Create2SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_Create2SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_Create2SecurityRequirement0,
+ s_Create2SecurityRequirement1,
+ };
+ partial void PrepareCreate2Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ global::Vectara.CreateAgentSessionRequest request);
+ partial void PrepareCreate2Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ global::Vectara.CreateAgentSessionRequest request);
+ partial void ProcessCreate2Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessCreate2ResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Create session via alias
+ /// Create a new session by routing through an alias. The alias's policy is evaluated to pick the underlying agent that will own the session. Subsequent operations on the session can be addressed via this alias or directly via `/v2/agents/{resolved_agent_key}/sessions/{session_key}`.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// 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 Create2Async(
+ string aliasKey,
+
+ global::Vectara.CreateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await Create2AsResponseAsync(
+ aliasKey: aliasKey,
+
+ request: request,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create session via alias
+ /// Create a new session by routing through an alias. The alias's policy is evaluated to pick the underlying agent that will own the session. Subsequent operations on the session can be addressed via this alias or directly via `/v2/agents/{resolved_agent_key}/sessions/{session_key}`.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// 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> Create2AsResponseAsync(
+ string aliasKey,
+
+ global::Vectara.CreateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreate2Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_Create2SecurityRequirements,
+ operationName: "Create2Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreate2Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create2",
+ methodName: "Create2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create2",
+ methodName: "Create2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create2",
+ methodName: "Create2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreate2Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create2",
+ methodName: "Create2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Create2",
+ methodName: "Create2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Session creation request was malformed, or the alias's policy could not resolve against the session context.
+ if ((int)__response.StatusCode == 400)
+ {
+ string? __content_400 = null;
+ global::System.Exception? __exception_400 = null;
+ global::Vectara.BadRequestError? __value_400 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ else
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_400 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_400,
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Permissions do not allow creating sessions via this alias.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias not found or not currently active.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessCreate2ResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Create session via alias
+ /// Create a new session by routing through an alias. The alias's policy is evaluated to pick the underlying agent that will own the session. Subsequent operations on the session can be addressed via this alias or directly via `/v2/agents/{resolved_agent_key}/sessions/{session_key}`.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Human-readable name for the session.
+ /// Example: Customer Support Session
+ ///
+ ///
+ /// Optional description of the session purpose or context.
+ /// Example: Helping customer troubleshoot issues
+ ///
+ ///
+ /// Arbitrary metadata associated with the session.
+ /// Default Value: {}
+ /// Example: {"customer_id":"12345","priority":"medium","channel":"web_chat"}
+ ///
+ ///
+ /// Whether the session should be enabled upon creation.
+ /// Default Value: true
+ /// Example: true
+ ///
+ ///
+ /// Time-to-idle in minutes for the session. If no events occur in the session for this duration, the session will be automatically deleted. If set to 0, the session will not expire.
+ /// Default Value: 0
+ /// Example: 60
+ ///
+ ///
+ /// Session-scoped secrets to store on the new session. Map of secret name to plaintext value.
+ /// Encrypted at rest with the owning agent's encryption key. Referenced from tool `argument_override` via
+ /// `{"$ref": "session.secrets.<name>"}`. Returned masked (`****`) on reads.
+ /// Example: {"slack_user_token":"xoxp-your-token-here"}
+ ///
+ ///
+ /// Create a new session by forking an existing one. By default, copies all visible events
+ /// and artifacts from the source session without compaction. Optionally specify exactly one of
+ /// include_up_to_event_id or compact_up_to_event_id to control which events are included
+ /// and whether they are compacted. These two fields are mutually exclusive.
+ ///
+ /// 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 Create2Async(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? key = default,
+ string? name = default,
+ string? description = default,
+ object? metadata = default,
+ bool? enabled = default,
+ long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
+ global::Vectara.CreateAgentSessionRequestFromSession? fromSession = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Vectara.CreateAgentSessionRequest
+ {
+ Key = key,
+ Name = name,
+ Description = description,
+ Metadata = metadata,
+ Enabled = enabled,
+ TtiMinutes = ttiMinutes,
+ Secrets = secrets,
+ FromSession = fromSession,
+ };
+
+ return await Create2Async(
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.CreateInput.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.CreateInput.g.cs
new file mode 100644
index 0000000..9180277
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.CreateInput.g.cs
@@ -0,0 +1,623 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_CreateInputSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_CreateInputSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_CreateInputSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_CreateInputSecurityRequirement0,
+ s_CreateInputSecurityRequirement1,
+ };
+ partial void PrepareCreateInputArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ global::Vectara.CreateInputRequest request);
+ partial void PrepareCreateInputRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ global::Vectara.CreateInputRequest request);
+ partial void ProcessCreateInputResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessCreateInputResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Submit input to alias-routed session
+ /// Submit an input event to a session originally created via this alias. The session's resolved agent runs the loop.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 CreateInputAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.CreateInputRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateInputAsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+
+ request: request,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Submit input to alias-routed session
+ /// Submit an input event to a session originally created via this alias. The session's resolved agent runs the loop.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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> CreateInputAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.CreateInputRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreateInputArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_CreateInputSecurityRequirements,
+ operationName: "CreateInputAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreateInputRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInput",
+ methodName: "CreateInputAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInput",
+ methodName: "CreateInputAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInput",
+ methodName: "CreateInputAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreateInputResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInput",
+ methodName: "CreateInputAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInput",
+ methodName: "CreateInputAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Input request was malformed.
+ if ((int)__response.StatusCode == 400)
+ {
+ string? __content_400 = null;
+ global::System.Exception? __exception_400 = null;
+ global::Vectara.BadRequestError? __value_400 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ else
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_400 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_400,
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Permissions do not allow submitting input to this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias or session not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessCreateInputResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.CreateInputAsStream.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.CreateInputAsStream.g.cs
new file mode 100644
index 0000000..7fb24f0
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.CreateInputAsStream.g.cs
@@ -0,0 +1,437 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_CreateInputAsStreamSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_CreateInputAsStreamSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_CreateInputAsStreamSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_CreateInputAsStreamSecurityRequirement0,
+ s_CreateInputAsStreamSecurityRequirement1,
+ };
+ partial void PrepareCreateInputAsStreamArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ global::Vectara.CreateInputRequest request);
+ partial void PrepareCreateInputAsStreamRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ global::Vectara.CreateInputRequest request);
+ partial void ProcessCreateInputAsStreamResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ ///
+ /// Submit input to alias-routed session
+ /// Submit an input event to a session originally created via this alias. The session's resolved agent runs the loop.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 CreateInputAsStreamAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.CreateInputRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreateInputAsStreamArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_CreateInputAsStreamSecurityRequirements,
+ operationName: "CreateInputAsStreamAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreateInputAsStreamRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInputAsStream",
+ methodName: "CreateInputAsStreamAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInputAsStream",
+ methodName: "CreateInputAsStreamAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInputAsStream",
+ methodName: "CreateInputAsStreamAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreateInputAsStreamResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInputAsStream",
+ methodName: "CreateInputAsStreamAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateInputAsStream",
+ methodName: "CreateInputAsStreamAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ }
+ catch (global::System.Net.Http.HttpRequestException __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ using var __stream = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ await foreach (var __sseEvent in global::System.Net.ServerSentEvents.SseParser
+ .Create(__stream).EnumerateAsync(__effectiveCancellationToken))
+ {
+ var __content = __sseEvent.Data;
+ if (__content == "[DONE]")
+ {
+ yield break;
+ }
+
+ var __streamedResponse = global::Vectara.AgentStreamedResponse.FromJson(__content, JsonSerializerContext) ??
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: $"Response deserialization failed for \"{__content}\" ",
+ innerException: null,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+
+ yield return __streamedResponse;
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Delete2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Delete2.g.cs
new file mode 100644
index 0000000..c9d2e66
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Delete2.g.cs
@@ -0,0 +1,545 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Delete2SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Delete2SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_Delete2SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_Delete2SecurityRequirement0,
+ s_Delete2SecurityRequirement1,
+ };
+ partial void PrepareDelete2Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey);
+ partial void PrepareDelete2Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey);
+ partial void ProcessDelete2Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ ///
+ /// Delete alias-routed session
+ /// Delete a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// 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 Delete2Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await Delete2AsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete alias-routed session
+ /// Delete a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// 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 Delete2AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDelete2Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_Delete2SecurityRequirements,
+ operationName: "Delete2Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Delete,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDelete2Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete2",
+ methodName: "Delete2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete2",
+ methodName: "Delete2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete2",
+ methodName: "Delete2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDelete2Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete2",
+ methodName: "Delete2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Delete2",
+ methodName: "Delete2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow deleting this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias or session not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.DeleteEvent.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.DeleteEvent.g.cs
new file mode 100644
index 0000000..a220016
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.DeleteEvent.g.cs
@@ -0,0 +1,554 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_DeleteEventSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_DeleteEventSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_DeleteEventSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_DeleteEventSecurityRequirement0,
+ s_DeleteEventSecurityRequirement1,
+ };
+ partial void PrepareDeleteEventArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref string eventId);
+ partial void PrepareDeleteEventRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ string eventId);
+ partial void ProcessDeleteEventResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ ///
+ /// Delete event on alias-routed session
+ /// Delete a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 DeleteEventAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteEventAsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ eventId: eventId,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete event on alias-routed session
+ /// Delete a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 DeleteEventAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareDeleteEventArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ eventId: ref eventId);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_DeleteEventSecurityRequirements,
+ operationName: "DeleteEventAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Delete,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareDeleteEventRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ eventId: eventId!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeleteEvent",
+ methodName: "DeleteEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeleteEvent",
+ methodName: "DeleteEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeleteEvent",
+ methodName: "DeleteEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessDeleteEventResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeleteEvent",
+ methodName: "DeleteEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "DeleteEvent",
+ methodName: "DeleteEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "DELETE",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow deleting this event.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias, session, or event not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Get2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Get2.g.cs
new file mode 100644
index 0000000..8b79992
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Get2.g.cs
@@ -0,0 +1,568 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Get2SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Get2SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_Get2SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_Get2SecurityRequirement0,
+ s_Get2SecurityRequirement1,
+ };
+ partial void PrepareGet2Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey);
+ partial void PrepareGet2Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey);
+ partial void ProcessGet2Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessGet2ResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get alias-routed session
+ /// Retrieve a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// 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 Get2Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await Get2AsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get alias-routed session
+ /// Retrieve a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// 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> Get2AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareGet2Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_Get2SecurityRequirements,
+ operationName: "Get2Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareGet2Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get2",
+ methodName: "Get2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get2",
+ methodName: "Get2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get2",
+ methodName: "Get2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessGet2Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get2",
+ methodName: "Get2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Get2",
+ methodName: "Get2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow accessing this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias or session not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessGet2ResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.GetEvent.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.GetEvent.g.cs
new file mode 100644
index 0000000..5c5a34a
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.GetEvent.g.cs
@@ -0,0 +1,577 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_GetEventSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_GetEventSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_GetEventSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_GetEventSecurityRequirement0,
+ s_GetEventSecurityRequirement1,
+ };
+ partial void PrepareGetEventArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref string eventId);
+ partial void PrepareGetEventRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ string eventId);
+ partial void ProcessGetEventResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessGetEventResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Get event on alias-routed session
+ /// Get a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 GetEventAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetEventAsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ eventId: eventId,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get event on alias-routed session
+ /// Get a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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> GetEventAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareGetEventArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ eventId: ref eventId);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_GetEventSecurityRequirements,
+ operationName: "GetEventAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareGetEventRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ eventId: eventId!);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "GetEvent",
+ methodName: "GetEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "GetEvent",
+ methodName: "GetEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "GetEvent",
+ methodName: "GetEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessGetEventResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "GetEvent",
+ methodName: "GetEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "GetEvent",
+ methodName: "GetEventAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events/{eventId}\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow accessing this event.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias, session, or event not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessGetEventResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentEvent.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.List2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.List2.g.cs
new file mode 100644
index 0000000..a13cefe
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.List2.g.cs
@@ -0,0 +1,589 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_List2SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_List2SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_List2SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_List2SecurityRequirement0,
+ s_List2SecurityRequirement1,
+ };
+ partial void PrepareList2Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string? filter,
+ ref int? limit,
+ ref string? pageKey);
+ partial void PrepareList2Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string? filter,
+ int? limit,
+ string? pageKey);
+ partial void ProcessList2Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessList2ResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List sessions routed via this alias
+ /// List sessions that were originally created via this alias (sessions whose `alias_key` matches). Sessions are also reachable under their resolved agent's URL; this endpoint is the alias-scoped view.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// 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 List2Async(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? filter = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await List2AsResponseAsync(
+ aliasKey: aliasKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ filter: filter,
+ limit: limit,
+ pageKey: pageKey,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List sessions routed via this alias
+ /// List sessions that were originally created via this alias (sessions whose `alias_key` matches). Sessions are also reachable under their resolved agent's URL; this endpoint is the alias-scoped view.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// 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> List2AsResponseAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? filter = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareList2Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ filter: ref filter,
+ limit: ref limit,
+ pageKey: ref pageKey);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_List2SecurityRequirements,
+ operationName: "List2Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions",
+ baseUri: HttpClient.BaseAddress);
+ __pathBuilder
+ .AddOptionalParameter("filter", filter)
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("page_key", pageKey)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareList2Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ filter: filter,
+ limit: limit,
+ pageKey: pageKey);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List2",
+ methodName: "List2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List2",
+ methodName: "List2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List2",
+ methodName: "List2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessList2Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List2",
+ methodName: "List2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "List2",
+ methodName: "List2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow listing alias-routed sessions.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessList2ResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.ListAgentSessionsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.ListAgentSessionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.ListEvents.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.ListEvents.g.cs
new file mode 100644
index 0000000..85814b3
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.ListEvents.g.cs
@@ -0,0 +1,594 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_ListEventsSecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_ListEventsSecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_ListEventsSecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_ListEventsSecurityRequirement0,
+ s_ListEventsSecurityRequirement1,
+ };
+ partial void PrepareListEventsArguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ ref int? limit,
+ ref string? pageKey);
+ partial void PrepareListEventsRequest(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ int? limit,
+ string? pageKey);
+ partial void ProcessListEventsResponse(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessListEventsResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// List events on alias-routed session
+ /// List events of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// 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 ListEventsAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListEventsAsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ limit: limit,
+ pageKey: pageKey,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List events on alias-routed session
+ /// List events of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// 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> ListEventsAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ PrepareArguments(
+ client: HttpClient);
+ PrepareListEventsArguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ limit: ref limit,
+ pageKey: ref pageKey);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_ListEventsSecurityRequirements,
+ operationName: "ListEventsAsync");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events",
+ baseUri: HttpClient.BaseAddress);
+ __pathBuilder
+ .AddOptionalParameter("limit", limit?.ToString())
+ .AddOptionalParameter("page_key", pageKey)
+ ;
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Get,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareListEventsRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ limit: limit,
+ pageKey: pageKey);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ListEvents",
+ methodName: "ListEventsAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ListEvents",
+ methodName: "ListEventsAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ListEvents",
+ methodName: "ListEventsAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessListEventsResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ListEvents",
+ methodName: "ListEventsAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "ListEvents",
+ methodName: "ListEventsAsync",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}/events\"",
+ httpMethod: "GET",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Permissions do not allow listing events on this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias or session not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessListEventsResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.ListAgentEventsResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.ListAgentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Update2.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Update2.g.cs
new file mode 100644
index 0000000..2c3f620
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.Update2.g.cs
@@ -0,0 +1,700 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ public partial class AgentAliasesSessionsClient
+ {
+
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Update2SecurityRequirement0 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "ApiKey",
+ SchemeId = "ApiKeyAuth",
+ Location = "Header",
+ Name = "x-api-key",
+ FriendlyName = "ApiKeyInHeader",
+ },
+ },
+ };
+
+ private static readonly global::Vectara.EndPointSecurityRequirement s_Update2SecurityRequirement1 =
+ new global::Vectara.EndPointSecurityRequirement
+ {
+ Authorizations = new global::Vectara.EndPointAuthorizationRequirement[]
+ { new global::Vectara.EndPointAuthorizationRequirement
+ {
+ Type = "OAuth2",
+ SchemeId = "OAuth2",
+ Location = "Header",
+ Name = "",
+ FriendlyName = "OAuth2",
+ },
+ },
+ };
+ private static readonly global::Vectara.EndPointSecurityRequirement[] s_Update2SecurityRequirements =
+ new global::Vectara.EndPointSecurityRequirement[]
+ { s_Update2SecurityRequirement0,
+ s_Update2SecurityRequirement1,
+ };
+ partial void PrepareUpdate2Arguments(
+ global::System.Net.Http.HttpClient httpClient,
+ ref int? requestTimeout,
+ ref int? requestTimeoutMillis,
+ ref string aliasKey,
+ ref string sessionKey,
+ global::Vectara.UpdateAgentSessionRequest request);
+ partial void PrepareUpdate2Request(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpRequestMessage httpRequestMessage,
+ int? requestTimeout,
+ int? requestTimeoutMillis,
+ string aliasKey,
+ string sessionKey,
+ global::Vectara.UpdateAgentSessionRequest request);
+ partial void ProcessUpdate2Response(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage);
+
+ partial void ProcessUpdate2ResponseContent(
+ global::System.Net.Http.HttpClient httpClient,
+ global::System.Net.Http.HttpResponseMessage httpResponseMessage,
+ ref string content);
+
+ ///
+ /// Update alias-routed session
+ /// Update a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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 Update2Async(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.UpdateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await Update2AsResponseAsync(
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+
+ request: request,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update alias-routed session
+ /// Update a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// 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> Update2AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.UpdateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ request = request ?? throw new global::System.ArgumentNullException(nameof(request));
+
+ PrepareArguments(
+ client: HttpClient);
+ PrepareUpdate2Arguments(
+ httpClient: HttpClient,
+ requestTimeout: ref requestTimeout,
+ requestTimeoutMillis: ref requestTimeoutMillis,
+ aliasKey: ref aliasKey,
+ sessionKey: ref sessionKey,
+ request: request);
+
+
+ var __authorizations = global::Vectara.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_Update2SecurityRequirements,
+ operationName: "Update2Async");
+
+ using var __timeoutCancellationTokenSource = global::Vectara.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Vectara.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Vectara.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: true);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Vectara.PathBuilder(
+ path: $"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Vectara.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: new global::System.Net.Http.HttpMethod("PATCH"),
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ if (requestTimeout != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout", requestTimeout.ToString());
+ }
+ if (requestTimeoutMillis != default)
+ {
+ __httpRequest.Headers.TryAddWithoutValidation("Request-Timeout-Millis", requestTimeoutMillis.ToString());
+ }
+
+ var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
+ var __httpRequestContent = new global::System.Net.Http.StringContent(
+ content: __httpRequestContentBody,
+ encoding: global::System.Text.Encoding.UTF8,
+ mediaType: "application/json");
+ __httpRequest.Content = __httpRequestContent;
+ global::Vectara.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareUpdate2Request(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey!,
+ sessionKey: sessionKey!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update2",
+ methodName: "Update2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await global::Vectara.VectaraClient.AutoSDKOAuth2Helpers.SendAsync(
+ httpClient: HttpClient,
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ authorizations: __authorizations,
+ oAuth2Coordinator: AutoSDKOAuth2State,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update2",
+ methodName: "Update2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Vectara.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Vectara.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update2",
+ methodName: "Update2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ 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::Vectara.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessUpdate2Response(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update2",
+ methodName: "Update2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Vectara.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Vectara.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "Update2",
+ methodName: "Update2Async",
+ pathTemplate: "$\"/v2/agent_aliases/{aliasKey}/sessions/{sessionKey}\"",
+ httpMethod: "PATCH",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Update request was malformed.
+ if ((int)__response.StatusCode == 400)
+ {
+ string? __content_400 = null;
+ global::System.Exception? __exception_400 = null;
+ global::Vectara.BadRequestError? __value_400 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ else
+ {
+ __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_400 = global::Vectara.BadRequestError.FromJson(__content_400, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_400 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_400,
+ responseBody: __content_400,
+ responseObject: __value_400,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Permissions do not allow updating this session.
+ if ((int)__response.StatusCode == 403)
+ {
+ string? __content_403 = null;
+ global::System.Exception? __exception_403 = null;
+ global::Vectara.Error? __value_403 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ else
+ {
+ __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_403 = global::Vectara.Error.FromJson(__content_403, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_403 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_403,
+ responseBody: __content_403,
+ responseObject: __value_403,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ // Alias or session not found.
+ if ((int)__response.StatusCode == 404)
+ {
+ string? __content_404 = null;
+ global::System.Exception? __exception_404 = null;
+ global::Vectara.NotFoundError? __value_404 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ else
+ {
+ __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_404 = global::Vectara.NotFoundError.FromJson(__content_404, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_404 = __ex;
+ }
+
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_404,
+ responseBody: __content_404,
+ responseObject: __value_404,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessUpdate2ResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Vectara.AgentSession.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Vectara.AgentSession.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Vectara.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Vectara.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw global::Vectara.ApiException.Create(
+ statusCode: __response.StatusCode,
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ responseBody: __content,
+ responseHeaders: global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value));
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Update alias-routed session
+ /// Update a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Human-readable name for the session.
+ /// Example: Updated Session Name
+ ///
+ ///
+ /// Optional description of the session purpose or context.
+ /// Example: Updated session description
+ ///
+ ///
+ /// Arbitrary metadata associated with the session.
+ /// Example: {"customer_id":"12345","priority":"high","status":"escalated"}
+ ///
+ ///
+ /// Whether the session is enabled.
+ /// Example: false
+ ///
+ ///
+ /// Time-to-idle in minutes for the session. If no events occur in the session for this duration, the session will be automatically deleted. If set to 0, the session will not expire.
+ /// Example: 60
+ ///
+ ///
+ /// Patch the session's secrets. Names present in the map are added or replaced; names absent from the map are left unchanged.
+ /// A name mapped to `null` is removed. Values are encrypted at rest with the owning agent's encryption key and returned masked on reads.
+ /// Example: {"slack_user_token":"xoxp-rotated-token","old_token_to_remove":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464"}
+ ///
+ /// 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 Update2Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? name = default,
+ string? description = default,
+ object? metadata = default,
+ bool? enabled = default,
+ long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __request = new global::Vectara.UpdateAgentSessionRequest
+ {
+ Name = name,
+ Description = description,
+ Metadata = metadata,
+ Enabled = enabled,
+ TtiMinutes = ttiMinutes,
+ Secrets = secrets,
+ };
+
+ return await Update2Async(
+ requestTimeout: requestTimeout,
+ requestTimeoutMillis: requestTimeoutMillis,
+ aliasKey: aliasKey,
+ sessionKey: sessionKey,
+ request: __request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.g.cs b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.g.cs
new file mode 100644
index 0000000..30a7ad4
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.AgentAliasesSessionsClient.g.cs
@@ -0,0 +1,139 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public sealed partial class AgentAliasesSessionsClient : global::Vectara.IAgentAliasesSessionsClient, global::System.IDisposable
+ {
+ ///
+ ///
+ ///
+ public const string DefaultBaseUrl = "https://api.vectara.io/";
+
+ private bool _disposeHttpClient = true;
+
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ public System.Uri? BaseUri => HttpClient.BaseAddress;
+
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ public bool ReadResponseAsString { get; set; }
+#if DEBUG
+ = true;
+#endif
+
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ internal global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator AutoSDKOAuth2State { get; set; } = new global::Vectara.VectaraClient.AutoSDKOAuth2Coordinator();
+ ///
+ ///
+ ///
+ public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Vectara.SourceGenerationContext.Default;
+
+
+ ///
+ /// Creates a new instance of the AgentAliasesSessionsClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesSessionsClient(
+ global::System.Net.Http.HttpClient? httpClient = null,
+ global::System.Uri? baseUri = null,
+ global::System.Collections.Generic.List? authorizations = null,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri,
+ authorizations,
+ options: null,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesSessionsClient with explicit options but no base URL override.
+ /// Skips passing baseUri so the default base URL from the OpenAPI spec applies.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesSessionsClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true) : this(
+ httpClient,
+ baseUri: null,
+ authorizations,
+ options,
+ disposeHttpClient: disposeHttpClient)
+ {
+ }
+
+ ///
+ /// Creates a new instance of the AgentAliasesSessionsClient.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ /// The HttpClient instance. If not provided, a new one will be created.
+ /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used.
+ /// The authorizations to use for the requests.
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ /// Dispose the HttpClient when the instance is disposed. True by default.
+ public AgentAliasesSessionsClient(
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Vectara.AutoSDKClientOptions? options,
+ bool disposeHttpClient = true)
+ {
+
+ HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
+ HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl);
+ Authorizations = authorizations ?? new global::System.Collections.Generic.List();
+ Options = options ?? new global::Vectara.AutoSDKClientOptions();
+ _disposeHttpClient = disposeHttpClient;
+
+ Initialized(HttpClient);
+ }
+
+ ///
+ public void Dispose()
+ {
+ if (_disposeHttpClient)
+ {
+ HttpClient.Dispose();
+ }
+ }
+
+ partial void Initialized(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareArguments(
+ global::System.Net.Http.HttpClient client);
+ partial void PrepareRequest(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpRequestMessage request);
+ partial void ProcessResponse(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response);
+ partial void ProcessResponseContent(
+ global::System.Net.Http.HttpClient client,
+ global::System.Net.Http.HttpResponseMessage response,
+ ref string content);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs
index 5667c5d..5432ce5 100644
--- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs
+++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Create.g.cs
@@ -694,6 +694,12 @@ partial void ProcessCreateResponseContent(
/// Default Value: 0
/// Example: 60
///
+ ///
+ /// Session-scoped secrets to store on the new session. Map of secret name to plaintext value.
+ /// Encrypted at rest with the owning agent's encryption key. Referenced from tool `argument_override` via
+ /// `{"$ref": "session.secrets.<name>"}`. Returned masked (`****`) on reads.
+ /// Example: {"slack_user_token":"xoxp-your-token-here"}
+ ///
///
/// Create a new session by forking an existing one. By default, copies all visible events
/// and artifacts from the source session without compaction. Optionally specify exactly one of
@@ -713,6 +719,7 @@ partial void ProcessCreateResponseContent(
object? metadata = default,
bool? enabled = default,
long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
global::Vectara.CreateAgentSessionRequestFromSession? fromSession = default,
global::Vectara.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -725,6 +732,7 @@ partial void ProcessCreateResponseContent(
Metadata = metadata,
Enabled = enabled,
TtiMinutes = ttiMinutes,
+ Secrets = secrets,
FromSession = fromSession,
};
diff --git a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs
index 1469167..13d6a85 100644
--- a/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs
+++ b/src/libs/Vectara/Generated/Vectara.AgentSessionsClient.Update.g.cs
@@ -658,6 +658,11 @@ partial void ProcessUpdateResponseContent(
/// Time-to-idle in minutes for the session. If no events occur in the session for this duration, the session will be automatically deleted. If set to 0, the session will not expire.
/// Example: 60
///
+ ///
+ /// Patch the session's secrets. Names present in the map are added or replaced; names absent from the map are left unchanged.
+ /// A name mapped to `null` is removed. Values are encrypted at rest with the owning agent's encryption key and returned masked on reads.
+ /// Example: {"slack_user_token":"xoxp-rotated-token","old_token_to_remove":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464"}
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -671,6 +676,7 @@ partial void ProcessUpdateResponseContent(
object? metadata = default,
bool? enabled = default,
long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
global::Vectara.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
@@ -681,6 +687,7 @@ partial void ProcessUpdateResponseContent(
Metadata = metadata,
Enabled = enabled,
TtiMinutes = ttiMinutes,
+ Secrets = secrets,
};
return await UpdateAsync(
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.Get3.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.Get3.g.cs
new file mode 100644
index 0000000..5fd0f37
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.Get3.g.cs
@@ -0,0 +1,64 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesArtifactsClient
+ {
+ ///
+ /// Get artifact on alias-routed session
+ /// Retrieve an artifact stored in a session originally created via this alias, including metadata and base64-encoded file content.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Example: art_report_pdf_a3f2
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Get3Async(
+ string aliasKey,
+ string sessionKey,
+ string artifactId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Get artifact on alias-routed session
+ /// Retrieve an artifact stored in a session originally created via this alias, including metadata and base64-encoded file content.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Example: art_report_pdf_a3f2
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> Get3AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string artifactId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.List3.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.List3.g.cs
new file mode 100644
index 0000000..1fb29ae
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.List3.g.cs
@@ -0,0 +1,84 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesArtifactsClient
+ {
+ ///
+ /// List artifacts on alias-routed session
+ /// List artifacts stored in a session originally created via this alias. Artifacts are files either uploaded by the user, or generated within the session.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Default Value: created_at
+ ///
+ ///
+ /// Default Value: desc
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task List3Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsSortBy? sortBy = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsOrderBy? orderBy = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// List artifacts on alias-routed session
+ /// List artifacts stored in a session originally created via this alias. Artifacts are files either uploaded by the user, or generated within the session.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Default Value: created_at
+ ///
+ ///
+ /// Default Value: desc
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> List3AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsSortBy? sortBy = default,
+ global::Vectara.ListAliasRoutedSessionArtifactsOrderBy? orderBy = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.g.cs
new file mode 100644
index 0000000..de661ee
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesArtifactsClient.g.cs
@@ -0,0 +1,48 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public partial interface IAgentAliasesArtifactsClient : global::System.IDisposable
+ {
+ ///
+ /// The HttpClient instance.
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ /// The base URL for the API.
+ ///
+ public System.Uri? BaseUri { get; }
+
+ ///
+ /// The authorizations to use for the requests.
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the response content should be read as a string.
+ /// True by default in debug builds, false otherwise.
+ /// When false, successful responses are deserialized directly from the response stream for better performance.
+ /// Error responses are always read as strings regardless of this setting,
+ /// ensuring is populated.
+ ///
+ public bool ReadResponseAsString { get; set; }
+ ///
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ ///
+ ///
+ ///
+ global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Create.g.cs
new file mode 100644
index 0000000..76389ee
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Create.g.cs
@@ -0,0 +1,89 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesClient
+ {
+ ///
+ /// Create an alias
+ /// Create a new alias. Aliases are routing primitives that map a public name to one or more underlying agents under a configurable policy. When a session is created through an alias (via `POST /v2/agent_aliases/{alias_key}/sessions`), the alias's policy decides which underlying agent runs that session.
+ /// Common patterns:
+ /// - **Direct alias** — a `routed` policy with one rule and one target. Identical in behavior to invoking the agent directly.
+ /// - **Canary rollout** — a `routed` policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
+ /// - **Tenant routing** — a `routed` policy with multiple rules, each matching on session metadata (e.g. `session.metadata.tenant`).
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task CreateAsync(
+
+ global::Vectara.CreateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Create an alias
+ /// Create a new alias. Aliases are routing primitives that map a public name to one or more underlying agents under a configurable policy. When a session is created through an alias (via `POST /v2/agent_aliases/{alias_key}/sessions`), the alias's policy decides which underlying agent runs that session.
+ /// Common patterns:
+ /// - **Direct alias** — a `routed` policy with one rule and one target. Identical in behavior to invoking the agent directly.
+ /// - **Canary rollout** — a `routed` policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
+ /// - **Tenant routing** — a `routed` policy with multiple rules, each matching on session metadata (e.g. `session.metadata.tenant`).
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> CreateAsResponseAsync(
+
+ global::Vectara.CreateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Create an alias
+ /// Create a new alias. Aliases are routing primitives that map a public name to one or more underlying agents under a configurable policy. When a session is created through an alias (via `POST /v2/agent_aliases/{alias_key}/sessions`), the alias's policy decides which underlying agent runs that session.
+ /// Common patterns:
+ /// - **Direct alias** — a `routed` policy with one rule and one target. Identical in behavior to invoking the agent directly.
+ /// - **Canary rollout** — a `routed` policy with one rule and multiple weighted targets (e.g. 90% v1, 10% v2).
+ /// - **Tenant routing** — a `routed` policy with multiple rules, each matching on session metadata (e.g. `session.metadata.tenant`).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ ///
+ /// A routing policy. The `type` discriminator determines which fields apply:
+ /// * `routed` — evaluate ordered rules; the first rule whose `match` expression evaluates to true is selected. The selected rule's `targets` are then used (one agent for `single`, hashed by `partition_by` for `weighted`). Rules with omitted `match` are catch-all rules (typically last).
+ /// Most use cases (direct, weighted/canary, conditional, conditional+canary) collapse into `routed`.
+ ///
+ ///
+ /// Default Value: true
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task CreateAsync(
+ string key,
+ string name,
+ global::Vectara.RoutedAliasPolicy policy,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? description = default,
+ bool? enabled = default,
+ object? metadata = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Delete.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Delete.g.cs
new file mode 100644
index 0000000..f0e92e2
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Delete.g.cs
@@ -0,0 +1,46 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesClient
+ {
+ ///
+ /// Delete an alias
+ /// Delete an alias. The underlying agents the alias points at are not affected. Returns 409 if any live resources still reference this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task DeleteAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Delete an alias
+ /// Delete an alias. The underlying agents the alias points at are not affected. Returns 409 if any live resources still reference this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task DeleteAsResponseAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Get.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Get.g.cs
new file mode 100644
index 0000000..df2132a
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Get.g.cs
@@ -0,0 +1,46 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesClient
+ {
+ ///
+ /// Get an alias
+ /// Retrieve a specific alias including its policy.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task GetAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Get an alias
+ /// Retrieve a specific alias including its policy.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> GetAsResponseAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.List.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.List.g.cs
new file mode 100644
index 0000000..ff4d280
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.List.g.cs
@@ -0,0 +1,64 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesClient
+ {
+ ///
+ /// List aliases
+ /// List all aliases owned by the current customer.
+ ///
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Example: support.*
+ ///
+ ///
+ /// Example: true
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task ListAsync(
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ string? filter = default,
+ bool? enabled = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// List aliases
+ /// List all aliases owned by the current customer.
+ ///
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ ///
+ /// Example: support.*
+ ///
+ ///
+ /// Example: true
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> ListAsResponseAsync(
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ string? filter = default,
+ bool? enabled = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.ReplacePolicy.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.ReplacePolicy.g.cs
new file mode 100644
index 0000000..101c81d
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.ReplacePolicy.g.cs
@@ -0,0 +1,80 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesClient
+ {
+ ///
+ /// Replace an alias's routing policy
+ /// Atomically replace the alias's routing policy and stickiness configuration. Replacement is whole-object; partial merging is not supported.
+ /// Use this endpoint to flip canary weights, change tenant routing, etc. The change is atomic: in-flight sessions resolved before the change keep their resolved agent (resolution is once-at-creation).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task ReplacePolicyAsync(
+ string aliasKey,
+
+ global::Vectara.ReplaceAliasPolicyRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Replace an alias's routing policy
+ /// Atomically replace the alias's routing policy and stickiness configuration. Replacement is whole-object; partial merging is not supported.
+ /// Use this endpoint to flip canary weights, change tenant routing, etc. The change is atomic: in-flight sessions resolved before the change keep their resolved agent (resolution is once-at-creation).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> ReplacePolicyAsResponseAsync(
+ string aliasKey,
+
+ global::Vectara.ReplaceAliasPolicyRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Replace an alias's routing policy
+ /// Atomically replace the alias's routing policy and stickiness configuration. Replacement is whole-object; partial merging is not supported.
+ /// Use this endpoint to flip canary weights, change tenant routing, etc. The change is atomic: in-flight sessions resolved before the change keep their resolved agent (resolution is once-at-creation).
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A routing policy. The `type` discriminator determines which fields apply:
+ /// * `routed` — evaluate ordered rules; the first rule whose `match` expression evaluates to true is selected. The selected rule's `targets` are then used (one agent for `single`, hashed by `partition_by` for `weighted`). Rules with omitted `match` are catch-all rules (typically last).
+ /// Most use cases (direct, weighted/canary, conditional, conditional+canary) collapse into `routed`.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task ReplacePolicyAsync(
+ string aliasKey,
+ global::Vectara.RoutedAliasPolicy policy,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Update.g.cs
new file mode 100644
index 0000000..bffb774
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.Update.g.cs
@@ -0,0 +1,79 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesClient
+ {
+ ///
+ /// Update an alias's metadata
+ /// Update an alias's metadata fields (name, description, enabled, metadata). To replace the routing policy, use `PUT /v2/agent_aliases/{alias_key}/policy` — policies are atomic and not partially updatable.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task UpdateAsync(
+ string aliasKey,
+
+ global::Vectara.UpdateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Update an alias's metadata
+ /// Update an alias's metadata fields (name, description, enabled, metadata). To replace the routing policy, use `PUT /v2/agent_aliases/{alias_key}/policy` — policies are atomic and not partially updatable.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> UpdateAsResponseAsync(
+ string aliasKey,
+
+ global::Vectara.UpdateAgentAliasRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Update an alias's metadata
+ /// Update an alias's metadata fields (name, description, enabled, metadata). To replace the routing policy, use `PUT /v2/agent_aliases/{alias_key}/policy` — policies are atomic and not partially updatable.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task UpdateAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? name = default,
+ string? description = default,
+ bool? enabled = default,
+ object? metadata = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.g.cs
new file mode 100644
index 0000000..7335dd1
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesClient.g.cs
@@ -0,0 +1,48 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public partial interface IAgentAliasesClient : global::System.IDisposable
+ {
+ ///
+ /// The HttpClient instance.
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ /// The base URL for the API.
+ ///
+ public System.Uri? BaseUri { get; }
+
+ ///
+ /// The authorizations to use for the requests.
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the response content should be read as a string.
+ /// True by default in debug builds, false otherwise.
+ /// When false, successful responses are deserialized directly from the response stream for better performance.
+ /// Error responses are always read as strings regardless of this setting,
+ /// ensuring is populated.
+ ///
+ public bool ReadResponseAsString { get; set; }
+ ///
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ ///
+ ///
+ ///
+ global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.Hide.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.Hide.g.cs
new file mode 100644
index 0000000..7039f9d
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.Hide.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesEventsClient
+ {
+ ///
+ /// Hide event on alias-routed session
+ /// Manually hide an event on a session originally created via this alias. Sets hide_reason to 'manual'.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task HideAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Hide event on alias-routed session
+ /// Manually hide an event on a session originally created via this alias. Sets hide_reason to 'manual'.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> HideAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.Unhide.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.Unhide.g.cs
new file mode 100644
index 0000000..e088665
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.Unhide.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesEventsClient
+ {
+ ///
+ /// Unhide event on alias-routed session
+ /// Unhide a hidden event on a session originally created via this alias. Clears the hide_reason.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task UnhideAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Unhide event on alias-routed session
+ /// Unhide a hidden event on a session originally created via this alias. Clears the hide_reason.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> UnhideAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.g.cs
new file mode 100644
index 0000000..9c60cdc
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesEventsClient.g.cs
@@ -0,0 +1,48 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public partial interface IAgentAliasesEventsClient : global::System.IDisposable
+ {
+ ///
+ /// The HttpClient instance.
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ /// The base URL for the API.
+ ///
+ public System.Uri? BaseUri { get; }
+
+ ///
+ /// The authorizations to use for the requests.
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the response content should be read as a string.
+ /// True by default in debug builds, false otherwise.
+ /// When false, successful responses are deserialized directly from the response stream for better performance.
+ /// Error responses are always read as strings regardless of this setting,
+ /// ensuring is populated.
+ ///
+ public bool ReadResponseAsString { get; set; }
+ ///
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ ///
+ ///
+ ///
+ global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Create2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Create2.g.cs
new file mode 100644
index 0000000..45107d9
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Create2.g.cs
@@ -0,0 +1,118 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Create session via alias
+ /// Create a new session by routing through an alias. The alias's policy is evaluated to pick the underlying agent that will own the session. Subsequent operations on the session can be addressed via this alias or directly via `/v2/agents/{resolved_agent_key}/sessions/{session_key}`.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Create2Async(
+ string aliasKey,
+
+ global::Vectara.CreateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Create session via alias
+ /// Create a new session by routing through an alias. The alias's policy is evaluated to pick the underlying agent that will own the session. Subsequent operations on the session can be addressed via this alias or directly via `/v2/agents/{resolved_agent_key}/sessions/{session_key}`.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> Create2AsResponseAsync(
+ string aliasKey,
+
+ global::Vectara.CreateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Create session via alias
+ /// Create a new session by routing through an alias. The alias's policy is evaluated to pick the underlying agent that will own the session. Subsequent operations on the session can be addressed via this alias or directly via `/v2/agents/{resolved_agent_key}/sessions/{session_key}`.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Human-readable name for the session.
+ /// Example: Customer Support Session
+ ///
+ ///
+ /// Optional description of the session purpose or context.
+ /// Example: Helping customer troubleshoot issues
+ ///
+ ///
+ /// Arbitrary metadata associated with the session.
+ /// Default Value: {}
+ /// Example: {"customer_id":"12345","priority":"medium","channel":"web_chat"}
+ ///
+ ///
+ /// Whether the session should be enabled upon creation.
+ /// Default Value: true
+ /// Example: true
+ ///
+ ///
+ /// Time-to-idle in minutes for the session. If no events occur in the session for this duration, the session will be automatically deleted. If set to 0, the session will not expire.
+ /// Default Value: 0
+ /// Example: 60
+ ///
+ ///
+ /// Session-scoped secrets to store on the new session. Map of secret name to plaintext value.
+ /// Encrypted at rest with the owning agent's encryption key. Referenced from tool `argument_override` via
+ /// `{"$ref": "session.secrets.<name>"}`. Returned masked (`****`) on reads.
+ /// Example: {"slack_user_token":"xoxp-your-token-here"}
+ ///
+ ///
+ /// Create a new session by forking an existing one. By default, copies all visible events
+ /// and artifacts from the source session without compaction. Optionally specify exactly one of
+ /// include_up_to_event_id or compact_up_to_event_id to control which events are included
+ /// and whether they are compacted. These two fields are mutually exclusive.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Create2Async(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? key = default,
+ string? name = default,
+ string? description = default,
+ object? metadata = default,
+ bool? enabled = default,
+ long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
+ global::Vectara.CreateAgentSessionRequestFromSession? fromSession = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.CreateInput.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.CreateInput.g.cs
new file mode 100644
index 0000000..4882bb6
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.CreateInput.g.cs
@@ -0,0 +1,62 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Submit input to alias-routed session
+ /// Submit an input event to a session originally created via this alias. The session's resolved agent runs the loop.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task CreateInputAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.CreateInputRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Submit input to alias-routed session
+ /// Submit an input event to a session originally created via this alias. The session's resolved agent runs the loop.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> CreateInputAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.CreateInputRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.CreateInputAsStream.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.CreateInputAsStream.g.cs
new file mode 100644
index 0000000..595c106
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.CreateInputAsStream.g.cs
@@ -0,0 +1,35 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Submit input to alias-routed session
+ /// Submit an input event to a session originally created via this alias. The session's resolved agent runs the loop.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Collections.Generic.IAsyncEnumerable CreateInputAsStreamAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.CreateInputRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Delete2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Delete2.g.cs
new file mode 100644
index 0000000..e441046
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Delete2.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Delete alias-routed session
+ /// Delete a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Delete2Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Delete alias-routed session
+ /// Delete a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Delete2AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.DeleteEvent.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.DeleteEvent.g.cs
new file mode 100644
index 0000000..a69dbdf
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.DeleteEvent.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Delete event on alias-routed session
+ /// Delete a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task DeleteEventAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Delete event on alias-routed session
+ /// Delete a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task DeleteEventAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Get2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Get2.g.cs
new file mode 100644
index 0000000..614213d
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Get2.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Get alias-routed session
+ /// Retrieve a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Get2Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Get alias-routed session
+ /// Retrieve a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> Get2AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.GetEvent.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.GetEvent.g.cs
new file mode 100644
index 0000000..23c8e21
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.GetEvent.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Get event on alias-routed session
+ /// Get a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task GetEventAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Get event on alias-routed session
+ /// Get a single event of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> GetEventAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ string eventId,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.List2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.List2.g.cs
new file mode 100644
index 0000000..c5233ae
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.List2.g.cs
@@ -0,0 +1,62 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// List sessions routed via this alias
+ /// List sessions that were originally created via this alias (sessions whose `alias_key` matches). Sessions are also reachable under their resolved agent's URL; this endpoint is the alias-scoped view.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task List2Async(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? filter = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// List sessions routed via this alias
+ /// List sessions that were originally created via this alias (sessions whose `alias_key` matches). Sessions are also reachable under their resolved agent's URL; this endpoint is the alias-scoped view.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> List2AsResponseAsync(
+ string aliasKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? filter = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.ListEvents.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.ListEvents.g.cs
new file mode 100644
index 0000000..f58425d
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.ListEvents.g.cs
@@ -0,0 +1,68 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// List events on alias-routed session
+ /// List events of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task ListEventsAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// List events on alias-routed session
+ /// List events of a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Default Value: 10
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> ListEventsAsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ int? limit = default,
+ string? pageKey = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Update2.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Update2.g.cs
new file mode 100644
index 0000000..34347ec
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.Update2.g.cs
@@ -0,0 +1,117 @@
+#nullable enable
+
+namespace Vectara
+{
+ public partial interface IAgentAliasesSessionsClient
+ {
+ ///
+ /// Update alias-routed session
+ /// Update a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Update2Async(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.UpdateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Update alias-routed session
+ /// Update a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task> Update2AsResponseAsync(
+ string aliasKey,
+ string sessionKey,
+
+ global::Vectara.UpdateAgentSessionRequest request,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ ///
+ /// Update alias-routed session
+ /// Update a session originally created via this alias.
+ ///
+ ///
+ ///
+ ///
+ /// The unique key identifying an alias. Alias keys are independent of agent keys — the same string may exist as both an alias and an agent in a customer; calls to `/v2/agent_aliases/{key}/...` target the alias and calls to `/v2/agents/{key}/...` target the agent.
+ /// Example: support
+ ///
+ ///
+ /// A unique key that identifies an agent session.
+ /// Example: customer_support_chat
+ ///
+ ///
+ /// Human-readable name for the session.
+ /// Example: Updated Session Name
+ ///
+ ///
+ /// Optional description of the session purpose or context.
+ /// Example: Updated session description
+ ///
+ ///
+ /// Arbitrary metadata associated with the session.
+ /// Example: {"customer_id":"12345","priority":"high","status":"escalated"}
+ ///
+ ///
+ /// Whether the session is enabled.
+ /// Example: false
+ ///
+ ///
+ /// Time-to-idle in minutes for the session. If no events occur in the session for this duration, the session will be automatically deleted. If set to 0, the session will not expire.
+ /// Example: 60
+ ///
+ ///
+ /// Patch the session's secrets. Names present in the map are added or replaced; names absent from the map are left unchanged.
+ /// A name mapped to `null` is removed. Values are encrypted at rest with the owning agent's encryption key and returned masked on reads.
+ /// Example: {"slack_user_token":"xoxp-rotated-token","old_token_to_remove":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464"}
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ global::System.Threading.Tasks.Task Update2Async(
+ string aliasKey,
+ string sessionKey,
+ int? requestTimeout = default,
+ int? requestTimeoutMillis = default,
+ string? name = default,
+ string? description = default,
+ object? metadata = default,
+ bool? enabled = default,
+ long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
+ global::Vectara.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.g.cs
new file mode 100644
index 0000000..1debe44
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.IAgentAliasesSessionsClient.g.cs
@@ -0,0 +1,48 @@
+
+#nullable enable
+
+namespace Vectara
+{
+ ///
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
+ ///
+ public partial interface IAgentAliasesSessionsClient : global::System.IDisposable
+ {
+ ///
+ /// The HttpClient instance.
+ ///
+ public global::System.Net.Http.HttpClient HttpClient { get; }
+
+ ///
+ /// The base URL for the API.
+ ///
+ public System.Uri? BaseUri { get; }
+
+ ///
+ /// The authorizations to use for the requests.
+ ///
+ public global::System.Collections.Generic.List Authorizations { get; }
+
+ ///
+ /// Gets or sets a value indicating whether the response content should be read as a string.
+ /// True by default in debug builds, false otherwise.
+ /// When false, successful responses are deserialized directly from the response stream for better performance.
+ /// Error responses are always read as strings regardless of this setting,
+ /// ensuring is populated.
+ ///
+ public bool ReadResponseAsString { get; set; }
+ ///
+ /// Client-wide request defaults such as headers, query parameters, retries, and timeout.
+ ///
+ public global::Vectara.AutoSDKClientOptions Options { get; }
+
+
+ ///
+ ///
+ ///
+ global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs
index ba494eb..f82dca0 100644
--- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs
+++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Create.g.cs
@@ -136,6 +136,12 @@ public partial interface IAgentSessionsClient
/// Default Value: 0
/// Example: 60
///
+ ///
+ /// Session-scoped secrets to store on the new session. Map of secret name to plaintext value.
+ /// Encrypted at rest with the owning agent's encryption key. Referenced from tool `argument_override` via
+ /// `{"$ref": "session.secrets.<name>"}`. Returned masked (`****`) on reads.
+ /// Example: {"slack_user_token":"xoxp-your-token-here"}
+ ///
///
/// Create a new session by forking an existing one. By default, copies all visible events
/// and artifacts from the source session without compaction. Optionally specify exactly one of
@@ -155,6 +161,7 @@ public partial interface IAgentSessionsClient
object? metadata = default,
bool? enabled = default,
long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
global::Vectara.CreateAgentSessionRequestFromSession? fromSession = default,
global::Vectara.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
diff --git a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs
index 061e3f2..b76bfb0 100644
--- a/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs
+++ b/src/libs/Vectara/Generated/Vectara.IAgentSessionsClient.Update.g.cs
@@ -95,6 +95,11 @@ public partial interface IAgentSessionsClient
/// Time-to-idle in minutes for the session. If no events occur in the session for this duration, the session will be automatically deleted. If set to 0, the session will not expire.
/// Example: 60
///
+ ///
+ /// Patch the session's secrets. Names present in the map are added or replaced; names absent from the map are left unchanged.
+ /// A name mapped to `null` is removed. Values are encrypted at rest with the owning agent's encryption key and returned masked on reads.
+ /// Example: {"slack_user_token":"xoxp-rotated-token","old_token_to_remove":"openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464"}
+ ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
/// The token to cancel the operation with
///
@@ -108,6 +113,7 @@ public partial interface IAgentSessionsClient
object? metadata = default,
bool? enabled = default,
long? ttiMinutes = default,
+ global::System.Collections.Generic.Dictionary? secrets = default,
global::Vectara.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
diff --git a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs
index 0d89cd8..100769d 100644
--- a/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs
+++ b/src/libs/Vectara/Generated/Vectara.IPipelineDeadLetterEntriesClient.Create.g.cs
@@ -62,6 +62,7 @@ public partial interface IPipelineDeadLetterEntriesClient
/// The identifier for the source record to add. Format depends on connector type:
/// - S3: the object key (e.g. `legal/contracts/doc.pdf`)
/// - SharePoint: the drive item ID
+ /// - Google Drive: the file ID
/// - Web: the canonicalized URL (e.g. `https://docs.example.com/page`)
///
///
diff --git a/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs b/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs
index 6e6f48f..a48971d 100644
--- a/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs
+++ b/src/libs/Vectara/Generated/Vectara.IVectaraClient.g.cs
@@ -59,6 +59,26 @@ public partial interface IVectaraClient : global::System.IDisposable
global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }
+ ///
+ ///
+ ///
+ public AgentAliasesClient AgentAliases { get; }
+
+ ///
+ ///
+ ///
+ public AgentAliasesArtifactsClient AgentAliasesArtifacts { get; }
+
+ ///
+ ///
+ ///
+ public AgentAliasesEventsClient AgentAliasesEvents { get; }
+
+ ///
+ ///
+ ///
+ public AgentAliasesSessionsClient AgentAliasesSessions { get; }
+
///
///
///
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicy.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicy.g.cs
new file mode 100644
index 0000000..7201768
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicy.g.cs
@@ -0,0 +1,57 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public class AliasPolicyJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.AliasPolicy Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.AliasPolicyDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.AliasPolicyDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::Vectara.RoutedAliasPolicy? routed = default;
+ if (discriminator?.Type == global::Vectara.AliasPolicyDiscriminatorType.Routed)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.RoutedAliasPolicy), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.RoutedAliasPolicy)}");
+ routed = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var __value = new global::Vectara.AliasPolicy(
+ discriminator?.Type,
+ routed
+ );
+
+ return __value;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::Vectara.AliasPolicy value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsRouted)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.RoutedAliasPolicy), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.RoutedAliasPolicy).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Routed!, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicyDiscriminatorType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicyDiscriminatorType.g.cs
new file mode 100644
index 0000000..35b3374
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicyDiscriminatorType.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public sealed class AliasPolicyDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.AliasPolicyDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::Vectara.AliasPolicyDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::Vectara.AliasPolicyDiscriminatorType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::Vectara.AliasPolicyDiscriminatorType);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::Vectara.AliasPolicyDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::Vectara.AliasPolicyDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicyDiscriminatorTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicyDiscriminatorTypeNullable.g.cs
new file mode 100644
index 0000000..b9ec980
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.AliasPolicyDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public sealed class AliasPolicyDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.AliasPolicyDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::Vectara.AliasPolicyDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::Vectara.AliasPolicyDiscriminatorType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::Vectara.AliasPolicyDiscriminatorType?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::Vectara.AliasPolicyDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::Vectara.AliasPolicyDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScope.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScope.g.cs
new file mode 100644
index 0000000..c9574e6
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScope.g.cs
@@ -0,0 +1,72 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public class GoogleDriveScopeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.GoogleDriveScope Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.GoogleDriveScopeDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.GoogleDriveScopeDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::Vectara.SharedGoogleDriveScope? shared = default;
+ if (discriminator?.Type == global::Vectara.GoogleDriveScopeDiscriminatorType.Shared)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.SharedGoogleDriveScope), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.SharedGoogleDriveScope)}");
+ shared = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::Vectara.MyGoogleDriveScope? myDrive = default;
+ if (discriminator?.Type == global::Vectara.GoogleDriveScopeDiscriminatorType.MyDrive)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.MyGoogleDriveScope), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Vectara.MyGoogleDriveScope)}");
+ myDrive = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var __value = new global::Vectara.GoogleDriveScope(
+ discriminator?.Type,
+ shared,
+
+ myDrive
+ );
+
+ return __value;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::Vectara.GoogleDriveScope value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsShared)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.SharedGoogleDriveScope), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.SharedGoogleDriveScope).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Shared!, typeInfo);
+ }
+ else if (value.IsMyDrive)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.MyGoogleDriveScope), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.MyGoogleDriveScope).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MyDrive!, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScopeDiscriminatorType.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScopeDiscriminatorType.g.cs
new file mode 100644
index 0000000..883fdd5
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScopeDiscriminatorType.g.cs
@@ -0,0 +1,53 @@
+#nullable enable
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public sealed class GoogleDriveScopeDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.GoogleDriveScopeDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::Vectara.GoogleDriveScopeDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::Vectara.GoogleDriveScopeDiscriminatorType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::Vectara.GoogleDriveScopeDiscriminatorType);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::Vectara.GoogleDriveScopeDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::Vectara.GoogleDriveScopeDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScopeDiscriminatorTypeNullable.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScopeDiscriminatorTypeNullable.g.cs
new file mode 100644
index 0000000..95d94bd
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveScopeDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,60 @@
+#nullable enable
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public sealed class GoogleDriveScopeDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.GoogleDriveScopeDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::Vectara.GoogleDriveScopeDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::Vectara.GoogleDriveScopeDiscriminatorType)numValue;
+ }
+ case global::System.Text.Json.JsonTokenType.Null:
+ {
+ return default(global::Vectara.GoogleDriveScopeDiscriminatorType?);
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::Vectara.GoogleDriveScopeDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::Vectara.GoogleDriveScopeDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveSourceConfiguration.g.cs b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveSourceConfiguration.g.cs
new file mode 100644
index 0000000..2eece3d
--- /dev/null
+++ b/src/libs/Vectara/Generated/Vectara.JsonConverters.GoogleDriveSourceConfiguration.g.cs
@@ -0,0 +1,143 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace Vectara.JsonConverters
+{
+ ///
+ public class GoogleDriveSourceConfigurationJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::Vectara.GoogleDriveSourceConfiguration Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader);
+ var __rawJson = __jsonDocument.RootElement.GetRawText();
+ var __jsonProps = new global::System.Collections.Generic.HashSet();
+ if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object)
+ {
+ foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject())
+ {
+ __jsonProps.Add(__jsonProp.Name);
+
+ }
+ }
+
+ var __score0 = 0;
+ if (__jsonProps.Contains("client_email")) __score0++;
+ if (__jsonProps.Contains("private_key")) __score0++;
+ if (__jsonProps.Contains("scopes")) __score0++;
+ if (__jsonProps.Contains("type")) __score0++;
+ var __score1 = 0;
+ var __bestScore = 0;
+ var __bestIndex = -1;
+ if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
+ if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }
+
+ global::Vectara.BaseGoogleDriveSourceConfiguration? @base = default;
+ object? googleDriveSourceConfigurationVariant2 = default;
+ if (__bestIndex >= 0)
+ {
+ if (__bestIndex == 0)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Vectara.BaseGoogleDriveSourceConfiguration), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Vectara.BaseGoogleDriveSourceConfiguration).Name}");
+ @base = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
+ }
+ catch (global::System.Text.Json.JsonException)
+ {
+ }
+ catch (global::System.InvalidOperationException)
+ {
+ }
+ }
+ else if (__bestIndex == 1)
+ {
+ try
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(object), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo