From ae5233e72e3b606e58b452f080f8b486d524ab86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 May 2026 04:15:04 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...tControllerAssistantRecordingDownload.g.cs | 504 ++++++++++++++++++ ...allArtifactControllerCallLogsDownload.g.cs | 504 ++++++++++++++++++ ...ctControllerCustomerRecordingDownload.g.cs | 504 ++++++++++++++++++ ...tifactControllerMonoRecordingDownload.g.cs | 504 ++++++++++++++++++ ...nt.CallArtifactControllerPcapDownload.g.cs | 504 ++++++++++++++++++ ...factControllerStereoRecordingDownload.g.cs | 504 ++++++++++++++++++ ...ifactControllerVideoRecordingDownload.g.cs | 504 ++++++++++++++++++ ...tControllerAssistantRecordingDownload.g.cs | 30 ++ ...allArtifactControllerCallLogsDownload.g.cs | 30 ++ ...ctControllerCustomerRecordingDownload.g.cs | 30 ++ ...tifactControllerMonoRecordingDownload.g.cs | 30 ++ ...nt.CallArtifactControllerPcapDownload.g.cs | 30 ++ ...factControllerStereoRecordingDownload.g.cs | 30 ++ ...ifactControllerVideoRecordingDownload.g.cs | 30 ++ src/libs/Vapi/openapi.yaml | 280 ++++++++++ 15 files changed, 4018 insertions(+) create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCallLogsDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerMonoRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerPcapDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerStereoRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerVideoRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCallLogsDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerMonoRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerPcapDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerStereoRecordingDownload.g.cs create mode 100644 src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerVideoRecordingDownload.g.cs diff --git a/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs new file mode 100644 index 0000000..e21f723 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerAssistantRecordingDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerAssistantRecordingDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerAssistantRecordingDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerAssistantRecordingDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerAssistantRecordingDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerAssistantRecordingDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Assistant Recording + /// + /// + /// 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 CallArtifactControllerAssistantRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerAssistantRecordingDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Assistant Recording + /// + /// + /// 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 CallArtifactControllerAssistantRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerAssistantRecordingDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerAssistantRecordingDownloadSecurityRequirements, + operationName: "CallArtifactControllerAssistantRecordingDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/assistant-recording", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerAssistantRecordingDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerAssistantRecordingDownload", + methodName: "CallArtifactControllerAssistantRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/assistant-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerAssistantRecordingDownload", + methodName: "CallArtifactControllerAssistantRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/assistant-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerAssistantRecordingDownload", + methodName: "CallArtifactControllerAssistantRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/assistant-recording\"", + 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::Vapi.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); + ProcessCallArtifactControllerAssistantRecordingDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerAssistantRecordingDownload", + methodName: "CallArtifactControllerAssistantRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/assistant-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerAssistantRecordingDownload", + methodName: "CallArtifactControllerAssistantRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/assistant-recording\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCallLogsDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCallLogsDownload.g.cs new file mode 100644 index 0000000..2241961 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCallLogsDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerCallLogsDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerCallLogsDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerCallLogsDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerCallLogsDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerCallLogsDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerCallLogsDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Logs + /// + /// + /// 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 CallArtifactControllerCallLogsDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerCallLogsDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Logs + /// + /// + /// 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 CallArtifactControllerCallLogsDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerCallLogsDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerCallLogsDownloadSecurityRequirements, + operationName: "CallArtifactControllerCallLogsDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/call-logs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerCallLogsDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCallLogsDownload", + methodName: "CallArtifactControllerCallLogsDownloadAsync", + pathTemplate: "$\"/call/{id}/call-logs\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCallLogsDownload", + methodName: "CallArtifactControllerCallLogsDownloadAsync", + pathTemplate: "$\"/call/{id}/call-logs\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCallLogsDownload", + methodName: "CallArtifactControllerCallLogsDownloadAsync", + pathTemplate: "$\"/call/{id}/call-logs\"", + 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::Vapi.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); + ProcessCallArtifactControllerCallLogsDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCallLogsDownload", + methodName: "CallArtifactControllerCallLogsDownloadAsync", + pathTemplate: "$\"/call/{id}/call-logs\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCallLogsDownload", + methodName: "CallArtifactControllerCallLogsDownloadAsync", + pathTemplate: "$\"/call/{id}/call-logs\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs new file mode 100644 index 0000000..f9c14a9 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerCustomerRecordingDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerCustomerRecordingDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerCustomerRecordingDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerCustomerRecordingDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerCustomerRecordingDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerCustomerRecordingDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Customer Recording + /// + /// + /// 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 CallArtifactControllerCustomerRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerCustomerRecordingDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Customer Recording + /// + /// + /// 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 CallArtifactControllerCustomerRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerCustomerRecordingDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerCustomerRecordingDownloadSecurityRequirements, + operationName: "CallArtifactControllerCustomerRecordingDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/customer-recording", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerCustomerRecordingDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCustomerRecordingDownload", + methodName: "CallArtifactControllerCustomerRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/customer-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCustomerRecordingDownload", + methodName: "CallArtifactControllerCustomerRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/customer-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCustomerRecordingDownload", + methodName: "CallArtifactControllerCustomerRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/customer-recording\"", + 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::Vapi.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); + ProcessCallArtifactControllerCustomerRecordingDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCustomerRecordingDownload", + methodName: "CallArtifactControllerCustomerRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/customer-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerCustomerRecordingDownload", + methodName: "CallArtifactControllerCustomerRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/customer-recording\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerMonoRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerMonoRecordingDownload.g.cs new file mode 100644 index 0000000..018a2ac --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerMonoRecordingDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerMonoRecordingDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerMonoRecordingDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerMonoRecordingDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerMonoRecordingDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerMonoRecordingDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerMonoRecordingDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Mono Recording + /// + /// + /// 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 CallArtifactControllerMonoRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerMonoRecordingDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Mono Recording + /// + /// + /// 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 CallArtifactControllerMonoRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerMonoRecordingDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerMonoRecordingDownloadSecurityRequirements, + operationName: "CallArtifactControllerMonoRecordingDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/mono-recording", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerMonoRecordingDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerMonoRecordingDownload", + methodName: "CallArtifactControllerMonoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/mono-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerMonoRecordingDownload", + methodName: "CallArtifactControllerMonoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/mono-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerMonoRecordingDownload", + methodName: "CallArtifactControllerMonoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/mono-recording\"", + 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::Vapi.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); + ProcessCallArtifactControllerMonoRecordingDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerMonoRecordingDownload", + methodName: "CallArtifactControllerMonoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/mono-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerMonoRecordingDownload", + methodName: "CallArtifactControllerMonoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/mono-recording\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerPcapDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerPcapDownload.g.cs new file mode 100644 index 0000000..d1f909a --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerPcapDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerPcapDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerPcapDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerPcapDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerPcapDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerPcapDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerPcapDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Packet Capture (pcap) + /// + /// + /// 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 CallArtifactControllerPcapDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerPcapDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Packet Capture (pcap) + /// + /// + /// 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 CallArtifactControllerPcapDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerPcapDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerPcapDownloadSecurityRequirements, + operationName: "CallArtifactControllerPcapDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/pcap", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerPcapDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerPcapDownload", + methodName: "CallArtifactControllerPcapDownloadAsync", + pathTemplate: "$\"/call/{id}/pcap\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerPcapDownload", + methodName: "CallArtifactControllerPcapDownloadAsync", + pathTemplate: "$\"/call/{id}/pcap\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerPcapDownload", + methodName: "CallArtifactControllerPcapDownloadAsync", + pathTemplate: "$\"/call/{id}/pcap\"", + 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::Vapi.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); + ProcessCallArtifactControllerPcapDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerPcapDownload", + methodName: "CallArtifactControllerPcapDownloadAsync", + pathTemplate: "$\"/call/{id}/pcap\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerPcapDownload", + methodName: "CallArtifactControllerPcapDownloadAsync", + pathTemplate: "$\"/call/{id}/pcap\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerStereoRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerStereoRecordingDownload.g.cs new file mode 100644 index 0000000..64797a9 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerStereoRecordingDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerStereoRecordingDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerStereoRecordingDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerStereoRecordingDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerStereoRecordingDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerStereoRecordingDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerStereoRecordingDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Stereo Recording + /// + /// + /// 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 CallArtifactControllerStereoRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerStereoRecordingDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Stereo Recording + /// + /// + /// 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 CallArtifactControllerStereoRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerStereoRecordingDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerStereoRecordingDownloadSecurityRequirements, + operationName: "CallArtifactControllerStereoRecordingDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/stereo-recording", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerStereoRecordingDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerStereoRecordingDownload", + methodName: "CallArtifactControllerStereoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/stereo-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerStereoRecordingDownload", + methodName: "CallArtifactControllerStereoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/stereo-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerStereoRecordingDownload", + methodName: "CallArtifactControllerStereoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/stereo-recording\"", + 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::Vapi.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); + ProcessCallArtifactControllerStereoRecordingDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerStereoRecordingDownload", + methodName: "CallArtifactControllerStereoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/stereo-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerStereoRecordingDownload", + methodName: "CallArtifactControllerStereoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/stereo-recording\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerVideoRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerVideoRecordingDownload.g.cs new file mode 100644 index 0000000..81649bf --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.CallsClient.CallArtifactControllerVideoRecordingDownload.g.cs @@ -0,0 +1,504 @@ + +#nullable enable + +namespace Vapi +{ + public partial class CallsClient + { + + + private static readonly global::Vapi.EndPointSecurityRequirement s_CallArtifactControllerVideoRecordingDownloadSecurityRequirement0 = + new global::Vapi.EndPointSecurityRequirement + { + Authorizations = new global::Vapi.EndPointAuthorizationRequirement[] + { new global::Vapi.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Vapi.EndPointSecurityRequirement[] s_CallArtifactControllerVideoRecordingDownloadSecurityRequirements = + new global::Vapi.EndPointSecurityRequirement[] + { s_CallArtifactControllerVideoRecordingDownloadSecurityRequirement0, + }; + partial void PrepareCallArtifactControllerVideoRecordingDownloadArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid id); + partial void PrepareCallArtifactControllerVideoRecordingDownloadRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid id); + partial void ProcessCallArtifactControllerVideoRecordingDownloadResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Download Call Video Recording + /// + /// + /// 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 CallArtifactControllerVideoRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await CallArtifactControllerVideoRecordingDownloadAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Download Call Video Recording + /// + /// + /// 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 CallArtifactControllerVideoRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCallArtifactControllerVideoRecordingDownloadArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::Vapi.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CallArtifactControllerVideoRecordingDownloadSecurityRequirements, + operationName: "CallArtifactControllerVideoRecordingDownloadAsync"); + + using var __timeoutCancellationTokenSource = global::Vapi.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Vapi.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Vapi.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Vapi.PathBuilder( + path: $"/call/{id}/video-recording", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Vapi.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::Vapi.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCallArtifactControllerVideoRecordingDownloadRequest( + 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::Vapi.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerVideoRecordingDownload", + methodName: "CallArtifactControllerVideoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/video-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerVideoRecordingDownload", + methodName: "CallArtifactControllerVideoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/video-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Vapi.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Vapi.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerVideoRecordingDownload", + methodName: "CallArtifactControllerVideoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/video-recording\"", + 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::Vapi.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); + ProcessCallArtifactControllerVideoRecordingDownloadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Vapi.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerVideoRecordingDownload", + methodName: "CallArtifactControllerVideoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/video-recording\"", + 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::Vapi.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Vapi.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CallArtifactControllerVideoRecordingDownload", + methodName: "CallArtifactControllerVideoRecordingDownloadAsync", + pathTemplate: "$\"/call/{id}/video-recording\"", + 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 ((int)__response.StatusCode == 302) + { + string? __content_302 = null; + global::System.Exception? __exception_302 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_302 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_302 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_302 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_302, + statusCode: __response.StatusCode) + { + ResponseBody = __content_302, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::Vapi.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Vapi.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Vapi.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Vapi.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + 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/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs new file mode 100644 index 0000000..a30aecd --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerAssistantRecordingDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Assistant Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerAssistantRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Assistant Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerAssistantRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCallLogsDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCallLogsDownload.g.cs new file mode 100644 index 0000000..bae177f --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCallLogsDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Logs + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerCallLogsDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Logs + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerCallLogsDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs new file mode 100644 index 0000000..b69e1e9 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerCustomerRecordingDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Customer Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerCustomerRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Customer Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerCustomerRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerMonoRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerMonoRecordingDownload.g.cs new file mode 100644 index 0000000..3af6a80 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerMonoRecordingDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Mono Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerMonoRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Mono Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerMonoRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerPcapDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerPcapDownload.g.cs new file mode 100644 index 0000000..3db764f --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerPcapDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Packet Capture (pcap) + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerPcapDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Packet Capture (pcap) + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerPcapDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerStereoRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerStereoRecordingDownload.g.cs new file mode 100644 index 0000000..1b463d9 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerStereoRecordingDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Stereo Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerStereoRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Stereo Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerStereoRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerVideoRecordingDownload.g.cs b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerVideoRecordingDownload.g.cs new file mode 100644 index 0000000..a0a05e1 --- /dev/null +++ b/src/libs/Vapi/Generated/Vapi.ICallsClient.CallArtifactControllerVideoRecordingDownload.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace Vapi +{ + public partial interface ICallsClient + { + /// + /// Download Call Video Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerVideoRecordingDownloadAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download Call Video Recording + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CallArtifactControllerVideoRecordingDownloadAsResponseAsync( + global::System.Guid id, + global::Vapi.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Vapi/openapi.yaml b/src/libs/Vapi/openapi.yaml index b571e45..fa5dde3 100644 --- a/src/libs/Vapi/openapi.yaml +++ b/src/libs/Vapi/openapi.yaml @@ -865,6 +865,286 @@ ] } }, + "/call/{id}/mono-recording": { + "get": { + "operationId": "CallArtifactController_monoRecordingDownload", + "summary": "Download Call Mono Recording", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the recording." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/call/{id}/stereo-recording": { + "get": { + "operationId": "CallArtifactController_stereoRecordingDownload", + "summary": "Download Call Stereo Recording", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the recording." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/call/{id}/video-recording": { + "get": { + "operationId": "CallArtifactController_videoRecordingDownload", + "summary": "Download Call Video Recording", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the video." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/call/{id}/customer-recording": { + "get": { + "operationId": "CallArtifactController_customerRecordingDownload", + "summary": "Download Call Customer Recording", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the recording." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/call/{id}/assistant-recording": { + "get": { + "operationId": "CallArtifactController_assistantRecordingDownload", + "summary": "Download Call Assistant Recording", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the recording." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/call/{id}/pcap": { + "get": { + "operationId": "CallArtifactController_pcapDownload", + "summary": "Download Call Packet Capture (pcap)", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the pcap file." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/call/{id}/call-logs": { + "get": { + "operationId": "CallArtifactController_callLogsDownload", + "summary": "Download Call Logs", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "description": "Call ID", + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "302": { + "description": "Redirect to a short-lived presigned URL for the log file." + }, + "401": { + "description": "Unauthorized — missing or invalid API token." + }, + "404": { + "description": "Artifact not found." + } + }, + "tags": [ + "Calls" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, "/chat": { "get": { "operationId": "ChatController_listChats",