diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs
deleted file mode 100644
index 1d25949..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.AttachKnowledgeItemToAgent.g.cs
+++ /dev/null
@@ -1,521 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentKnowledgeBaseClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_AttachKnowledgeItemToAgentServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_AttachKnowledgeItemToAgentSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_AttachKnowledgeItemToAgentSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_AttachKnowledgeItemToAgentSecurityRequirement0,
- };
- partial void PrepareAttachKnowledgeItemToAgentArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- global::ResembleAI.AttachKnowledgeItemToAgentRequest request);
- partial void PrepareAttachKnowledgeItemToAgentRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::ResembleAI.AttachKnowledgeItemToAgentRequest request);
- partial void ProcessAttachKnowledgeItemToAgentResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessAttachKnowledgeItemToAgentResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Attach knowledge item to agent
- /// Attaches an existing knowledge item to an agent
- ///
- ///
- ///
- /// 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 AttachKnowledgeItemToAgentAsync(
- global::System.Guid agentUuid,
-
- global::ResembleAI.AttachKnowledgeItemToAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await AttachKnowledgeItemToAgentAsResponseAsync(
- agentUuid: agentUuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Attach knowledge item to agent
- /// Attaches an existing knowledge item to an agent
- ///
- ///
- ///
- /// 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> AttachKnowledgeItemToAgentAsResponseAsync(
- global::System.Guid agentUuid,
-
- global::ResembleAI.AttachKnowledgeItemToAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareAttachKnowledgeItemToAgentArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_AttachKnowledgeItemToAgentSecurityRequirements,
- operationName: "AttachKnowledgeItemToAgentAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/knowledge_items",
- baseUri: ResolveBaseUri(
- servers: s_AttachKnowledgeItemToAgentServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareAttachKnowledgeItemToAgentRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "AttachKnowledgeItemToAgent",
- methodName: "AttachKnowledgeItemToAgentAsync",
- pathTemplate: "$\"/agents/{agentUuid}/knowledge_items\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "AttachKnowledgeItemToAgent",
- methodName: "AttachKnowledgeItemToAgentAsync",
- pathTemplate: "$\"/agents/{agentUuid}/knowledge_items\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "AttachKnowledgeItemToAgent",
- methodName: "AttachKnowledgeItemToAgentAsync",
- pathTemplate: "$\"/agents/{agentUuid}/knowledge_items\"",
- 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::ResembleAI.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);
- ProcessAttachKnowledgeItemToAgentResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "AttachKnowledgeItemToAgent",
- methodName: "AttachKnowledgeItemToAgentAsync",
- pathTemplate: "$\"/agents/{agentUuid}/knowledge_items\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "AttachKnowledgeItemToAgent",
- methodName: "AttachKnowledgeItemToAgentAsync",
- pathTemplate: "$\"/agents/{agentUuid}/knowledge_items\"",
- 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);
- }
- // Validation error (not ready, already attached, etc.)
- if ((int)__response.StatusCode == 422)
- {
- string? __content_422 = null;
- global::System.Exception? __exception_422 = null;
- global::ResembleAI.Error? __value_422 = null;
- try
- {
- if (__effectiveReadResponseAsString)
- {
- __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
- __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext);
- }
- else
- {
- __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
-
- __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext);
- }
- }
- catch (global::System.Exception __ex)
- {
- __exception_422 = __ex;
- }
-
-
- throw global::ResembleAI.ApiException.Create(
- statusCode: __response.StatusCode,
- message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
- innerException: __exception_422,
- responseBody: __content_422,
- responseObject: __value_422,
- 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);
- ProcessAttachKnowledgeItemToAgentResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentKnowledgeBaseAttachKnowledgeItemToAgentResponse201.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentKnowledgeBaseAttachKnowledgeItemToAgentResponse201.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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();
- }
- }
- ///
- /// Attach knowledge item to agent
- /// Attaches an existing knowledge item to an agent
- ///
- ///
- ///
- /// The UUID of the knowledge item to attach
- ///
- /// 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 AttachKnowledgeItemToAgentAsync(
- global::System.Guid agentUuid,
- global::System.Guid knowledgeItemUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.AttachKnowledgeItemToAgentRequest
- {
- KnowledgeItemUuid = knowledgeItemUuid,
- };
-
- return await AttachKnowledgeItemToAgentAsync(
- agentUuid: agentUuid,
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs
deleted file mode 100644
index a53d198..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.DeleteKnowledgeItem.g.cs
+++ /dev/null
@@ -1,473 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentKnowledgeBaseClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_DeleteKnowledgeItemServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_DeleteKnowledgeItemSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_DeleteKnowledgeItemSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_DeleteKnowledgeItemSecurityRequirement0,
- };
- partial void PrepareDeleteKnowledgeItemArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid uuid);
- partial void PrepareDeleteKnowledgeItemRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid uuid);
- partial void ProcessDeleteKnowledgeItemResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessDeleteKnowledgeItemResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Delete knowledge item
- /// Deletes a knowledge item and cleans up associated data
- ///
- ///
- /// 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 DeleteKnowledgeItemAsync(
- global::System.Guid uuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await DeleteKnowledgeItemAsResponseAsync(
- uuid: uuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Delete knowledge item
- /// Deletes a knowledge item and cleans up associated data
- ///
- ///
- /// 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> DeleteKnowledgeItemAsResponseAsync(
- global::System.Guid uuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareDeleteKnowledgeItemArguments(
- httpClient: HttpClient,
- uuid: ref uuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_DeleteKnowledgeItemSecurityRequirements,
- operationName: "DeleteKnowledgeItemAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/knowledge_items/{uuid}",
- baseUri: ResolveBaseUri(
- servers: s_DeleteKnowledgeItemServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareDeleteKnowledgeItemRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- uuid: uuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteKnowledgeItem",
- methodName: "DeleteKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteKnowledgeItem",
- methodName: "DeleteKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteKnowledgeItem",
- methodName: "DeleteKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}\"",
- 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::ResembleAI.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);
- ProcessDeleteKnowledgeItemResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteKnowledgeItem",
- methodName: "DeleteKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteKnowledgeItem",
- methodName: "DeleteKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}\"",
- 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);
- }
- // Knowledge item not found
- if ((int)__response.StatusCode == 404)
- {
- string? __content_404 = null;
- global::System.Exception? __exception_404 = null;
- global::ResembleAI.Error? __value_404 = null;
- try
- {
- if (__effectiveReadResponseAsString)
- {
- __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
- __value_404 = global::ResembleAI.Error.FromJson(__content_404, JsonSerializerContext);
- }
- else
- {
- __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
-
- __value_404 = global::ResembleAI.Error.FromJson(__content_404, JsonSerializerContext);
- }
- }
- catch (global::System.Exception __ex)
- {
- __exception_404 = __ex;
- }
-
-
- throw global::ResembleAI.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);
- ProcessDeleteKnowledgeItemResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentKnowledgeBaseDeleteKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentKnowledgeBaseDeleteKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.ListKnowledgeItems.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.ListKnowledgeItems.g.cs
deleted file mode 100644
index 9fd6f15..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.ListKnowledgeItems.g.cs
+++ /dev/null
@@ -1,477 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentKnowledgeBaseClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ListKnowledgeItemsServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ListKnowledgeItemsSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ListKnowledgeItemsSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ListKnowledgeItemsSecurityRequirement0,
- };
- partial void PrepareListKnowledgeItemsArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::ResembleAI.KnowledgeItemsGetParametersStatus? status,
- ref global::ResembleAI.KnowledgeItemsGetParametersSourceType? sourceType,
- ref int? page,
- ref int? perPage);
- partial void PrepareListKnowledgeItemsRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::ResembleAI.KnowledgeItemsGetParametersStatus? status,
- global::ResembleAI.KnowledgeItemsGetParametersSourceType? sourceType,
- int? page,
- int? perPage);
- partial void ProcessListKnowledgeItemsResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessListKnowledgeItemsResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// List knowledge items
- /// List all knowledge items belonging to the authenticated user's team
- ///
- ///
- ///
- ///
- /// Default Value: 1
- ///
- ///
- /// Default Value: 20
- ///
- /// 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 ListKnowledgeItemsAsync(
- global::ResembleAI.KnowledgeItemsGetParametersStatus? status = default,
- global::ResembleAI.KnowledgeItemsGetParametersSourceType? sourceType = default,
- int? page = default,
- int? perPage = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ListKnowledgeItemsAsResponseAsync(
- status: status,
- sourceType: sourceType,
- page: page,
- perPage: perPage,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// List knowledge items
- /// List all knowledge items belonging to the authenticated user's team
- ///
- ///
- ///
- ///
- /// Default Value: 1
- ///
- ///
- /// Default Value: 20
- ///
- /// 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> ListKnowledgeItemsAsResponseAsync(
- global::ResembleAI.KnowledgeItemsGetParametersStatus? status = default,
- global::ResembleAI.KnowledgeItemsGetParametersSourceType? sourceType = default,
- int? page = default,
- int? perPage = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareListKnowledgeItemsArguments(
- httpClient: HttpClient,
- status: ref status,
- sourceType: ref sourceType,
- page: ref page,
- perPage: ref perPage);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ListKnowledgeItemsSecurityRequirements,
- operationName: "ListKnowledgeItemsAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/knowledge_items",
- baseUri: ResolveBaseUri(
- servers: s_ListKnowledgeItemsServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- __pathBuilder
- .AddOptionalParameter("status", status?.ToValueString())
- .AddOptionalParameter("source_type", sourceType?.ToValueString())
- .AddOptionalParameter("page", page?.ToString())
- .AddOptionalParameter("per_page", perPage?.ToString())
- ;
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareListKnowledgeItemsRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- status: status,
- sourceType: sourceType,
- page: page,
- perPage: perPage);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListKnowledgeItems",
- methodName: "ListKnowledgeItemsAsync",
- pathTemplate: "\"/knowledge_items\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListKnowledgeItems",
- methodName: "ListKnowledgeItemsAsync",
- pathTemplate: "\"/knowledge_items\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListKnowledgeItems",
- methodName: "ListKnowledgeItemsAsync",
- pathTemplate: "\"/knowledge_items\"",
- 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::ResembleAI.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);
- ProcessListKnowledgeItemsResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListKnowledgeItems",
- methodName: "ListKnowledgeItemsAsync",
- pathTemplate: "\"/knowledge_items\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListKnowledgeItems",
- methodName: "ListKnowledgeItemsAsync",
- pathTemplate: "\"/knowledge_items\"",
- 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);
- }
-
- 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);
- ProcessListKnowledgeItemsResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentKnowledgeBaseListKnowledgeItemsResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentKnowledgeBaseListKnowledgeItemsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs
deleted file mode 100644
index 5fb5524..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.ReingestKnowledgeItem.g.cs
+++ /dev/null
@@ -1,473 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentKnowledgeBaseClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ReingestKnowledgeItemServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ReingestKnowledgeItemSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ReingestKnowledgeItemSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ReingestKnowledgeItemSecurityRequirement0,
- };
- partial void PrepareReingestKnowledgeItemArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid uuid);
- partial void PrepareReingestKnowledgeItemRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid uuid);
- partial void ProcessReingestKnowledgeItemResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessReingestKnowledgeItemResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Re-ingest knowledge item
- /// Re-runs the ingestion pipeline for an existing knowledge item
- ///
- ///
- /// 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 ReingestKnowledgeItemAsync(
- global::System.Guid uuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ReingestKnowledgeItemAsResponseAsync(
- uuid: uuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Re-ingest knowledge item
- /// Re-runs the ingestion pipeline for an existing knowledge item
- ///
- ///
- /// 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> ReingestKnowledgeItemAsResponseAsync(
- global::System.Guid uuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareReingestKnowledgeItemArguments(
- httpClient: HttpClient,
- uuid: ref uuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ReingestKnowledgeItemSecurityRequirements,
- operationName: "ReingestKnowledgeItemAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/knowledge_items/{uuid}/reingest",
- baseUri: ResolveBaseUri(
- servers: s_ReingestKnowledgeItemServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareReingestKnowledgeItemRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- uuid: uuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ReingestKnowledgeItem",
- methodName: "ReingestKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}/reingest\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ReingestKnowledgeItem",
- methodName: "ReingestKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}/reingest\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ReingestKnowledgeItem",
- methodName: "ReingestKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}/reingest\"",
- 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::ResembleAI.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);
- ProcessReingestKnowledgeItemResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ReingestKnowledgeItem",
- methodName: "ReingestKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}/reingest\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ReingestKnowledgeItem",
- methodName: "ReingestKnowledgeItemAsync",
- pathTemplate: "$\"/knowledge_items/{uuid}/reingest\"",
- 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);
- }
- // Cannot reingest (already processing or rate limited)
- if ((int)__response.StatusCode == 422)
- {
- string? __content_422 = null;
- global::System.Exception? __exception_422 = null;
- global::ResembleAI.Error? __value_422 = null;
- try
- {
- if (__effectiveReadResponseAsString)
- {
- __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
- __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext);
- }
- else
- {
- __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
-
- __value_422 = global::ResembleAI.Error.FromJson(__content_422, JsonSerializerContext);
- }
- }
- catch (global::System.Exception __ex)
- {
- __exception_422 = __ex;
- }
-
-
- throw global::ResembleAI.ApiException.Create(
- statusCode: __response.StatusCode,
- message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
- innerException: __exception_422,
- responseBody: __content_422,
- responseObject: __value_422,
- 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);
- ProcessReingestKnowledgeItemResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentKnowledgeBaseReingestKnowledgeItemResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentKnowledgeBaseReingestKnowledgeItemResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.g.cs
deleted file mode 100644
index dcefd59..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentKnowledgeBaseClient.g.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- ///
- /// 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 AgentKnowledgeBaseClient : global::ResembleAI.IAgentKnowledgeBaseClient, global::System.IDisposable
- {
- ///
- ///
- ///
- public const string DefaultBaseUrl = "https://app.resemble.ai/api/v2";
-
- 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::ResembleAI.AutoSDKClientOptions Options { get; }
-
-
- internal global::ResembleAI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ResembleAI.AutoSDKServerConfiguration();
- ///
- ///
- ///
- public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::ResembleAI.SourceGenerationContext.Default;
-
-
- ///
- /// Creates a new instance of the AgentKnowledgeBaseClient.
- /// 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 AgentKnowledgeBaseClient(
- 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 AgentKnowledgeBaseClient 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 AgentKnowledgeBaseClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true) : this(
- httpClient,
- baseUri: null,
- authorizations,
- options,
- disposeHttpClient: disposeHttpClient)
- {
- }
-
- ///
- /// Creates a new instance of the AgentKnowledgeBaseClient.
- /// 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 AgentKnowledgeBaseClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Uri? baseUri,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true)
- {
-
- HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
- if (baseUri is not null)
- {
- HttpClient.BaseAddress ??= baseUri;
- }
- Authorizations = authorizations ?? new global::System.Collections.Generic.List();
- Options = options ?? new global::ResembleAI.AutoSDKClientOptions();
- _disposeHttpClient = disposeHttpClient;
-
- AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
-
- 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);
-
-
- private global::System.Uri? ResolveBaseUri(
- global::ResembleAI.AutoSDKServer[] servers,
- string defaultBaseUrl)
- {
- if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
- {
- return explicitBaseUri;
- }
-
- if (AutoSDKServerConfiguration.SelectedServer is global::ResembleAI.AutoSDKServer selectedServer)
- {
- foreach (var server in servers)
- {
- if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
- {
- return server.Uri;
- }
- }
- }
-
- if (servers.Length > 0)
- {
- return servers[0].Uri;
- }
-
- return string.IsNullOrWhiteSpace(defaultBaseUrl)
- ? HttpClient.BaseAddress
- : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.CreatePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.CreatePhoneNumber.g.cs
deleted file mode 100644
index 99539bc..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.CreatePhoneNumber.g.cs
+++ /dev/null
@@ -1,500 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentPhoneNumbersClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_CreatePhoneNumberServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_CreatePhoneNumberSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_CreatePhoneNumberSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_CreatePhoneNumberSecurityRequirement0,
- };
- partial void PrepareCreatePhoneNumberArguments(
- global::System.Net.Http.HttpClient httpClient,
- global::ResembleAI.CreatePhoneNumberRequest request);
- partial void PrepareCreatePhoneNumberRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::ResembleAI.CreatePhoneNumberRequest request);
- partial void ProcessCreatePhoneNumberResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessCreatePhoneNumberResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Create agent phone number
- /// Create a new agent phone number
- ///
- ///
- /// 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 CreatePhoneNumberAsync(
-
- global::ResembleAI.CreatePhoneNumberRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await CreatePhoneNumberAsResponseAsync(
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Create agent phone number
- /// Create a new agent phone number
- ///
- ///
- /// 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> CreatePhoneNumberAsResponseAsync(
-
- global::ResembleAI.CreatePhoneNumberRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareCreatePhoneNumberArguments(
- httpClient: HttpClient,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_CreatePhoneNumberSecurityRequirements,
- operationName: "CreatePhoneNumberAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/phone_numbers",
- baseUri: ResolveBaseUri(
- servers: s_CreatePhoneNumberServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareCreatePhoneNumberRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreatePhoneNumber",
- methodName: "CreatePhoneNumberAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreatePhoneNumber",
- methodName: "CreatePhoneNumberAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreatePhoneNumber",
- methodName: "CreatePhoneNumberAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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::ResembleAI.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);
- ProcessCreatePhoneNumberResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreatePhoneNumber",
- methodName: "CreatePhoneNumberAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreatePhoneNumber",
- methodName: "CreatePhoneNumberAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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);
- }
-
- 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);
- ProcessCreatePhoneNumberResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentPhoneNumbersCreatePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentPhoneNumbersCreatePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent phone number
- /// Create a new agent phone number
- ///
- ///
- /// E.164 formatted phone number
- ///
- ///
- ///
- /// Default Value: false
- ///
- ///
- /// Default Value: false
- ///
- ///
- ///
- ///
- ///
- ///
- /// 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 CreatePhoneNumberAsync(
- string phoneNumber,
- string label,
- bool? supportsInbound = default,
- bool? supportsOutbound = default,
- global::ResembleAI.PhoneNumbersPostRequestBodyContentApplicationJsonSchemaProvider? provider = default,
- string? twilioAccountSid = default,
- string? twilioAuthToken = default,
- global::ResembleAI.PhoneNumbersPostRequestBodyContentApplicationJsonSchemaOutboundTrunk? outboundTrunk = default,
- global::ResembleAI.PhoneNumbersPostRequestBodyContentApplicationJsonSchemaInboundTrunk? inboundTrunk = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.CreatePhoneNumberRequest
- {
- PhoneNumber = phoneNumber,
- Label = label,
- SupportsInbound = supportsInbound,
- SupportsOutbound = supportsOutbound,
- Provider = provider,
- TwilioAccountSid = twilioAccountSid,
- TwilioAuthToken = twilioAuthToken,
- OutboundTrunk = outboundTrunk,
- InboundTrunk = inboundTrunk,
- };
-
- return await CreatePhoneNumberAsync(
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.DeletePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.DeletePhoneNumber.g.cs
deleted file mode 100644
index 6ca18ae..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.DeletePhoneNumber.g.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentPhoneNumbersClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_DeletePhoneNumberServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_DeletePhoneNumberSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_DeletePhoneNumberSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_DeletePhoneNumberSecurityRequirement0,
- };
- partial void PrepareDeletePhoneNumberArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref int id);
- partial void PrepareDeletePhoneNumberRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- int id);
- partial void ProcessDeletePhoneNumberResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessDeletePhoneNumberResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Delete agent phone number
- /// Delete an agent phone number
- ///
- ///
- /// 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 DeletePhoneNumberAsync(
- int id,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await DeletePhoneNumberAsResponseAsync(
- id: id,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Delete agent phone number
- /// Delete an agent phone number
- ///
- ///
- /// 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> DeletePhoneNumberAsResponseAsync(
- int id,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareDeletePhoneNumberArguments(
- httpClient: HttpClient,
- id: ref id);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_DeletePhoneNumberSecurityRequirements,
- operationName: "DeletePhoneNumberAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/phone_numbers/{id}",
- baseUri: ResolveBaseUri(
- servers: s_DeletePhoneNumberServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareDeletePhoneNumberRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- id: id!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeletePhoneNumber",
- methodName: "DeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeletePhoneNumber",
- methodName: "DeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeletePhoneNumber",
- methodName: "DeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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::ResembleAI.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);
- ProcessDeletePhoneNumberResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeletePhoneNumber",
- methodName: "DeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeletePhoneNumber",
- methodName: "DeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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);
- }
-
- 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);
- ProcessDeletePhoneNumberResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentPhoneNumbersDeletePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentPhoneNumbersDeletePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs
deleted file mode 100644
index 73bb06f..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.ForceDeletePhoneNumber.g.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentPhoneNumbersClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ForceDeletePhoneNumberServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ForceDeletePhoneNumberSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ForceDeletePhoneNumberSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ForceDeletePhoneNumberSecurityRequirement0,
- };
- partial void PrepareForceDeletePhoneNumberArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref int id);
- partial void PrepareForceDeletePhoneNumberRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- int id);
- partial void ProcessForceDeletePhoneNumberResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessForceDeletePhoneNumberResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Force delete agent phone number
- /// Force delete an agent phone number even if linked to agent
- ///
- ///
- /// 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 ForceDeletePhoneNumberAsync(
- int id,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ForceDeletePhoneNumberAsResponseAsync(
- id: id,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Force delete agent phone number
- /// Force delete an agent phone number even if linked to agent
- ///
- ///
- /// 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> ForceDeletePhoneNumberAsResponseAsync(
- int id,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareForceDeletePhoneNumberArguments(
- httpClient: HttpClient,
- id: ref id);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ForceDeletePhoneNumberSecurityRequirements,
- operationName: "ForceDeletePhoneNumberAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/phone_numbers/{id}/force",
- baseUri: ResolveBaseUri(
- servers: s_ForceDeletePhoneNumberServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareForceDeletePhoneNumberRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- id: id!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ForceDeletePhoneNumber",
- methodName: "ForceDeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}/force\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ForceDeletePhoneNumber",
- methodName: "ForceDeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}/force\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ForceDeletePhoneNumber",
- methodName: "ForceDeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}/force\"",
- 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::ResembleAI.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);
- ProcessForceDeletePhoneNumberResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ForceDeletePhoneNumber",
- methodName: "ForceDeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}/force\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ForceDeletePhoneNumber",
- methodName: "ForceDeletePhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}/force\"",
- 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);
- }
-
- 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);
- ProcessForceDeletePhoneNumberResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentPhoneNumbersForceDeletePhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentPhoneNumbersForceDeletePhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.GetPhoneNumber.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.GetPhoneNumber.g.cs
deleted file mode 100644
index d02a92c..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.GetPhoneNumber.g.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentPhoneNumbersClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_GetPhoneNumberServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_GetPhoneNumberSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_GetPhoneNumberSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_GetPhoneNumberSecurityRequirement0,
- };
- partial void PrepareGetPhoneNumberArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref int id);
- partial void PrepareGetPhoneNumberRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- int id);
- partial void ProcessGetPhoneNumberResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessGetPhoneNumberResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Get agent phone number
- /// Get agent phone number details
- ///
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- public async global::System.Threading.Tasks.Task GetPhoneNumberAsync(
- int id,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await GetPhoneNumberAsResponseAsync(
- id: id,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Get agent phone number
- /// Get agent phone number details
- ///
- ///
- /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
- /// The token to cancel the operation with
- ///
- public async global::System.Threading.Tasks.Task> GetPhoneNumberAsResponseAsync(
- int id,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareGetPhoneNumberArguments(
- httpClient: HttpClient,
- id: ref id);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_GetPhoneNumberSecurityRequirements,
- operationName: "GetPhoneNumberAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/phone_numbers/{id}",
- baseUri: ResolveBaseUri(
- servers: s_GetPhoneNumberServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareGetPhoneNumberRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- id: id!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetPhoneNumber",
- methodName: "GetPhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetPhoneNumber",
- methodName: "GetPhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetPhoneNumber",
- methodName: "GetPhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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::ResembleAI.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);
- ProcessGetPhoneNumberResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetPhoneNumber",
- methodName: "GetPhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetPhoneNumber",
- methodName: "GetPhoneNumberAsync",
- pathTemplate: "$\"/phone_numbers/{id}\"",
- 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);
- }
-
- 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);
- ProcessGetPhoneNumberResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentPhoneNumbersGetPhoneNumberResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentPhoneNumbersGetPhoneNumberResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.ListPhoneNumbers.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.ListPhoneNumbers.g.cs
deleted file mode 100644
index a481f6e..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.ListPhoneNumbers.g.cs
+++ /dev/null
@@ -1,427 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentPhoneNumbersClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ListPhoneNumbersServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ListPhoneNumbersSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ListPhoneNumbersSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ListPhoneNumbersSecurityRequirement0,
- };
- partial void PrepareListPhoneNumbersArguments(
- global::System.Net.Http.HttpClient httpClient);
- partial void PrepareListPhoneNumbersRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage);
- partial void ProcessListPhoneNumbersResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessListPhoneNumbersResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// List agent phone numbers
- /// List all agent phone numbers
- ///
- /// 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 ListPhoneNumbersAsync(
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ListPhoneNumbersAsResponseAsync(
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// List agent phone numbers
- /// List all agent phone numbers
- ///
- /// 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> ListPhoneNumbersAsResponseAsync(
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareListPhoneNumbersArguments(
- httpClient: HttpClient);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ListPhoneNumbersSecurityRequirements,
- operationName: "ListPhoneNumbersAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/phone_numbers",
- baseUri: ResolveBaseUri(
- servers: s_ListPhoneNumbersServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareListPhoneNumbersRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListPhoneNumbers",
- methodName: "ListPhoneNumbersAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListPhoneNumbers",
- methodName: "ListPhoneNumbersAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListPhoneNumbers",
- methodName: "ListPhoneNumbersAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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::ResembleAI.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);
- ProcessListPhoneNumbersResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListPhoneNumbers",
- methodName: "ListPhoneNumbersAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListPhoneNumbers",
- methodName: "ListPhoneNumbersAsync",
- pathTemplate: "\"/phone_numbers\"",
- 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);
- }
-
- 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);
- ProcessListPhoneNumbersResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentPhoneNumbersListPhoneNumbersResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentPhoneNumbersListPhoneNumbersResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.g.cs
deleted file mode 100644
index ed28a68..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentPhoneNumbersClient.g.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- ///
- /// 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 AgentPhoneNumbersClient : global::ResembleAI.IAgentPhoneNumbersClient, global::System.IDisposable
- {
- ///
- ///
- ///
- public const string DefaultBaseUrl = "https://app.resemble.ai/api/v2";
-
- 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::ResembleAI.AutoSDKClientOptions Options { get; }
-
-
- internal global::ResembleAI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ResembleAI.AutoSDKServerConfiguration();
- ///
- ///
- ///
- public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::ResembleAI.SourceGenerationContext.Default;
-
-
- ///
- /// Creates a new instance of the AgentPhoneNumbersClient.
- /// 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 AgentPhoneNumbersClient(
- 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 AgentPhoneNumbersClient 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 AgentPhoneNumbersClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true) : this(
- httpClient,
- baseUri: null,
- authorizations,
- options,
- disposeHttpClient: disposeHttpClient)
- {
- }
-
- ///
- /// Creates a new instance of the AgentPhoneNumbersClient.
- /// 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 AgentPhoneNumbersClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Uri? baseUri,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true)
- {
-
- HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
- if (baseUri is not null)
- {
- HttpClient.BaseAddress ??= baseUri;
- }
- Authorizations = authorizations ?? new global::System.Collections.Generic.List();
- Options = options ?? new global::ResembleAI.AutoSDKClientOptions();
- _disposeHttpClient = disposeHttpClient;
-
- AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
-
- 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);
-
-
- private global::System.Uri? ResolveBaseUri(
- global::ResembleAI.AutoSDKServer[] servers,
- string defaultBaseUrl)
- {
- if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
- {
- return explicitBaseUri;
- }
-
- if (AutoSDKServerConfiguration.SelectedServer is global::ResembleAI.AutoSDKServer selectedServer)
- {
- foreach (var server in servers)
- {
- if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
- {
- return server.Uri;
- }
- }
- }
-
- if (servers.Length > 0)
- {
- return servers[0].Uri;
- }
-
- return string.IsNullOrWhiteSpace(defaultBaseUrl)
- ? HttpClient.BaseAddress
- : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.CreateAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.CreateAgentTool.g.cs
deleted file mode 100644
index 7944f5c..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.CreateAgentTool.g.cs
+++ /dev/null
@@ -1,491 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentToolsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_CreateAgentToolServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_CreateAgentToolSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_CreateAgentToolSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_CreateAgentToolSecurityRequirement0,
- };
- partial void PrepareCreateAgentToolArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- global::ResembleAI.CreateAgentToolRequest request);
- partial void PrepareCreateAgentToolRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::ResembleAI.CreateAgentToolRequest request);
- partial void ProcessCreateAgentToolResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessCreateAgentToolResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Create agent tool
- /// Create a new tool for an agent
- ///
- ///
- ///
- /// 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 CreateAgentToolAsync(
- global::System.Guid agentUuid,
-
- global::ResembleAI.CreateAgentToolRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await CreateAgentToolAsResponseAsync(
- agentUuid: agentUuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Create agent tool
- /// Create a new tool for an agent
- ///
- ///
- ///
- /// 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> CreateAgentToolAsResponseAsync(
- global::System.Guid agentUuid,
-
- global::ResembleAI.CreateAgentToolRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareCreateAgentToolArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_CreateAgentToolSecurityRequirements,
- operationName: "CreateAgentToolAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/tools",
- baseUri: ResolveBaseUri(
- servers: s_CreateAgentToolServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareCreateAgentToolRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentTool",
- methodName: "CreateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentTool",
- methodName: "CreateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentTool",
- methodName: "CreateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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::ResembleAI.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);
- ProcessCreateAgentToolResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentTool",
- methodName: "CreateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentTool",
- methodName: "CreateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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);
- }
-
- 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);
- ProcessCreateAgentToolResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentToolsCreateAgentToolResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentToolsCreateAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent tool
- /// Create a new tool for an agent
- ///
- ///
- ///
- ///
- ///
- ///
- /// 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 CreateAgentToolAsync(
- global::System.Guid agentUuid,
- string name,
- string description,
- global::ResembleAI.AgentsAgentUuidToolsPostRequestBodyContentApplicationJsonSchemaToolType toolType,
- global::ResembleAI.AgentsAgentUuidToolsPostRequestBodyContentApplicationJsonSchemaToolConfig toolConfig,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.CreateAgentToolRequest
- {
- Name = name,
- Description = description,
- ToolType = toolType,
- ToolConfig = toolConfig,
- };
-
- return await CreateAgentToolAsync(
- agentUuid: agentUuid,
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.DeleteAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.DeleteAgentTool.g.cs
deleted file mode 100644
index f752c98..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.DeleteAgentTool.g.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentToolsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_DeleteAgentToolServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_DeleteAgentToolSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_DeleteAgentToolSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_DeleteAgentToolSecurityRequirement0,
- };
- partial void PrepareDeleteAgentToolArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- ref global::System.Guid toolUuid);
- partial void PrepareDeleteAgentToolRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::System.Guid toolUuid);
- partial void ProcessDeleteAgentToolResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessDeleteAgentToolResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Delete agent tool
- /// Delete a tool
- ///
- ///
- ///
- /// 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 DeleteAgentToolAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await DeleteAgentToolAsResponseAsync(
- agentUuid: agentUuid,
- toolUuid: toolUuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Delete agent tool
- /// Delete a tool
- ///
- ///
- ///
- /// 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> DeleteAgentToolAsResponseAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareDeleteAgentToolArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- toolUuid: ref toolUuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_DeleteAgentToolSecurityRequirements,
- operationName: "DeleteAgentToolAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/tools/{toolUuid}",
- baseUri: ResolveBaseUri(
- servers: s_DeleteAgentToolServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareDeleteAgentToolRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- toolUuid: toolUuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentTool",
- methodName: "DeleteAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentTool",
- methodName: "DeleteAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentTool",
- methodName: "DeleteAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.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);
- ProcessDeleteAgentToolResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentTool",
- methodName: "DeleteAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentTool",
- methodName: "DeleteAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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);
- }
-
- 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);
- ProcessDeleteAgentToolResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentToolsDeleteAgentToolResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentToolsDeleteAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentToolsClient.GetAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.GetAgentTool.g.cs
deleted file mode 100644
index a2fb740..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.GetAgentTool.g.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentToolsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_GetAgentToolServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_GetAgentToolSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_GetAgentToolSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_GetAgentToolSecurityRequirement0,
- };
- partial void PrepareGetAgentToolArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- ref global::System.Guid toolUuid);
- partial void PrepareGetAgentToolRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::System.Guid toolUuid);
- partial void ProcessGetAgentToolResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessGetAgentToolResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Get agent tool
- /// Get details of a specific tool
- ///
- ///
- ///
- /// 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 GetAgentToolAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await GetAgentToolAsResponseAsync(
- agentUuid: agentUuid,
- toolUuid: toolUuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Get agent tool
- /// Get details of a specific tool
- ///
- ///
- ///
- /// 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> GetAgentToolAsResponseAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareGetAgentToolArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- toolUuid: ref toolUuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_GetAgentToolSecurityRequirements,
- operationName: "GetAgentToolAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/tools/{toolUuid}",
- baseUri: ResolveBaseUri(
- servers: s_GetAgentToolServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareGetAgentToolRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- toolUuid: toolUuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentTool",
- methodName: "GetAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentTool",
- methodName: "GetAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentTool",
- methodName: "GetAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.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);
- ProcessGetAgentToolResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentTool",
- methodName: "GetAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentTool",
- methodName: "GetAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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);
- }
-
- 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);
- ProcessGetAgentToolResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentToolsGetAgentToolResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentToolsGetAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentToolsClient.ListAgentTools.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.ListAgentTools.g.cs
deleted file mode 100644
index fef56aa..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.ListAgentTools.g.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentToolsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ListAgentToolsServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ListAgentToolsSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ListAgentToolsSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ListAgentToolsSecurityRequirement0,
- };
- partial void PrepareListAgentToolsArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid);
- partial void PrepareListAgentToolsRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid);
- partial void ProcessListAgentToolsResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessListAgentToolsResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// List agent tools
- /// List all tools for an agent
- ///
- ///
- /// 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 ListAgentToolsAsync(
- global::System.Guid agentUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ListAgentToolsAsResponseAsync(
- agentUuid: agentUuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// List agent tools
- /// List all tools for an agent
- ///
- ///
- /// 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> ListAgentToolsAsResponseAsync(
- global::System.Guid agentUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareListAgentToolsArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ListAgentToolsSecurityRequirements,
- operationName: "ListAgentToolsAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/tools",
- baseUri: ResolveBaseUri(
- servers: s_ListAgentToolsServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareListAgentToolsRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentTools",
- methodName: "ListAgentToolsAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentTools",
- methodName: "ListAgentToolsAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentTools",
- methodName: "ListAgentToolsAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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::ResembleAI.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);
- ProcessListAgentToolsResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentTools",
- methodName: "ListAgentToolsAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentTools",
- methodName: "ListAgentToolsAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools\"",
- 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);
- }
-
- 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);
- ProcessListAgentToolsResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentToolsListAgentToolsResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentToolsListAgentToolsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentToolsClient.UpdateAgentTool.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.UpdateAgentTool.g.cs
deleted file mode 100644
index ec7fe6d..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.UpdateAgentTool.g.cs
+++ /dev/null
@@ -1,500 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentToolsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_UpdateAgentToolServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_UpdateAgentToolSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_UpdateAgentToolSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_UpdateAgentToolSecurityRequirement0,
- };
- partial void PrepareUpdateAgentToolArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- ref global::System.Guid toolUuid,
- global::ResembleAI.UpdateAgentToolRequest request);
- partial void PrepareUpdateAgentToolRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
- global::ResembleAI.UpdateAgentToolRequest request);
- partial void ProcessUpdateAgentToolResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessUpdateAgentToolResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Update agent tool
- /// Update an existing tool
- ///
- ///
- ///
- ///
- /// 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 UpdateAgentToolAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
-
- global::ResembleAI.UpdateAgentToolRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await UpdateAgentToolAsResponseAsync(
- agentUuid: agentUuid,
- toolUuid: toolUuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Update agent tool
- /// Update an existing tool
- ///
- ///
- ///
- ///
- /// 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> UpdateAgentToolAsResponseAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
-
- global::ResembleAI.UpdateAgentToolRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareUpdateAgentToolArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- toolUuid: ref toolUuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_UpdateAgentToolSecurityRequirements,
- operationName: "UpdateAgentToolAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/tools/{toolUuid}",
- baseUri: ResolveBaseUri(
- servers: s_UpdateAgentToolServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareUpdateAgentToolRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- toolUuid: toolUuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentTool",
- methodName: "UpdateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentTool",
- methodName: "UpdateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentTool",
- methodName: "UpdateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.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);
- ProcessUpdateAgentToolResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentTool",
- methodName: "UpdateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentTool",
- methodName: "UpdateAgentToolAsync",
- pathTemplate: "$\"/agents/{agentUuid}/tools/{toolUuid}\"",
- 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);
- }
-
- 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);
- ProcessUpdateAgentToolResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentToolsUpdateAgentToolResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentToolsUpdateAgentToolResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent tool
- /// Update an existing tool
- ///
- ///
- ///
- ///
- ///
- ///
- /// 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 UpdateAgentToolAsync(
- global::System.Guid agentUuid,
- global::System.Guid toolUuid,
- string? name = default,
- string? description = default,
- global::ResembleAI.AgentsAgentUuidToolsToolUuidPatchRequestBodyContentApplicationJsonSchemaToolConfig? toolConfig = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.UpdateAgentToolRequest
- {
- Name = name,
- Description = description,
- ToolConfig = toolConfig,
- };
-
- return await UpdateAgentToolAsync(
- agentUuid: agentUuid,
- toolUuid: toolUuid,
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.g.cs
deleted file mode 100644
index 54d983b..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentToolsClient.g.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- ///
- /// 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 AgentToolsClient : global::ResembleAI.IAgentToolsClient, global::System.IDisposable
- {
- ///
- ///
- ///
- public const string DefaultBaseUrl = "https://app.resemble.ai/api/v2";
-
- 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::ResembleAI.AutoSDKClientOptions Options { get; }
-
-
- internal global::ResembleAI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ResembleAI.AutoSDKServerConfiguration();
- ///
- ///
- ///
- public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::ResembleAI.SourceGenerationContext.Default;
-
-
- ///
- /// Creates a new instance of the AgentToolsClient.
- /// 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 AgentToolsClient(
- 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 AgentToolsClient 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 AgentToolsClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true) : this(
- httpClient,
- baseUri: null,
- authorizations,
- options,
- disposeHttpClient: disposeHttpClient)
- {
- }
-
- ///
- /// Creates a new instance of the AgentToolsClient.
- /// 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 AgentToolsClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Uri? baseUri,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true)
- {
-
- HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
- if (baseUri is not null)
- {
- HttpClient.BaseAddress ??= baseUri;
- }
- Authorizations = authorizations ?? new global::System.Collections.Generic.List();
- Options = options ?? new global::ResembleAI.AutoSDKClientOptions();
- _disposeHttpClient = disposeHttpClient;
-
- AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
-
- 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);
-
-
- private global::System.Uri? ResolveBaseUri(
- global::ResembleAI.AutoSDKServer[] servers,
- string defaultBaseUrl)
- {
- if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
- {
- return explicitBaseUri;
- }
-
- if (AutoSDKServerConfiguration.SelectedServer is global::ResembleAI.AutoSDKServer selectedServer)
- {
- foreach (var server in servers)
- {
- if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
- {
- return server.Uri;
- }
- }
- }
-
- if (servers.Length > 0)
- {
- return servers[0].Uri;
- }
-
- return string.IsNullOrWhiteSpace(defaultBaseUrl)
- ? HttpClient.BaseAddress
- : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.CreateAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.CreateAgentWebhook.g.cs
deleted file mode 100644
index 04aaa82..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.CreateAgentWebhook.g.cs
+++ /dev/null
@@ -1,485 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentWebhooksClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_CreateAgentWebhookServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_CreateAgentWebhookSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_CreateAgentWebhookSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_CreateAgentWebhookSecurityRequirement0,
- };
- partial void PrepareCreateAgentWebhookArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- global::ResembleAI.CreateAgentWebhookRequest request);
- partial void PrepareCreateAgentWebhookRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::ResembleAI.CreateAgentWebhookRequest request);
- partial void ProcessCreateAgentWebhookResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessCreateAgentWebhookResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Create agent webhook
- /// Create a new webhook for an agent
- ///
- ///
- ///
- /// 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 CreateAgentWebhookAsync(
- global::System.Guid agentUuid,
-
- global::ResembleAI.CreateAgentWebhookRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await CreateAgentWebhookAsResponseAsync(
- agentUuid: agentUuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Create agent webhook
- /// Create a new webhook for an agent
- ///
- ///
- ///
- /// 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> CreateAgentWebhookAsResponseAsync(
- global::System.Guid agentUuid,
-
- global::ResembleAI.CreateAgentWebhookRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareCreateAgentWebhookArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_CreateAgentWebhookSecurityRequirements,
- operationName: "CreateAgentWebhookAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/webhooks",
- baseUri: ResolveBaseUri(
- servers: s_CreateAgentWebhookServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareCreateAgentWebhookRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentWebhook",
- methodName: "CreateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentWebhook",
- methodName: "CreateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentWebhook",
- methodName: "CreateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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::ResembleAI.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);
- ProcessCreateAgentWebhookResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentWebhook",
- methodName: "CreateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgentWebhook",
- methodName: "CreateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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);
- }
-
- 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);
- ProcessCreateAgentWebhookResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentWebhooksCreateAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentWebhooksCreateAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent webhook
- /// Create a new webhook for an agent
- ///
- ///
- ///
- ///
- /// 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 CreateAgentWebhookAsync(
- global::System.Guid agentUuid,
- global::ResembleAI.AgentsAgentUuidWebhooksPostRequestBodyContentApplicationJsonSchemaWebhookType webhookType,
- global::ResembleAI.AgentsAgentUuidWebhooksPostRequestBodyContentApplicationJsonSchemaWebhookConfig webhookConfig,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.CreateAgentWebhookRequest
- {
- WebhookType = webhookType,
- WebhookConfig = webhookConfig,
- };
-
- return await CreateAgentWebhookAsync(
- agentUuid: agentUuid,
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.DeleteAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.DeleteAgentWebhook.g.cs
deleted file mode 100644
index e5eeded..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.DeleteAgentWebhook.g.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentWebhooksClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_DeleteAgentWebhookServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_DeleteAgentWebhookSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_DeleteAgentWebhookSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_DeleteAgentWebhookSecurityRequirement0,
- };
- partial void PrepareDeleteAgentWebhookArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- ref global::System.Guid webhookUuid);
- partial void PrepareDeleteAgentWebhookRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid);
- partial void ProcessDeleteAgentWebhookResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessDeleteAgentWebhookResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Delete agent webhook
- /// Delete a webhook
- ///
- ///
- ///
- /// 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 DeleteAgentWebhookAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await DeleteAgentWebhookAsResponseAsync(
- agentUuid: agentUuid,
- webhookUuid: webhookUuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Delete agent webhook
- /// Delete a webhook
- ///
- ///
- ///
- /// 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> DeleteAgentWebhookAsResponseAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareDeleteAgentWebhookArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- webhookUuid: ref webhookUuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_DeleteAgentWebhookSecurityRequirements,
- operationName: "DeleteAgentWebhookAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/webhooks/{webhookUuid}",
- baseUri: ResolveBaseUri(
- servers: s_DeleteAgentWebhookServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareDeleteAgentWebhookRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- webhookUuid: webhookUuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentWebhook",
- methodName: "DeleteAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentWebhook",
- methodName: "DeleteAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentWebhook",
- methodName: "DeleteAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.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);
- ProcessDeleteAgentWebhookResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentWebhook",
- methodName: "DeleteAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgentWebhook",
- methodName: "DeleteAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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);
- }
-
- 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);
- ProcessDeleteAgentWebhookResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentWebhooksDeleteAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentWebhooksDeleteAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.GetAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.GetAgentWebhook.g.cs
deleted file mode 100644
index ff510e7..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.GetAgentWebhook.g.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentWebhooksClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_GetAgentWebhookServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_GetAgentWebhookSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_GetAgentWebhookSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_GetAgentWebhookSecurityRequirement0,
- };
- partial void PrepareGetAgentWebhookArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- ref global::System.Guid webhookUuid);
- partial void PrepareGetAgentWebhookRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid);
- partial void ProcessGetAgentWebhookResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessGetAgentWebhookResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Get agent webhook
- /// Get details of a specific webhook
- ///
- ///
- ///
- /// 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 GetAgentWebhookAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await GetAgentWebhookAsResponseAsync(
- agentUuid: agentUuid,
- webhookUuid: webhookUuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Get agent webhook
- /// Get details of a specific webhook
- ///
- ///
- ///
- /// 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> GetAgentWebhookAsResponseAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareGetAgentWebhookArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- webhookUuid: ref webhookUuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_GetAgentWebhookSecurityRequirements,
- operationName: "GetAgentWebhookAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/webhooks/{webhookUuid}",
- baseUri: ResolveBaseUri(
- servers: s_GetAgentWebhookServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareGetAgentWebhookRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- webhookUuid: webhookUuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentWebhook",
- methodName: "GetAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentWebhook",
- methodName: "GetAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentWebhook",
- methodName: "GetAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.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);
- ProcessGetAgentWebhookResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentWebhook",
- methodName: "GetAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentWebhook",
- methodName: "GetAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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);
- }
-
- 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);
- ProcessGetAgentWebhookResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentWebhooksGetAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentWebhooksGetAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.ListAgentWebhooks.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.ListAgentWebhooks.g.cs
deleted file mode 100644
index 5a85f41..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.ListAgentWebhooks.g.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentWebhooksClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ListAgentWebhooksServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ListAgentWebhooksSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ListAgentWebhooksSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ListAgentWebhooksSecurityRequirement0,
- };
- partial void PrepareListAgentWebhooksArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid);
- partial void PrepareListAgentWebhooksRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid);
- partial void ProcessListAgentWebhooksResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessListAgentWebhooksResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// List agent webhooks
- /// List all webhooks for an agent
- ///
- ///
- /// 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 ListAgentWebhooksAsync(
- global::System.Guid agentUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ListAgentWebhooksAsResponseAsync(
- agentUuid: agentUuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// List agent webhooks
- /// List all webhooks for an agent
- ///
- ///
- /// 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> ListAgentWebhooksAsResponseAsync(
- global::System.Guid agentUuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareListAgentWebhooksArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ListAgentWebhooksSecurityRequirements,
- operationName: "ListAgentWebhooksAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/webhooks",
- baseUri: ResolveBaseUri(
- servers: s_ListAgentWebhooksServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareListAgentWebhooksRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentWebhooks",
- methodName: "ListAgentWebhooksAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentWebhooks",
- methodName: "ListAgentWebhooksAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentWebhooks",
- methodName: "ListAgentWebhooksAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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::ResembleAI.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);
- ProcessListAgentWebhooksResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentWebhooks",
- methodName: "ListAgentWebhooksAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgentWebhooks",
- methodName: "ListAgentWebhooksAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks\"",
- 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);
- }
-
- 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);
- ProcessListAgentWebhooksResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentWebhooksListAgentWebhooksResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentWebhooksListAgentWebhooksResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.UpdateAgentWebhook.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.UpdateAgentWebhook.g.cs
deleted file mode 100644
index 4e017c1..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.UpdateAgentWebhook.g.cs
+++ /dev/null
@@ -1,494 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentWebhooksClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_UpdateAgentWebhookServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_UpdateAgentWebhookSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_UpdateAgentWebhookSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_UpdateAgentWebhookSecurityRequirement0,
- };
- partial void PrepareUpdateAgentWebhookArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid agentUuid,
- ref global::System.Guid webhookUuid,
- global::ResembleAI.UpdateAgentWebhookRequest request);
- partial void PrepareUpdateAgentWebhookRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
- global::ResembleAI.UpdateAgentWebhookRequest request);
- partial void ProcessUpdateAgentWebhookResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessUpdateAgentWebhookResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Update agent webhook
- /// Update an existing webhook
- ///
- ///
- ///
- ///
- /// 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 UpdateAgentWebhookAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
-
- global::ResembleAI.UpdateAgentWebhookRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await UpdateAgentWebhookAsResponseAsync(
- agentUuid: agentUuid,
- webhookUuid: webhookUuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Update agent webhook
- /// Update an existing webhook
- ///
- ///
- ///
- ///
- /// 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> UpdateAgentWebhookAsResponseAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
-
- global::ResembleAI.UpdateAgentWebhookRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareUpdateAgentWebhookArguments(
- httpClient: HttpClient,
- agentUuid: ref agentUuid,
- webhookUuid: ref webhookUuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_UpdateAgentWebhookSecurityRequirements,
- operationName: "UpdateAgentWebhookAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{agentUuid}/webhooks/{webhookUuid}",
- baseUri: ResolveBaseUri(
- servers: s_UpdateAgentWebhookServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareUpdateAgentWebhookRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- agentUuid: agentUuid!,
- webhookUuid: webhookUuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentWebhook",
- methodName: "UpdateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentWebhook",
- methodName: "UpdateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentWebhook",
- methodName: "UpdateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.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);
- ProcessUpdateAgentWebhookResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentWebhook",
- methodName: "UpdateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgentWebhook",
- methodName: "UpdateAgentWebhookAsync",
- pathTemplate: "$\"/agents/{agentUuid}/webhooks/{webhookUuid}\"",
- 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);
- }
-
- 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);
- ProcessUpdateAgentWebhookResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentWebhooksUpdateAgentWebhookResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentWebhooksUpdateAgentWebhookResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent webhook
- /// Update an existing webhook
- ///
- ///
- ///
- ///
- /// 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 UpdateAgentWebhookAsync(
- global::System.Guid agentUuid,
- global::System.Guid webhookUuid,
- global::ResembleAI.AgentsAgentUuidWebhooksWebhookUuidPatchRequestBodyContentApplicationJsonSchemaWebhookConfig? webhookConfig = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.UpdateAgentWebhookRequest
- {
- WebhookConfig = webhookConfig,
- };
-
- return await UpdateAgentWebhookAsync(
- agentUuid: agentUuid,
- webhookUuid: webhookUuid,
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.g.cs
deleted file mode 100644
index bee6dcc..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentWebhooksClient.g.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- ///
- /// 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 AgentWebhooksClient : global::ResembleAI.IAgentWebhooksClient, global::System.IDisposable
- {
- ///
- ///
- ///
- public const string DefaultBaseUrl = "https://app.resemble.ai/api/v2";
-
- 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::ResembleAI.AutoSDKClientOptions Options { get; }
-
-
- internal global::ResembleAI.AutoSDKServerConfiguration AutoSDKServerConfiguration { get; set; } = new global::ResembleAI.AutoSDKServerConfiguration();
- ///
- ///
- ///
- public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::ResembleAI.SourceGenerationContext.Default;
-
-
- ///
- /// Creates a new instance of the AgentWebhooksClient.
- /// 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 AgentWebhooksClient(
- 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 AgentWebhooksClient 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 AgentWebhooksClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true) : this(
- httpClient,
- baseUri: null,
- authorizations,
- options,
- disposeHttpClient: disposeHttpClient)
- {
- }
-
- ///
- /// Creates a new instance of the AgentWebhooksClient.
- /// 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 AgentWebhooksClient(
- global::System.Net.Http.HttpClient? httpClient,
- global::System.Uri? baseUri,
- global::System.Collections.Generic.List? authorizations,
- global::ResembleAI.AutoSDKClientOptions? options,
- bool disposeHttpClient = true)
- {
-
- HttpClient = httpClient ?? new global::System.Net.Http.HttpClient();
- if (baseUri is not null)
- {
- HttpClient.BaseAddress ??= baseUri;
- }
- Authorizations = authorizations ?? new global::System.Collections.Generic.List();
- Options = options ?? new global::ResembleAI.AutoSDKClientOptions();
- _disposeHttpClient = disposeHttpClient;
-
- AutoSDKServerConfiguration.ExplicitBaseUri = baseUri ?? httpClient?.BaseAddress;
-
- 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);
-
-
- private global::System.Uri? ResolveBaseUri(
- global::ResembleAI.AutoSDKServer[] servers,
- string defaultBaseUrl)
- {
- if (AutoSDKServerConfiguration.ExplicitBaseUri is global::System.Uri explicitBaseUri)
- {
- return explicitBaseUri;
- }
-
- if (AutoSDKServerConfiguration.SelectedServer is global::ResembleAI.AutoSDKServer selectedServer)
- {
- foreach (var server in servers)
- {
- if (string.Equals(server.Id, selectedServer.Id, global::System.StringComparison.Ordinal))
- {
- return server.Uri;
- }
- }
- }
-
- if (servers.Length > 0)
- {
- return servers[0].Uri;
- }
-
- return string.IsNullOrWhiteSpace(defaultBaseUrl)
- ? HttpClient.BaseAddress
- : new global::System.Uri(defaultBaseUrl, global::System.UriKind.RelativeOrAbsolute);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.CreateAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.CreateAgent.g.cs
deleted file mode 100644
index 4921901..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.CreateAgent.g.cs
+++ /dev/null
@@ -1,546 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_CreateAgentServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_CreateAgentSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_CreateAgentSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_CreateAgentSecurityRequirement0,
- };
- partial void PrepareCreateAgentArguments(
- global::System.Net.Http.HttpClient httpClient,
- global::ResembleAI.CreateAgentRequest request);
- partial void PrepareCreateAgentRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::ResembleAI.CreateAgentRequest request);
- partial void ProcessCreateAgentResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessCreateAgentResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Create agent
- /// Create a new voice agent
- ///
- ///
- /// 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 CreateAgentAsync(
-
- global::ResembleAI.CreateAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await CreateAgentAsResponseAsync(
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Create agent
- /// Create a new voice agent
- ///
- ///
- /// 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> CreateAgentAsResponseAsync(
-
- global::ResembleAI.CreateAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareCreateAgentArguments(
- httpClient: HttpClient,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_CreateAgentSecurityRequirements,
- operationName: "CreateAgentAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/agents",
- baseUri: ResolveBaseUri(
- servers: s_CreateAgentServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareCreateAgentRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgent",
- methodName: "CreateAgentAsync",
- pathTemplate: "\"/agents\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgent",
- methodName: "CreateAgentAsync",
- pathTemplate: "\"/agents\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgent",
- methodName: "CreateAgentAsync",
- pathTemplate: "\"/agents\"",
- 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::ResembleAI.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);
- ProcessCreateAgentResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgent",
- methodName: "CreateAgentAsync",
- pathTemplate: "\"/agents\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "CreateAgent",
- methodName: "CreateAgentAsync",
- pathTemplate: "\"/agents\"",
- 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);
- }
- // Validation error
- if ((int)__response.StatusCode == 400)
- {
- string? __content_400 = null;
- global::System.Exception? __exception_400 = null;
- global::ResembleAI.Error? __value_400 = null;
- try
- {
- if (__effectiveReadResponseAsString)
- {
- __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
- __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext);
- }
- else
- {
- __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
-
- __value_400 = global::ResembleAI.Error.FromJson(__content_400, JsonSerializerContext);
- }
- }
- catch (global::System.Exception __ex)
- {
- __exception_400 = __ex;
- }
-
-
- throw global::ResembleAI.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));
- }
-
- 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);
- ProcessCreateAgentResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsCreateAgentResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsCreateAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent
- /// Create a new voice agent
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- /// RAG search strategy - speed (faster) or accuracy (more thorough)
- /// Default Value: accuracy
- ///
- ///
- /// Number of relevant chunks to retrieve per query for RAG
- /// Default Value: 8
- ///
- ///
- ///
- /// 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 CreateAgentAsync(
- string name,
- string voiceUuid,
- int? phoneNumberId = default,
- global::System.Collections.Generic.IList? languages = default,
- object? dynamicVariables = default,
- global::ResembleAI.AgentsPostRequestBodyContentApplicationJsonSchemaAsr? asr = default,
- global::ResembleAI.AgentsPostRequestBodyContentApplicationJsonSchemaTurn? turn = default,
- global::ResembleAI.AgentsPostRequestBodyContentApplicationJsonSchemaLlm? llm = default,
- global::ResembleAI.AgentsPostRequestBodyContentApplicationJsonSchemaSearchMode? searchMode = default,
- int? maxChunksPerQuery = default,
- global::System.Collections.Generic.IList? webhooks = default,
- global::ResembleAI.AgentsPostRequestBodyContentApplicationJsonSchemaSystemTools? systemTools = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.CreateAgentRequest
- {
- Name = name,
- VoiceUuid = voiceUuid,
- PhoneNumberId = phoneNumberId,
- Languages = languages,
- DynamicVariables = dynamicVariables,
- Asr = asr,
- Turn = turn,
- Llm = llm,
- SearchMode = searchMode,
- MaxChunksPerQuery = maxChunksPerQuery,
- Webhooks = webhooks,
- SystemTools = systemTools,
- };
-
- return await CreateAgentAsync(
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.DeleteAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.DeleteAgent.g.cs
deleted file mode 100644
index 0a4385e..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.DeleteAgent.g.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_DeleteAgentServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_DeleteAgentSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_DeleteAgentSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_DeleteAgentSecurityRequirement0,
- };
- partial void PrepareDeleteAgentArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid uuid);
- partial void PrepareDeleteAgentRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid uuid);
- partial void ProcessDeleteAgentResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessDeleteAgentResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Delete agent
- /// Delete an agent and all its configurations
- ///
- ///
- /// 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 DeleteAgentAsync(
- global::System.Guid uuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await DeleteAgentAsResponseAsync(
- uuid: uuid,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Delete agent
- /// Delete an agent and all its configurations
- ///
- ///
- /// 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> DeleteAgentAsResponseAsync(
- global::System.Guid uuid,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareDeleteAgentArguments(
- httpClient: HttpClient,
- uuid: ref uuid);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_DeleteAgentSecurityRequirements,
- operationName: "DeleteAgentAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{uuid}",
- baseUri: ResolveBaseUri(
- servers: s_DeleteAgentServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareDeleteAgentRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- uuid: uuid!);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgent",
- methodName: "DeleteAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgent",
- methodName: "DeleteAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgent",
- methodName: "DeleteAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.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);
- ProcessDeleteAgentResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgent",
- methodName: "DeleteAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DeleteAgent",
- methodName: "DeleteAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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);
- }
-
- 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);
- ProcessDeleteAgentResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsDeleteAgentResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsDeleteAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentsClient.DispatchAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.DispatchAgent.g.cs
deleted file mode 100644
index 9031ad5..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.DispatchAgent.g.cs
+++ /dev/null
@@ -1,489 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_DispatchAgentServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_DispatchAgentSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_DispatchAgentSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_DispatchAgentSecurityRequirement0,
- };
- partial void PrepareDispatchAgentArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid uuid,
- global::ResembleAI.DispatchAgentRequest request);
- partial void PrepareDispatchAgentRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid uuid,
- global::ResembleAI.DispatchAgentRequest request);
- partial void ProcessDispatchAgentResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessDispatchAgentResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Dispatch agent
- /// Make an outbound call with an agent
- ///
- ///
- ///
- /// 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 DispatchAgentAsync(
- global::System.Guid uuid,
-
- global::ResembleAI.DispatchAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await DispatchAgentAsResponseAsync(
- uuid: uuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Dispatch agent
- /// Make an outbound call with an agent
- ///
- ///
- ///
- /// 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> DispatchAgentAsResponseAsync(
- global::System.Guid uuid,
-
- global::ResembleAI.DispatchAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareDispatchAgentArguments(
- httpClient: HttpClient,
- uuid: ref uuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_DispatchAgentSecurityRequirements,
- operationName: "DispatchAgentAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{uuid}/dispatch",
- baseUri: ResolveBaseUri(
- servers: s_DispatchAgentServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareDispatchAgentRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- uuid: uuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DispatchAgent",
- methodName: "DispatchAgentAsync",
- pathTemplate: "$\"/agents/{uuid}/dispatch\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DispatchAgent",
- methodName: "DispatchAgentAsync",
- pathTemplate: "$\"/agents/{uuid}/dispatch\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DispatchAgent",
- methodName: "DispatchAgentAsync",
- pathTemplate: "$\"/agents/{uuid}/dispatch\"",
- 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::ResembleAI.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);
- ProcessDispatchAgentResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DispatchAgent",
- methodName: "DispatchAgentAsync",
- pathTemplate: "$\"/agents/{uuid}/dispatch\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "DispatchAgent",
- methodName: "DispatchAgentAsync",
- pathTemplate: "$\"/agents/{uuid}/dispatch\"",
- 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);
- }
-
- 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);
- ProcessDispatchAgentResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsDispatchAgentResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsDispatchAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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();
- }
- }
- ///
- /// Dispatch agent
- /// Make an outbound call with an agent
- ///
- ///
- ///
- /// Destination phone number
- ///
- ///
- /// Runtime variable overrides
- ///
- /// 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 DispatchAgentAsync(
- global::System.Guid uuid,
- string phoneNumber,
- global::ResembleAI.AgentsUuidDispatchPostRequestBodyContentApplicationJsonSchemaDynamicVariables? dynamicVariables = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __request = new global::ResembleAI.DispatchAgentRequest
- {
- PhoneNumber = phoneNumber,
- DynamicVariables = dynamicVariables,
- };
-
- return await DispatchAgentAsync(
- uuid: uuid,
- request: __request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken).ConfigureAwait(false);
- }
- }
-}
\ No newline at end of file
diff --git a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetAgent.g.cs
deleted file mode 100644
index f563a11..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetAgent.g.cs
+++ /dev/null
@@ -1,452 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_GetAgentServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_GetAgentSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_GetAgentSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_GetAgentSecurityRequirement0,
- };
- partial void PrepareGetAgentArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid uuid,
- ref bool? advanced);
- partial void PrepareGetAgentRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid uuid,
- bool? advanced);
- partial void ProcessGetAgentResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessGetAgentResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Get agent
- /// Retrieve a specific agent's details
- ///
- ///
- ///
- /// Default Value: false
- ///
- /// 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 GetAgentAsync(
- global::System.Guid uuid,
- bool? advanced = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await GetAgentAsResponseAsync(
- uuid: uuid,
- advanced: advanced,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Get agent
- /// Retrieve a specific agent's details
- ///
- ///
- ///
- /// Default Value: false
- ///
- /// 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> GetAgentAsResponseAsync(
- global::System.Guid uuid,
- bool? advanced = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareGetAgentArguments(
- httpClient: HttpClient,
- uuid: ref uuid,
- advanced: ref advanced);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_GetAgentSecurityRequirements,
- operationName: "GetAgentAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{uuid}",
- baseUri: ResolveBaseUri(
- servers: s_GetAgentServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- __pathBuilder
- .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant())
- ;
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareGetAgentRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- uuid: uuid!,
- advanced: advanced);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgent",
- methodName: "GetAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgent",
- methodName: "GetAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgent",
- methodName: "GetAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.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);
- ProcessGetAgentResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgent",
- methodName: "GetAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgent",
- methodName: "GetAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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);
- }
-
- 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);
- ProcessGetAgentResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsGetAgentResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsGetAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentsClient.GetAgentCapabilities.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetAgentCapabilities.g.cs
deleted file mode 100644
index 4364ffd..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetAgentCapabilities.g.cs
+++ /dev/null
@@ -1,427 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_GetAgentCapabilitiesServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_GetAgentCapabilitiesSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_GetAgentCapabilitiesSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_GetAgentCapabilitiesSecurityRequirement0,
- };
- partial void PrepareGetAgentCapabilitiesArguments(
- global::System.Net.Http.HttpClient httpClient);
- partial void PrepareGetAgentCapabilitiesRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage);
- partial void ProcessGetAgentCapabilitiesResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessGetAgentCapabilitiesResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Get capabilities
- /// List supported ASR and LLM providers and models
- ///
- /// 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 GetAgentCapabilitiesAsync(
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await GetAgentCapabilitiesAsResponseAsync(
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Get capabilities
- /// List supported ASR and LLM providers and models
- ///
- /// 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> GetAgentCapabilitiesAsResponseAsync(
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareGetAgentCapabilitiesArguments(
- httpClient: HttpClient);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_GetAgentCapabilitiesSecurityRequirements,
- operationName: "GetAgentCapabilitiesAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/agents/capabilities",
- baseUri: ResolveBaseUri(
- servers: s_GetAgentCapabilitiesServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareGetAgentCapabilitiesRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentCapabilities",
- methodName: "GetAgentCapabilitiesAsync",
- pathTemplate: "\"/agents/capabilities\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentCapabilities",
- methodName: "GetAgentCapabilitiesAsync",
- pathTemplate: "\"/agents/capabilities\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentCapabilities",
- methodName: "GetAgentCapabilitiesAsync",
- pathTemplate: "\"/agents/capabilities\"",
- 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::ResembleAI.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);
- ProcessGetAgentCapabilitiesResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentCapabilities",
- methodName: "GetAgentCapabilitiesAsync",
- pathTemplate: "\"/agents/capabilities\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetAgentCapabilities",
- methodName: "GetAgentCapabilitiesAsync",
- pathTemplate: "\"/agents/capabilities\"",
- 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);
- }
-
- 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);
- ProcessGetAgentCapabilitiesResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsGetAgentCapabilitiesResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsGetAgentCapabilitiesResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentsClient.GetSystemTools.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetSystemTools.g.cs
deleted file mode 100644
index 819c127..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.GetSystemTools.g.cs
+++ /dev/null
@@ -1,427 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_GetSystemToolsServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_GetSystemToolsSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_GetSystemToolsSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_GetSystemToolsSecurityRequirement0,
- };
- partial void PrepareGetSystemToolsArguments(
- global::System.Net.Http.HttpClient httpClient);
- partial void PrepareGetSystemToolsRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage);
- partial void ProcessGetSystemToolsResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessGetSystemToolsResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Get system tools
- /// List available system tools
- ///
- /// 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 GetSystemToolsAsync(
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await GetSystemToolsAsResponseAsync(
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Get system tools
- /// List available system tools
- ///
- /// 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> GetSystemToolsAsResponseAsync(
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareGetSystemToolsArguments(
- httpClient: HttpClient);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_GetSystemToolsSecurityRequirements,
- operationName: "GetSystemToolsAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/agents/system-tools",
- baseUri: ResolveBaseUri(
- servers: s_GetSystemToolsServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareGetSystemToolsRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetSystemTools",
- methodName: "GetSystemToolsAsync",
- pathTemplate: "\"/agents/system-tools\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetSystemTools",
- methodName: "GetSystemToolsAsync",
- pathTemplate: "\"/agents/system-tools\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetSystemTools",
- methodName: "GetSystemToolsAsync",
- pathTemplate: "\"/agents/system-tools\"",
- 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::ResembleAI.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);
- ProcessGetSystemToolsResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetSystemTools",
- methodName: "GetSystemToolsAsync",
- pathTemplate: "\"/agents/system-tools\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "GetSystemTools",
- methodName: "GetSystemToolsAsync",
- pathTemplate: "\"/agents/system-tools\"",
- 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);
- }
-
- 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);
- ProcessGetSystemToolsResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsGetSystemToolsResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsGetSystemToolsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentsClient.ListAgents.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.ListAgents.g.cs
deleted file mode 100644
index 85a5e93..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.ListAgents.g.cs
+++ /dev/null
@@ -1,453 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_ListAgentsServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_ListAgentsSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_ListAgentsSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_ListAgentsSecurityRequirement0,
- };
- partial void PrepareListAgentsArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref string? phoneNumber,
- ref bool? advanced);
- partial void PrepareListAgentsRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- string? phoneNumber,
- bool? advanced);
- partial void ProcessListAgentsResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessListAgentsResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// List agents
- /// Retrieve all agents for the authenticated team
- ///
- ///
- ///
- /// Default Value: false
- ///
- /// 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 ListAgentsAsync(
- string? phoneNumber = default,
- bool? advanced = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await ListAgentsAsResponseAsync(
- phoneNumber: phoneNumber,
- advanced: advanced,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// List agents
- /// Retrieve all agents for the authenticated team
- ///
- ///
- ///
- /// Default Value: false
- ///
- /// 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> ListAgentsAsResponseAsync(
- string? phoneNumber = default,
- bool? advanced = default,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- PrepareArguments(
- client: HttpClient);
- PrepareListAgentsArguments(
- httpClient: HttpClient,
- phoneNumber: ref phoneNumber,
- advanced: ref advanced);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_ListAgentsSecurityRequirements,
- operationName: "ListAgentsAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: "/agents",
- baseUri: ResolveBaseUri(
- servers: s_ListAgentsServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- __pathBuilder
- .AddOptionalParameter("phone_number", phoneNumber)
- .AddOptionalParameter("advanced", advanced?.ToString().ToLowerInvariant())
- ;
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- global::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareListAgentsRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- phoneNumber: phoneNumber,
- advanced: advanced);
-
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgents",
- methodName: "ListAgentsAsync",
- pathTemplate: "\"/agents\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgents",
- methodName: "ListAgentsAsync",
- pathTemplate: "\"/agents\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgents",
- methodName: "ListAgentsAsync",
- pathTemplate: "\"/agents\"",
- 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::ResembleAI.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);
- ProcessListAgentsResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgents",
- methodName: "ListAgentsAsync",
- pathTemplate: "\"/agents\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "ListAgents",
- methodName: "ListAgentsAsync",
- pathTemplate: "\"/agents\"",
- 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);
- }
-
- 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);
- ProcessListAgentsResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsListAgentsResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsListAgentsResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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/ResembleAI/Generated/ResembleAI.AgentsClient.UpdateAgent.g.cs b/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.UpdateAgent.g.cs
deleted file mode 100644
index df3f942..0000000
--- a/src/libs/ResembleAI/Generated/ResembleAI.AgentsClient.UpdateAgent.g.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-
-#nullable enable
-
-namespace ResembleAI
-{
- public partial class AgentsClient
- {
-
- private static readonly global::ResembleAI.AutoSDKServer[] s_UpdateAgentServers = new global::ResembleAI.AutoSDKServer[]
- { new global::ResembleAI.AutoSDKServer(
- id: "https-app-resemble-ai-api-v2",
- name: "app.resemble.ai api v2",
- url: "https://app.resemble.ai/api/v2",
- description: ""),
- };
-
-
- private static readonly global::ResembleAI.EndPointSecurityRequirement s_UpdateAgentSecurityRequirement0 =
- new global::ResembleAI.EndPointSecurityRequirement
- {
- Authorizations = new global::ResembleAI.EndPointAuthorizationRequirement[]
- { new global::ResembleAI.EndPointAuthorizationRequirement
- {
- Type = "Http",
- SchemeId = "HttpBearer",
- Location = "Header",
- Name = "Bearer",
- FriendlyName = "Bearer",
- },
- },
- };
- private static readonly global::ResembleAI.EndPointSecurityRequirement[] s_UpdateAgentSecurityRequirements =
- new global::ResembleAI.EndPointSecurityRequirement[]
- { s_UpdateAgentSecurityRequirement0,
- };
- partial void PrepareUpdateAgentArguments(
- global::System.Net.Http.HttpClient httpClient,
- ref global::System.Guid uuid,
- global::ResembleAI.UpdateAgentRequest request);
- partial void PrepareUpdateAgentRequest(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpRequestMessage httpRequestMessage,
- global::System.Guid uuid,
- global::ResembleAI.UpdateAgentRequest request);
- partial void ProcessUpdateAgentResponse(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage);
-
- partial void ProcessUpdateAgentResponseContent(
- global::System.Net.Http.HttpClient httpClient,
- global::System.Net.Http.HttpResponseMessage httpResponseMessage,
- ref string content);
-
- ///
- /// Update agent
- /// Update an existing agent's configuration
- ///
- ///
- ///
- /// 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 UpdateAgentAsync(
- global::System.Guid uuid,
-
- global::ResembleAI.UpdateAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var __response = await UpdateAgentAsResponseAsync(
- uuid: uuid,
-
- request: request,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
-
- return __response.Body;
- }
- ///
- /// Update agent
- /// Update an existing agent's configuration
- ///
- ///
- ///
- /// 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> UpdateAgentAsResponseAsync(
- global::System.Guid uuid,
-
- global::ResembleAI.UpdateAgentRequest request,
- global::ResembleAI.AutoSDKRequestOptions? requestOptions = default,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- request = request ?? throw new global::System.ArgumentNullException(nameof(request));
-
- PrepareArguments(
- client: HttpClient);
- PrepareUpdateAgentArguments(
- httpClient: HttpClient,
- uuid: ref uuid,
- request: request);
-
-
- var __authorizations = global::ResembleAI.EndPointSecurityResolver.ResolveAuthorizations(
- availableAuthorizations: Authorizations,
- securityRequirements: s_UpdateAgentSecurityRequirements,
- operationName: "UpdateAgentAsync");
-
- using var __timeoutCancellationTokenSource = global::ResembleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
- clientOptions: Options,
- requestOptions: requestOptions,
- cancellationToken: cancellationToken);
- var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
- var __effectiveReadResponseAsString = global::ResembleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
- clientOptions: Options,
- requestOptions: requestOptions,
- fallbackValue: ReadResponseAsString);
- var __maxAttempts = global::ResembleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts(
- clientOptions: Options,
- requestOptions: requestOptions,
- supportsRetry: true);
-
- global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
- {
-
- var __pathBuilder = new global::ResembleAI.PathBuilder(
- path: $"/agents/{uuid}",
- baseUri: ResolveBaseUri(
- servers: s_UpdateAgentServers,
- defaultBaseUrl: "https://app.resemble.ai/api/v2"));
- var __path = __pathBuilder.ToString();
- __path = global::ResembleAI.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);
- }
- }
- 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::ResembleAI.AutoSDKRequestOptionsSupport.ApplyHeaders(
- request: __httpRequest,
- clientHeaders: Options.Headers,
- requestHeaders: requestOptions?.Headers);
-
- PrepareRequest(
- client: HttpClient,
- request: __httpRequest);
- PrepareUpdateAgentRequest(
- httpClient: HttpClient,
- httpRequestMessage: __httpRequest,
- uuid: uuid!,
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgent",
- methodName: "UpdateAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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 HttpClient.SendAsync(
- request: __httpRequest,
- completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- }
- catch (global::System.Net.Http.HttpRequestException __exception)
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: null,
- attempt: __attempt);
- var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgent",
- methodName: "UpdateAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- retryDelay: __retryDelay,
- cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
- continue;
- }
-
- if (__response != null &&
- __attempt < __maxAttempts &&
- global::ResembleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
- {
- var __retryDelay = global::ResembleAI.AutoSDKRequestOptionsSupport.GetRetryDelay(
- clientOptions: Options,
- requestOptions: requestOptions,
- response: __response,
- attempt: __attempt);
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgent",
- methodName: "UpdateAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.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);
- ProcessUpdateAgentResponse(
- httpClient: HttpClient,
- httpResponseMessage: __response);
- if (__response.IsSuccessStatusCode)
- {
- await global::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgent",
- methodName: "UpdateAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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::ResembleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
- clientOptions: Options,
- context: global::ResembleAI.AutoSDKRequestOptionsSupport.CreateHookContext(
- operationId: "UpdateAgent",
- methodName: "UpdateAgentAsync",
- pathTemplate: "$\"/agents/{uuid}\"",
- 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);
- }
-
- 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);
- ProcessUpdateAgentResponseContent(
- httpClient: HttpClient,
- httpResponseMessage: __response,
- content: ref __content);
-
- try
- {
- __response.EnsureSuccessStatusCode();
-
- var __value = global::ResembleAI.AgentsUpdateAgentResponse200.FromJson(__content, JsonSerializerContext) ??
- throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.AutoSDKHttpResponse.CreateHeaders(__response),
- requestUri: __response.RequestMessage?.RequestUri,
- body: __value);
- }
- catch (global::System.Exception __ex)
- {
- throw global::ResembleAI.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::ResembleAI.AgentsUpdateAgentResponse200.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
- throw new global::System.InvalidOperationException("Response deserialization failed.");
- return new global::ResembleAI.AutoSDKHttpResponse(
- statusCode: __response.StatusCode,
- headers: global::ResembleAI.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::ResembleAI.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 agent
- /// Update an existing agent's configuration
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- /// RAG search strategy
- ///
- ///
- /// Number of chunks to retrieve per query for RAG
- ///
- ///
- ///
- /// 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 UpdateAgentAsync(
- global::System.Guid uuid,
- string? name = default,
- string? voiceUuid = default,
- int? phoneNumberId = default,
- global::System.Collections.Generic.IList? languages = default,
- global::ResembleAI.AgentsUuidPatchRequestBodyContentApplicationJsonSchemaDynamicVariables? dynamicVariables = default,
- global::ResembleAI.AgentsUuidPatchRequestBodyContentApplicationJsonSchemaAsr? asr = default,
- global::ResembleAI.AgentsUuidPatchRequestBodyContentApplicationJsonSchemaTurn? turn = default,
- global::ResembleAI.AgentsUuidPatchRequestBodyContentApplicationJsonSchemaLlm? llm = default,
- global::ResembleAI.AgentsUuidPatchRequestBodyContentApplicationJsonSchemaSearchMode? searchMode = default,
- int? maxChunksPerQuery = default,
- global::System.Collections.Generic.IList