From 110b5f63a94579ae5e61de1f15a598664d968b98 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 May 2026 16:24:17 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Browserbase.AutoSDKHttpResponse.g.cs | 121 +++ ...base.BrowserbaseClient.ContextsCreate.g.cs | 65 +- ...base.BrowserbaseClient.ContextsDelete.g.cs | 53 +- ...serbase.BrowserbaseClient.ContextsGet.g.cs | 63 +- ...base.BrowserbaseClient.ContextsUpdate.g.cs | 63 +- ...ase.BrowserbaseClient.DownloadsDelete.g.cs | 54 +- ...erbase.BrowserbaseClient.DownloadsGet.g.cs | 64 +- ...rbase.BrowserbaseClient.DownloadsList.g.cs | 96 +- ...se.BrowserbaseClient.ExtensionsDelete.g.cs | 53 +- ...rbase.BrowserbaseClient.ExtensionsGet.g.cs | 63 +- ...se.BrowserbaseClient.ExtensionsUpload.g.cs | 895 ++++++++++++++++- ...serbase.BrowserbaseClient.FetchCreate.g.cs | 66 +- ...e.BrowserbaseClient.FunctionBuildsGet.g.cs | 63 +- ...owserbaseClient.FunctionBuildsGetLogs.g.cs | 63 +- ....BrowserbaseClient.FunctionBuildsList.g.cs | 77 +- ...BrowserbaseClient.FunctionVersionsGet.g.cs | 63 +- ...lient.FunctionVersionsListInvocations.g.cs | 80 +- ...erbase.BrowserbaseClient.FunctionsGet.g.cs | 63 +- ...ase.BrowserbaseClient.FunctionsInvoke.g.cs | 68 +- ...rbase.BrowserbaseClient.FunctionsList.g.cs | 74 +- ...owserbaseClient.FunctionsListVersions.g.cs | 77 +- ...base.BrowserbaseClient.InvocationsGet.g.cs | 63 +- ....BrowserbaseClient.InvocationsGetLogs.g.cs | 63 +- ...serbase.BrowserbaseClient.ProjectsGet.g.cs | 63 +- ...erbase.BrowserbaseClient.ProjectsList.g.cs | 60 +- ...rbase.BrowserbaseClient.ProjectsUsage.g.cs | 63 +- ...owserbase.BrowserbaseClient.SearchWeb.g.cs | 66 +- ...base.BrowserbaseClient.SessionsCreate.g.cs | 72 +- ...serbase.BrowserbaseClient.SessionsGet.g.cs | 63 +- ...se.BrowserbaseClient.SessionsGetDebug.g.cs | 63 +- ...ase.BrowserbaseClient.SessionsGetLogs.g.cs | 63 +- ...rowserbaseClient.SessionsGetRecording.g.cs | 63 +- ...erbase.BrowserbaseClient.SessionsList.g.cs | 70 +- ...base.BrowserbaseClient.SessionsUpdate.g.cs | 68 +- ....BrowserbaseClient.SessionsUploadFile.g.cs | 915 +++++++++++++++++- .../Browserbase.BrowserbaseClient.g.cs | 8 +- ...ase.IBrowserbaseClient.ContextsCreate.g.cs | 12 + ...ase.IBrowserbaseClient.ContextsDelete.g.cs | 11 + ...erbase.IBrowserbaseClient.ContextsGet.g.cs | 11 + ...ase.IBrowserbaseClient.ContextsUpdate.g.cs | 11 + ...se.IBrowserbaseClient.DownloadsDelete.g.cs | 12 + ...rbase.IBrowserbaseClient.DownloadsGet.g.cs | 12 + ...base.IBrowserbaseClient.DownloadsList.g.cs | 32 + ...e.IBrowserbaseClient.ExtensionsDelete.g.cs | 11 + ...base.IBrowserbaseClient.ExtensionsGet.g.cs | 11 + ...e.IBrowserbaseClient.ExtensionsUpload.g.cs | 43 + ...erbase.IBrowserbaseClient.FetchCreate.g.cs | 13 + ....IBrowserbaseClient.FunctionBuildsGet.g.cs | 11 + ...owserbaseClient.FunctionBuildsGetLogs.g.cs | 11 + ...IBrowserbaseClient.FunctionBuildsList.g.cs | 19 + ...BrowserbaseClient.FunctionVersionsGet.g.cs | 11 + ...lient.FunctionVersionsListInvocations.g.cs | 21 + ...rbase.IBrowserbaseClient.FunctionsGet.g.cs | 11 + ...se.IBrowserbaseClient.FunctionsInvoke.g.cs | 14 + ...base.IBrowserbaseClient.FunctionsList.g.cs | 17 + ...owserbaseClient.FunctionsListVersions.g.cs | 19 + ...ase.IBrowserbaseClient.InvocationsGet.g.cs | 11 + ...IBrowserbaseClient.InvocationsGetLogs.g.cs | 11 + ...erbase.IBrowserbaseClient.ProjectsGet.g.cs | 11 + ...rbase.IBrowserbaseClient.ProjectsList.g.cs | 9 + ...base.IBrowserbaseClient.ProjectsUsage.g.cs | 11 + ...wserbase.IBrowserbaseClient.SearchWeb.g.cs | 13 + ...ase.IBrowserbaseClient.SessionsCreate.g.cs | 19 + ...erbase.IBrowserbaseClient.SessionsGet.g.cs | 11 + ...e.IBrowserbaseClient.SessionsGetDebug.g.cs | 11 + ...se.IBrowserbaseClient.SessionsGetLogs.g.cs | 11 + ...rowserbaseClient.SessionsGetRecording.g.cs | 11 + ...rbase.IBrowserbaseClient.SessionsList.g.cs | 13 + ...ase.IBrowserbaseClient.SessionsUpdate.g.cs | 14 + ...IBrowserbaseClient.SessionsUploadFile.g.cs | 49 + .../Generated/Browserbase.OptionsSupport.g.cs | 231 ++++- 71 files changed, 4512 insertions(+), 284 deletions(-) create mode 100644 src/libs/Browserbase/Generated/Browserbase.AutoSDKHttpResponse.g.cs diff --git a/src/libs/Browserbase/Generated/Browserbase.AutoSDKHttpResponse.g.cs b/src/libs/Browserbase/Generated/Browserbase.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..f972658 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsCreate.g.cs index c04375a..b3af24f 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsCreate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsCreate.g.cs @@ -50,6 +50,28 @@ partial void ProcessContextsCreateResponseContent( /// public async global::System.Threading.Tasks.Task ContextsCreateAsync( + global::Browserbase.ContextsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContextsCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a Context + /// + /// + /// 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> ContextsCreateAsResponseAsync( + global::Browserbase.ContextsCreateRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessContextsCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/contexts", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessContextsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessContextsCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -190,6 +220,8 @@ partial void ProcessContextsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -199,8 +231,7 @@ partial void ProcessContextsCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -209,6 +240,11 @@ partial void ProcessContextsCreateResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -225,14 +261,15 @@ partial void ProcessContextsCreateResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +309,8 @@ partial void ProcessContextsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessContextsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -316,9 +357,13 @@ partial void ProcessContextsCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.ContextsCreateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.ContextsCreateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -346,9 +391,13 @@ partial void ProcessContextsCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.ContextsCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.ContextsCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsDelete.g.cs index 5f69215..c7b5ec1 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsDelete.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsDelete.g.cs @@ -47,6 +47,24 @@ partial void ProcessContextsDeleteResponse( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await ContextsDeleteAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a Context + /// + /// + /// 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 ContextsDeleteAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessContextsDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/contexts/{id}", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessContextsDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessContextsDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +202,8 @@ partial void ProcessContextsDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +213,7 @@ partial void ProcessContextsDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +222,11 @@ partial void ProcessContextsDeleteResponse( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +243,15 @@ partial void ProcessContextsDeleteResponse( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +291,8 @@ partial void ProcessContextsDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessContextsDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,6 +335,10 @@ partial void ProcessContextsDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -319,6 +360,10 @@ partial void ProcessContextsDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsGet.g.cs index 9d67f56..a8a73fc 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessContextsGetResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContextsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Context + /// + /// + /// 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> ContextsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessContextsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/contexts/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessContextsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessContextsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessContextsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessContextsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessContextsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessContextsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessContextsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessContextsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessContextsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Context.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Context.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessContextsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.Context.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Context.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsUpdate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsUpdate.g.cs index a48b3f4..c0f0fe1 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsUpdate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ContextsUpdate.g.cs @@ -52,6 +52,26 @@ partial void ProcessContextsUpdateResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContextsUpdateAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a Context + /// + /// + /// 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> ContextsUpdateAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessContextsUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/contexts/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessContextsUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessContextsUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessContextsUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessContextsUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessContextsUpdateResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessContextsUpdateResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessContextsUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessContextsUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessContextsUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.ContextsUpdateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.ContextsUpdateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessContextsUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.ContextsUpdateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.ContextsUpdateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsDelete.g.cs index 118852b..2e525dd 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsDelete.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsDelete.g.cs @@ -48,6 +48,25 @@ partial void ProcessDownloadsDeleteResponse( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DownloadsDeleteAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a Download
+ /// Delete a download file from storage and mark as deleted. + ///
+ /// + /// 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 DownloadsDeleteAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -77,6 +96,7 @@ partial void ProcessDownloadsDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/downloads/{id}", baseUri: HttpClient.BaseAddress); @@ -150,6 +170,8 @@ partial void ProcessDownloadsDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -160,6 +182,11 @@ partial void ProcessDownloadsDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -177,6 +204,8 @@ partial void ProcessDownloadsDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -186,8 +215,7 @@ partial void ProcessDownloadsDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -196,6 +224,11 @@ partial void ProcessDownloadsDeleteResponse( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -212,14 +245,15 @@ partial void ProcessDownloadsDeleteResponse( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -259,6 +293,8 @@ partial void ProcessDownloadsDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -279,6 +315,8 @@ partial void ProcessDownloadsDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -299,6 +337,10 @@ partial void ProcessDownloadsDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -320,6 +362,10 @@ partial void ProcessDownloadsDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsGet.g.cs index ed960ea..963a814 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsGet.g.cs @@ -53,6 +53,27 @@ partial void ProcessDownloadsGetResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DownloadsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Download
+ /// Get download metadata (Accept: application/json) or file content (Accept: application/octet-stream). + ///
+ /// + /// 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> DownloadsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessDownloadsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/downloads/{id}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessDownloadsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessDownloadsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessDownloadsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessDownloadsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessDownloadsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessDownloadsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessDownloadsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessDownloadsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessDownloadsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.DownloadsGetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.DownloadsGetResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessDownloadsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.DownloadsGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.DownloadsGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsList.g.cs index 6032a25..a3f048e 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.DownloadsList.g.cs @@ -89,6 +89,55 @@ partial void ProcessDownloadsListResponseContent( double? offset = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DownloadsListAsResponseAsync( + sessionId: sessionId, + filename: filename, + mimeType: mimeType, + minSize: minSize, + maxSize: maxSize, + createdAfter: createdAfter, + createdBefore: createdBefore, + limit: limit, + offset: offset, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Downloads
+ /// List all downloads for a session with optional filtering and pagination. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: 20 + /// + /// + /// Default Value: 0 + /// + /// 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> DownloadsListAsResponseAsync( + string sessionId, + string? filename = default, + string? mimeType = default, + double? minSize = default, + double? maxSize = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + double? limit = default, + double? offset = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -126,9 +175,10 @@ partial void ProcessDownloadsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/downloads", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddRequiredParameter("sessionId", sessionId) .AddOptionalParameter("filename", filename) @@ -138,7 +188,7 @@ partial void ProcessDownloadsListResponseContent( .AddOptionalParameter("createdAfter", createdAfter?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("createdBefore", createdBefore?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("offset", offset?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -218,6 +268,8 @@ partial void ProcessDownloadsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -228,6 +280,11 @@ partial void ProcessDownloadsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -245,6 +302,8 @@ partial void ProcessDownloadsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -254,8 +313,7 @@ partial void ProcessDownloadsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +322,11 @@ partial void ProcessDownloadsListResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -280,14 +343,15 @@ partial void ProcessDownloadsListResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -327,6 +391,8 @@ partial void ProcessDownloadsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -347,6 +413,8 @@ partial void ProcessDownloadsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -371,9 +439,13 @@ partial void ProcessDownloadsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.DownloadsListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.DownloadsListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +473,13 @@ partial void ProcessDownloadsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.DownloadsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.DownloadsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsDelete.g.cs index 8533ce5..94787ac 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsDelete.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsDelete.g.cs @@ -47,6 +47,24 @@ partial void ProcessExtensionsDeleteResponse( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await ExtensionsDeleteAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete an Extension + /// + /// + /// 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 ExtensionsDeleteAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessExtensionsDeleteResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/extensions/{id}", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessExtensionsDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessExtensionsDeleteResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +202,8 @@ partial void ProcessExtensionsDeleteResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +213,7 @@ partial void ProcessExtensionsDeleteResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +222,11 @@ partial void ProcessExtensionsDeleteResponse( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +243,15 @@ partial void ProcessExtensionsDeleteResponse( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +291,8 @@ partial void ProcessExtensionsDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessExtensionsDeleteResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -298,6 +335,10 @@ partial void ProcessExtensionsDeleteResponse( { __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -319,6 +360,10 @@ partial void ProcessExtensionsDeleteResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsGet.g.cs index c71dadc..e83efcf 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessExtensionsGetResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExtensionsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an Extension + /// + /// + /// 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> ExtensionsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessExtensionsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/extensions/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessExtensionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessExtensionsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessExtensionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessExtensionsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessExtensionsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessExtensionsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessExtensionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessExtensionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessExtensionsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Extension.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Extension.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessExtensionsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.Extension.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Extension.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsUpload.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsUpload.g.cs index 96a3294..aecf841 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsUpload.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ExtensionsUpload.g.cs @@ -50,6 +50,28 @@ partial void ProcessExtensionsUploadResponseContent( /// public async global::System.Threading.Tasks.Task ExtensionsUploadAsync( + global::Browserbase.ExtensionsUploadRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExtensionsUploadAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload an Extension + /// + /// + /// 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> ExtensionsUploadAsResponseAsync( + global::Browserbase.ExtensionsUploadRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -80,10 +102,11 @@ partial void ProcessExtensionsUploadResponseContent( var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/extensions", baseUri: HttpClient.BaseAddress); @@ -116,6 +139,7 @@ partial void ProcessExtensionsUploadResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -154,7 +178,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -196,6 +222,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +234,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +256,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +267,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +276,11 @@ request.Filename is null __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +297,15 @@ request.Filename is null 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +345,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +367,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -349,9 +393,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Extension.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Extension.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -379,9 +427,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Browserbase.Extension.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Extension.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,5 +496,830 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload an Extension + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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 ExtensionsUploadAsync( + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Browserbase.ExtensionsUploadRequest + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareExtensionsUploadArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ExtensionsUploadSecurityRequirements, + operationName: "ExtensionsUploadAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: "/v1/extensions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareExtensionsUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.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); + ProcessExtensionsUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessExtensionsUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Browserbase.Extension.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Browserbase.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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Browserbase.Extension.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + 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::Browserbase.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(); + } + } + /// + /// Upload an Extension + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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> ExtensionsUploadAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Browserbase.ExtensionsUploadRequest + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareExtensionsUploadArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ExtensionsUploadSecurityRequirements, + operationName: "ExtensionsUploadAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: "/v1/extensions", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareExtensionsUploadRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.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); + ProcessExtensionsUploadResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExtensionsUpload", + methodName: "ExtensionsUploadAsync", + pathTemplate: "\"/v1/extensions\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessExtensionsUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.Extension.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Browserbase.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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.Extension.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Browserbase.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/Browserbase/Generated/Browserbase.BrowserbaseClient.FetchCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FetchCreate.g.cs index e9f8c43..5268ee0 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FetchCreate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FetchCreate.g.cs @@ -51,6 +51,29 @@ partial void ProcessFetchCreateResponseContent( /// public async global::System.Threading.Tasks.Task FetchCreateAsync( + global::Browserbase.FetchCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FetchCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch a Page
+ /// Fetch a page and return its content, headers, and metadata. + ///
+ /// + /// 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> FetchCreateAsResponseAsync( + global::Browserbase.FetchCreateRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessFetchCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/fetch", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessFetchCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessFetchCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessFetchCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +233,7 @@ partial void ProcessFetchCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessFetchCreateResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessFetchCreateResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessFetchCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessFetchCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request body. @@ -469,9 +511,13 @@ partial void ProcessFetchCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FetchCreateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FetchCreateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -499,9 +545,13 @@ partial void ProcessFetchCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FetchCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FetchCreateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGet.g.cs index fbab6a7..716cc40 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessFunctionBuildsGetResponseContent( global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionBuildsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Function Build + /// + /// + /// 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> FunctionBuildsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFunctionBuildsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/builds/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessFunctionBuildsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessFunctionBuildsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessFunctionBuildsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessFunctionBuildsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessFunctionBuildsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessFunctionBuildsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessFunctionBuildsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessFunctionBuildsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessFunctionBuildsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionBuild.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionBuild.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessFunctionBuildsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionBuild.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionBuild.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGetLogs.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGetLogs.g.cs index 9c912bb..9b8c61b 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGetLogs.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsGetLogs.g.cs @@ -52,6 +52,26 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionBuildsGetLogsAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Function Build 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> FunctionBuildsGetLogsAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/builds/{id}/logs", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionBuildsGetLogsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionBuildsGetLogsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessFunctionBuildsGetLogsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionBuildsGetLogsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionBuildsGetLogsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsList.g.cs index d256555..c3b4ac5 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionBuildsList.g.cs @@ -64,6 +64,36 @@ partial void ProcessFunctionBuildsListResponseContent( string? status = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionBuildsListAsResponseAsync( + offset: offset, + limit: limit, + status: status, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Function Builds + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FunctionBuildsListAsResponseAsync( + int? offset = default, + int? limit = default, + string? status = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,13 +125,14 @@ partial void ProcessFunctionBuildsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/functions/builds", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("status", status) + .AddOptionalParameter("status", status) ; var __path = __pathBuilder.ToString(); __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -175,6 +206,8 @@ partial void ProcessFunctionBuildsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +218,11 @@ partial void ProcessFunctionBuildsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +240,8 @@ partial void ProcessFunctionBuildsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +251,7 @@ partial void ProcessFunctionBuildsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +260,11 @@ partial void ProcessFunctionBuildsListResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +281,15 @@ partial void ProcessFunctionBuildsListResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +329,8 @@ partial void ProcessFunctionBuildsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +351,8 @@ partial void ProcessFunctionBuildsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -328,9 +377,13 @@ partial void ProcessFunctionBuildsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionBuildsListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionBuildsListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -358,9 +411,13 @@ partial void ProcessFunctionBuildsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionBuildsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionBuildsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsGet.g.cs index 151b8af..c3c1138 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessFunctionVersionsGetResponseContent( global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionVersionsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Function Version + /// + /// + /// 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> FunctionVersionsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFunctionVersionsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/versions/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessFunctionVersionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessFunctionVersionsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessFunctionVersionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessFunctionVersionsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessFunctionVersionsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessFunctionVersionsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessFunctionVersionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessFunctionVersionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessFunctionVersionsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionVersion.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionVersion.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessFunctionVersionsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionVersion.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionVersion.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsListInvocations.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsListInvocations.g.cs index fb1b89b..86313b0 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsListInvocations.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionVersionsListInvocations.g.cs @@ -68,6 +68,39 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( string? status = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionVersionsListInvocationsAsResponseAsync( + id: id, + offset: offset, + limit: limit, + status: status, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Invocations for a Function Version + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FunctionVersionsListInvocationsAsResponseAsync( + global::System.Guid id, + int? offset = default, + int? limit = default, + string? status = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,13 +133,14 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/versions/{id}/invocations", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("status", status) + .AddOptionalParameter("status", status) ; var __path = __pathBuilder.ToString(); __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -181,6 +215,8 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +227,11 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +249,8 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +260,7 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +269,11 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +290,15 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +338,8 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +360,8 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -334,9 +386,13 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionVersionsListInvocationsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionVersionsListInvocationsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -364,9 +420,13 @@ partial void ProcessFunctionVersionsListInvocationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionVersionsListInvocationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionVersionsListInvocationsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsGet.g.cs index 5859d71..fc0b575 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessFunctionsGetResponseContent( global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Function + /// + /// + /// 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> FunctionsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessFunctionsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessFunctionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessFunctionsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessFunctionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessFunctionsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessFunctionsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessFunctionsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessFunctionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessFunctionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessFunctionsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Function.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Function.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessFunctionsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.Function.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Function.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsInvoke.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsInvoke.g.cs index 3c94844..7ab12e3 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsInvoke.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsInvoke.g.cs @@ -54,6 +54,31 @@ partial void ProcessFunctionsInvokeResponseContent( public async global::System.Threading.Tasks.Task FunctionsInvokeAsync( global::System.Guid id, + global::Browserbase.FunctionsInvokeRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionsInvokeAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Invoke a Function + /// + /// + /// + /// 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> FunctionsInvokeAsResponseAsync( + global::System.Guid id, + global::Browserbase.FunctionsInvokeRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessFunctionsInvokeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/{id}/invoke", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessFunctionsInvokeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessFunctionsInvokeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +229,8 @@ partial void ProcessFunctionsInvokeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessFunctionsInvokeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessFunctionsInvokeResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +270,15 @@ partial void ProcessFunctionsInvokeResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +318,8 @@ partial void ProcessFunctionsInvokeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessFunctionsInvokeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +366,13 @@ partial void ProcessFunctionsInvokeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Invocation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Invocation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +400,13 @@ partial void ProcessFunctionsInvokeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.Invocation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Invocation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsList.g.cs index 30b3ffd..d976dd7 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsList.g.cs @@ -60,6 +60,33 @@ partial void ProcessFunctionsListResponseContent( int? limit = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionsListAsResponseAsync( + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Functions + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FunctionsListAsResponseAsync( + int? offset = default, + int? limit = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,12 +117,13 @@ partial void ProcessFunctionsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/functions", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -168,6 +196,8 @@ partial void ProcessFunctionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -178,6 +208,11 @@ partial void ProcessFunctionsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -195,6 +230,8 @@ partial void ProcessFunctionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -204,8 +241,7 @@ partial void ProcessFunctionsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -214,6 +250,11 @@ partial void ProcessFunctionsListResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -230,14 +271,15 @@ partial void ProcessFunctionsListResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -277,6 +319,8 @@ partial void ProcessFunctionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -297,6 +341,8 @@ partial void ProcessFunctionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -321,9 +367,13 @@ partial void ProcessFunctionsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionsListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionsListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -351,9 +401,13 @@ partial void ProcessFunctionsListResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsListVersions.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsListVersions.g.cs index f28b72f..8d9d819 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsListVersions.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.FunctionsListVersions.g.cs @@ -64,6 +64,36 @@ partial void ProcessFunctionsListVersionsResponseContent( int? limit = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FunctionsListVersionsAsResponseAsync( + id: id, + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Function Versions + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FunctionsListVersionsAsResponseAsync( + global::System.Guid id, + int? offset = default, + int? limit = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,12 +125,13 @@ partial void ProcessFunctionsListVersionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/{id}/versions", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -174,6 +205,8 @@ partial void ProcessFunctionsListVersionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +217,11 @@ partial void ProcessFunctionsListVersionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -201,6 +239,8 @@ partial void ProcessFunctionsListVersionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +250,7 @@ partial void ProcessFunctionsListVersionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +259,11 @@ partial void ProcessFunctionsListVersionsResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -236,14 +280,15 @@ partial void ProcessFunctionsListVersionsResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -283,6 +328,8 @@ partial void ProcessFunctionsListVersionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +350,8 @@ partial void ProcessFunctionsListVersionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -327,9 +376,13 @@ partial void ProcessFunctionsListVersionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.FunctionsListVersionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.FunctionsListVersionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -357,9 +410,13 @@ partial void ProcessFunctionsListVersionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.FunctionsListVersionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.FunctionsListVersionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGet.g.cs index c754d46..2d00e42 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessInvocationsGetResponseContent( global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InvocationsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an Invocation + /// + /// + /// 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>> InvocationsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessInvocationsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/invocations/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessInvocationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessInvocationsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessInvocationsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessInvocationsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessInvocationsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessInvocationsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessInvocationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessInvocationsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessInvocationsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.AllOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.AllOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessInvocationsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGetLogs.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGetLogs.g.cs index 0387d4e..9d4d5e4 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGetLogs.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.InvocationsGetLogs.g.cs @@ -52,6 +52,26 @@ partial void ProcessInvocationsGetLogsResponseContent( global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InvocationsGetLogsAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Invocation 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> InvocationsGetLogsAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessInvocationsGetLogsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/functions/invocations/{id}/logs", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessInvocationsGetLogsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessInvocationsGetLogsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessInvocationsGetLogsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessInvocationsGetLogsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessInvocationsGetLogsResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessInvocationsGetLogsResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessInvocationsGetLogsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessInvocationsGetLogsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessInvocationsGetLogsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.InvocationsGetLogsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.InvocationsGetLogsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessInvocationsGetLogsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.InvocationsGetLogsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.InvocationsGetLogsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsGet.g.cs index 7f177bd..613928b 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessProjectsGetResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProjectsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Project + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProjectsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessProjectsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/projects/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessProjectsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessProjectsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessProjectsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessProjectsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessProjectsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessProjectsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessProjectsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessProjectsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessProjectsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessProjectsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsList.g.cs index c92dc21..cf51300 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsList.g.cs @@ -48,6 +48,23 @@ partial void ProcessProjectsListResponseContent( public async global::System.Threading.Tasks.Task> ProjectsListAsync( global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProjectsListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Projects + /// + /// 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>> ProjectsListAsResponseAsync( + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +93,7 @@ partial void ProcessProjectsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/projects", baseUri: HttpClient.BaseAddress); @@ -148,6 +166,8 @@ partial void ProcessProjectsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -158,6 +178,11 @@ partial void ProcessProjectsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -175,6 +200,8 @@ partial void ProcessProjectsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -184,8 +211,7 @@ partial void ProcessProjectsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -194,6 +220,11 @@ partial void ProcessProjectsListResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -210,14 +241,15 @@ partial void ProcessProjectsListResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +289,8 @@ partial void ProcessProjectsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -277,6 +311,8 @@ partial void ProcessProjectsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -301,9 +337,13 @@ partial void ProcessProjectsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -331,9 +371,13 @@ partial void ProcessProjectsListResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsUsage.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsUsage.g.cs index 1d602be..c9945a3 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsUsage.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.ProjectsUsage.g.cs @@ -52,6 +52,26 @@ partial void ProcessProjectsUsageResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProjectsUsageAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Project Usage + /// + /// + /// 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> ProjectsUsageAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessProjectsUsageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/projects/{id}/usage", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessProjectsUsageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessProjectsUsageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessProjectsUsageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessProjectsUsageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessProjectsUsageResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessProjectsUsageResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessProjectsUsageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessProjectsUsageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessProjectsUsageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.ProjectUsage.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.ProjectUsage.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessProjectsUsageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.ProjectUsage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.ProjectUsage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SearchWeb.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SearchWeb.g.cs index c967a04..b4c914e 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SearchWeb.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SearchWeb.g.cs @@ -51,6 +51,29 @@ partial void ProcessSearchWebResponseContent( /// public async global::System.Threading.Tasks.Task SearchWebAsync( + global::Browserbase.SearchWebRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchWebAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Web Search
+ /// Perform a web search and return structured results. + ///
+ /// + /// 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> SearchWebAsResponseAsync( + global::Browserbase.SearchWebRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessSearchWebResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/search", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessSearchWebResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessSearchWebResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessSearchWebResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +233,7 @@ partial void ProcessSearchWebResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessSearchWebResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessSearchWebResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessSearchWebResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessSearchWebResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessSearchWebResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.SearchWebResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.SearchWebResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessSearchWebResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.SearchWebResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.SearchWebResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsCreate.g.cs index 2796166..3104f64 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsCreate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsCreate.g.cs @@ -57,6 +57,35 @@ partial void ProcessSessionsCreateResponseContent( /// public async global::System.Threading.Tasks.Task> SessionsCreateAsync( + global::Browserbase.SessionsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a Session + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request POST \
+ /// --url https://api.browserbase.com/v1/sessions \
+ /// --header 'Content-Type: application/json' \
+ /// --header 'X-BB-API-Key: <api-key>' \
+ /// --data '{}' + ///
+ public async global::System.Threading.Tasks.Task>> SessionsCreateAsResponseAsync( + global::Browserbase.SessionsCreateRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +120,7 @@ partial void ProcessSessionsCreateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/sessions", baseUri: HttpClient.BaseAddress); @@ -170,6 +200,8 @@ partial void ProcessSessionsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +212,11 @@ partial void ProcessSessionsCreateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +234,8 @@ partial void ProcessSessionsCreateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +245,7 @@ partial void ProcessSessionsCreateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +254,11 @@ partial void ProcessSessionsCreateResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +275,15 @@ partial void ProcessSessionsCreateResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +323,8 @@ partial void ProcessSessionsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +345,8 @@ partial void ProcessSessionsCreateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +371,13 @@ partial void ProcessSessionsCreateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.AllOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.AllOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +405,13 @@ partial void ProcessSessionsCreateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGet.g.cs index 8e19b3b..6bb20c2 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGet.g.cs @@ -52,6 +52,26 @@ partial void ProcessSessionsGetResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsGetAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Session + /// + /// + /// 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>> SessionsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessSessionsGetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/sessions/{id}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessSessionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessSessionsGetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessSessionsGetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessSessionsGetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessSessionsGetResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessSessionsGetResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessSessionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessSessionsGetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessSessionsGetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.AllOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.AllOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessSessionsGetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.AllOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetDebug.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetDebug.g.cs index 81ad684..c15ffcf 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetDebug.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetDebug.g.cs @@ -52,6 +52,26 @@ partial void ProcessSessionsGetDebugResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsGetDebugAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Session Live URLs + /// + /// + /// 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> SessionsGetDebugAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessSessionsGetDebugResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/sessions/{id}/debug", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessSessionsGetDebugResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessSessionsGetDebugResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessSessionsGetDebugResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessSessionsGetDebugResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessSessionsGetDebugResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessSessionsGetDebugResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessSessionsGetDebugResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessSessionsGetDebugResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessSessionsGetDebugResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.SessionLiveUrls.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.SessionLiveUrls.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessSessionsGetDebugResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.SessionLiveUrls.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.SessionLiveUrls.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetLogs.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetLogs.g.cs index 905f362..a4689c7 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetLogs.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetLogs.g.cs @@ -52,6 +52,26 @@ partial void ProcessSessionsGetLogsResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsGetLogsAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Session 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>> SessionsGetLogsAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessSessionsGetLogsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/sessions/{id}/logs", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessSessionsGetLogsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessSessionsGetLogsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessSessionsGetLogsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessSessionsGetLogsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessSessionsGetLogsResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessSessionsGetLogsResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessSessionsGetLogsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessSessionsGetLogsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessSessionsGetLogsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessSessionsGetLogsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetRecording.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetRecording.g.cs index 0f2141e..f761234 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetRecording.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsGetRecording.g.cs @@ -52,6 +52,26 @@ partial void ProcessSessionsGetRecordingResponseContent( string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsGetRecordingAsResponseAsync( + id: id, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Session 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>> SessionsGetRecordingAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessSessionsGetRecordingResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/sessions/{id}/recording", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessSessionsGetRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessSessionsGetRecordingResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -181,6 +209,8 @@ partial void ProcessSessionsGetRecordingResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -190,8 +220,7 @@ partial void ProcessSessionsGetRecordingResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -200,6 +229,11 @@ partial void ProcessSessionsGetRecordingResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -216,14 +250,15 @@ partial void ProcessSessionsGetRecordingResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -263,6 +298,8 @@ partial void ProcessSessionsGetRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessSessionsGetRecordingResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,9 +346,13 @@ partial void ProcessSessionsGetRecordingResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -337,9 +380,13 @@ partial void ProcessSessionsGetRecordingResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsList.g.cs index 4ac9454..7d2238f 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsList.g.cs @@ -56,6 +56,29 @@ partial void ProcessSessionsListResponseContent( string? q = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsListAsResponseAsync( + status: status, + q: q, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Sessions + /// + /// + /// + /// 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>> SessionsListAsResponseAsync( + global::Browserbase.SessionsListStatus? status = default, + string? q = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,12 +109,13 @@ partial void ProcessSessionsListResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: "/v1/sessions", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("status", status?.ToValueString()) - .AddOptionalParameter("q", q) + .AddOptionalParameter("q", q) ; var __path = __pathBuilder.ToString(); __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -164,6 +188,8 @@ partial void ProcessSessionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessSessionsListResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessSessionsListResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +233,7 @@ partial void ProcessSessionsListResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessSessionsListResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessSessionsListResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessSessionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessSessionsListResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessSessionsListResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessSessionsListResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUpdate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUpdate.g.cs index 5397422..1a4783f 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUpdate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUpdate.g.cs @@ -54,6 +54,31 @@ partial void ProcessSessionsUpdateResponseContent( public async global::System.Threading.Tasks.Task SessionsUpdateAsync( string id, + global::Browserbase.SessionsUpdateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsUpdateAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update a Session + /// + /// + /// + /// 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> SessionsUpdateAsResponseAsync( + string id, + global::Browserbase.SessionsUpdateRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessSessionsUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/sessions/{id}", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessSessionsUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessSessionsUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -196,6 +229,8 @@ partial void ProcessSessionsUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessSessionsUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessSessionsUpdateResponseContent( __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -231,14 +270,15 @@ partial void ProcessSessionsUpdateResponseContent( 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +318,8 @@ partial void ProcessSessionsUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessSessionsUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -322,9 +366,13 @@ partial void ProcessSessionsUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.Session.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.Session.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -352,9 +400,13 @@ partial void ProcessSessionsUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Browserbase.Session.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.Session.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUploadFile.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUploadFile.g.cs index fd0047c..3d78a5a 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUploadFile.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.SessionsUploadFile.g.cs @@ -54,6 +54,31 @@ partial void ProcessSessionsUploadFileResponseContent( public async global::System.Threading.Tasks.Task SessionsUploadFileAsync( string id, + global::Browserbase.SessionsUploadFileRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SessionsUploadFileAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Session Uploads + /// + /// + /// + /// 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> SessionsUploadFileAsResponseAsync( + string id, + global::Browserbase.SessionsUploadFileRequest request, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,10 +110,11 @@ partial void ProcessSessionsUploadFileResponseContent( var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Browserbase.PathBuilder( path: $"/v1/sessions/{id}/uploads", baseUri: HttpClient.BaseAddress); @@ -121,10 +147,12 @@ partial void ProcessSessionsUploadFileResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(id ?? string.Empty), name: "\"id\""); + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( request.Filename is null @@ -162,7 +190,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -205,6 +235,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +247,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +269,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +280,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +289,11 @@ request.Filename is null __attempt < __maxAttempts && global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +310,15 @@ request.Filename is null 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::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +358,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +380,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -358,9 +406,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Browserbase.SessionsUploadFileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Browserbase.SessionsUploadFileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -388,9 +440,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Browserbase.SessionsUploadFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Browserbase.SessionsUploadFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -456,5 +512,846 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Create Session Uploads + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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 SessionsUploadFileAsync( + string id, + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Browserbase.SessionsUploadFileRequest + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareSessionsUploadFileArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SessionsUploadFileSecurityRequirements, + operationName: "SessionsUploadFileAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/sessions/{id}/uploads", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(id ?? string.Empty), + name: "\"id\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSessionsUploadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.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); + ProcessSessionsUploadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessSessionsUploadFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Browserbase.SessionsUploadFileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Browserbase.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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Browserbase.SessionsUploadFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + 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::Browserbase.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(); + } + } + /// + /// Create Session Uploads + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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> SessionsUploadFileAsResponseAsync( + string id, + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Browserbase.SessionsUploadFileRequest + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareSessionsUploadFileArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SessionsUploadFileSecurityRequirements, + operationName: "SessionsUploadFileAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/sessions/{id}/uploads", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(id ?? string.Empty), + name: "\"id\""); + + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSessionsUploadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.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); + ProcessSessionsUploadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SessionsUploadFile", + methodName: "SessionsUploadFileAsync", + pathTemplate: "$\"/v1/sessions/{id}/uploads\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessSessionsUploadFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.SessionsUploadFileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Browserbase.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(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.SessionsUploadFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Browserbase.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/Browserbase/Generated/Browserbase.BrowserbaseClient.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.g.cs index 6792596..c69482f 100644 --- a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.g.cs @@ -73,10 +73,10 @@ public BrowserbaseClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BrowserbaseClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Browserbase.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Browserbase.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsCreate.g.cs index d4fa907..7db0397 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsCreate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsCreate.g.cs @@ -19,6 +19,18 @@ public partial interface IBrowserbaseClient /// /// Create a Context /// + /// + /// 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> ContextsCreateAsResponseAsync( + + global::Browserbase.ContextsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a Context + /// /// /// The Project ID. Can be found in [Settings](https://www.browserbase.com/settings). Optional - if not provided, the project will be inferred from the API key. /// diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsDelete.g.cs index 7f06cc8..5f4b784 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsDelete.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsDelete.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a Context + /// + /// + /// 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 ContextsDeleteAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsGet.g.cs index fe41730..d934c6d 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Context + /// + /// + /// 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> ContextsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsUpdate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsUpdate.g.cs index 4c77466..5b9e636 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsUpdate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ContextsUpdate.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a Context + /// + /// + /// 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> ContextsUpdateAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsDelete.g.cs index d19cbed..4e0902b 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsDelete.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsDelete.g.cs @@ -16,5 +16,17 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a Download
+ /// Delete a download file from storage and mark as deleted. + ///
+ /// + /// 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 DownloadsDeleteAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsGet.g.cs index 45bc324..9a37ee5 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsGet.g.cs @@ -16,5 +16,17 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Download
+ /// Get download metadata (Accept: application/json) or file content (Accept: application/octet-stream). + ///
+ /// + /// 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> DownloadsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsList.g.cs index a563676..040b8f1 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.DownloadsList.g.cs @@ -36,5 +36,37 @@ public partial interface IBrowserbaseClient double? offset = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Downloads
+ /// List all downloads for a session with optional filtering and pagination. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: 20 + /// + /// + /// Default Value: 0 + /// + /// 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> DownloadsListAsResponseAsync( + string sessionId, + string? filename = default, + string? mimeType = default, + double? minSize = default, + double? maxSize = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + double? limit = default, + double? offset = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsDelete.g.cs index cc6ee4a..62f4c18 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsDelete.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsDelete.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an Extension + /// + /// + /// 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 ExtensionsDeleteAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsGet.g.cs index 3307acc..3222d99 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an Extension + /// + /// + /// 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> ExtensionsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsUpload.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsUpload.g.cs index 6614bca..888a2fe 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsUpload.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ExtensionsUpload.g.cs @@ -19,6 +19,18 @@ public partial interface IBrowserbaseClient /// /// Upload an Extension /// + /// + /// 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> ExtensionsUploadAsResponseAsync( + + global::Browserbase.ExtensionsUploadRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload an Extension + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -29,5 +41,36 @@ public partial interface IBrowserbaseClient string filename, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload an Extension + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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 ExtensionsUploadAsync( + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload an Extension + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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> ExtensionsUploadAsResponseAsync( + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FetchCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FetchCreate.g.cs index e14d95a..14f6c42 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FetchCreate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FetchCreate.g.cs @@ -21,6 +21,19 @@ public partial interface IBrowserbaseClient /// Fetch a Page
/// Fetch a page and return its content, headers, and metadata. /// + /// + /// 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> FetchCreateAsResponseAsync( + + global::Browserbase.FetchCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch a Page
+ /// Fetch a page and return its content, headers, and metadata. + ///
/// /// The URL to fetch /// diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGet.g.cs index c645036..8ccedf0 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Function Build + /// + /// + /// 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> FunctionBuildsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGetLogs.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGetLogs.g.cs index bbfec5c..7c4d1f5 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGetLogs.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsGetLogs.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Function Build 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> FunctionBuildsGetLogsAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsList.g.cs index 44a5b0d..77a5342 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionBuildsList.g.cs @@ -23,5 +23,24 @@ public partial interface IBrowserbaseClient string? status = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Function Builds + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// + /// 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> FunctionBuildsListAsResponseAsync( + int? offset = default, + int? limit = default, + string? status = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsGet.g.cs index 1398437..27acfdd 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Function Version + /// + /// + /// 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> FunctionVersionsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsListInvocations.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsListInvocations.g.cs index ac7dedf..1274df8 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsListInvocations.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionVersionsListInvocations.g.cs @@ -25,5 +25,26 @@ public partial interface IBrowserbaseClient string? status = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Invocations for a Function Version + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// + /// + /// 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> FunctionVersionsListInvocationsAsResponseAsync( + global::System.Guid id, + int? offset = default, + int? limit = default, + string? status = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsGet.g.cs index e208d17..b1cab19 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Function + /// + /// + /// 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> FunctionsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsInvoke.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsInvoke.g.cs index 4c1205e..2cfa985 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsInvoke.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsInvoke.g.cs @@ -22,6 +22,20 @@ public partial interface IBrowserbaseClient /// Invoke a Function /// /// + /// + /// 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> FunctionsInvokeAsResponseAsync( + global::System.Guid id, + + global::Browserbase.FunctionsInvokeRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Invoke a Function + /// + /// /// /// JSON object that can be stored in a JSONB column /// diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsList.g.cs index 125cbb2..ab45c1b 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsList.g.cs @@ -21,5 +21,22 @@ public partial interface IBrowserbaseClient int? limit = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Functions + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// 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> FunctionsListAsResponseAsync( + int? offset = default, + int? limit = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsListVersions.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsListVersions.g.cs index ef97c84..5007cb4 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsListVersions.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.FunctionsListVersions.g.cs @@ -23,5 +23,24 @@ public partial interface IBrowserbaseClient int? limit = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Function Versions + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 20 + /// + /// + /// 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> FunctionsListVersionsAsResponseAsync( + global::System.Guid id, + int? offset = default, + int? limit = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGet.g.cs index d8fbe6b..7db44b4 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an Invocation + /// + /// + /// 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>> InvocationsGetAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGetLogs.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGetLogs.g.cs index e1a07e2..82df636 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGetLogs.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.InvocationsGetLogs.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient global::System.Guid id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Invocation 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> InvocationsGetLogsAsResponseAsync( + global::System.Guid id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsGet.g.cs index dba548f..cd97db8 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Project + /// + /// + /// 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> ProjectsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsList.g.cs index 5c8ac9e..2d466a2 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsList.g.cs @@ -13,5 +13,14 @@ public partial interface IBrowserbaseClient global::System.Threading.Tasks.Task> ProjectsListAsync( global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Projects + /// + /// 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>> ProjectsListAsResponseAsync( + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsUsage.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsUsage.g.cs index bf2ae8b..cdb6030 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsUsage.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.ProjectsUsage.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Project Usage + /// + /// + /// 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> ProjectsUsageAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SearchWeb.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SearchWeb.g.cs index 3da9837..7eeca7f 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SearchWeb.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SearchWeb.g.cs @@ -21,6 +21,19 @@ public partial interface IBrowserbaseClient /// Web Search
/// Perform a web search and return structured results. /// + /// + /// 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> SearchWebAsResponseAsync( + + global::Browserbase.SearchWebRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Web Search
+ /// Perform a web search and return structured results. + ///
/// /// The search query string /// diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsCreate.g.cs index bc8ac8e..8bf967f 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsCreate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsCreate.g.cs @@ -26,6 +26,25 @@ public partial interface IBrowserbaseClient /// /// Create a Session /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + /// + /// curl --request POST \
+ /// --url https://api.browserbase.com/v1/sessions \
+ /// --header 'Content-Type: application/json' \
+ /// --header 'X-BB-API-Key: <api-key>' \
+ /// --data '{}' + ///
+ global::System.Threading.Tasks.Task>> SessionsCreateAsResponseAsync( + + global::Browserbase.SessionsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a Session + /// /// /// The Project ID. Can be found in [Settings](https://www.browserbase.com/settings). Optional - if not provided, the project will be inferred from the API key. /// diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGet.g.cs index 54def1b..9aa9870 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGet.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGet.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Session + /// + /// + /// 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>> SessionsGetAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetDebug.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetDebug.g.cs index 525e56c..20ac518 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetDebug.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetDebug.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Session Live URLs + /// + /// + /// 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> SessionsGetDebugAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetLogs.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetLogs.g.cs index bf8beca..e073685 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetLogs.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetLogs.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Session 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>> SessionsGetLogsAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetRecording.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetRecording.g.cs index ff85094..88ea528 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetRecording.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsGetRecording.g.cs @@ -15,5 +15,16 @@ public partial interface IBrowserbaseClient string id, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Session 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>> SessionsGetRecordingAsResponseAsync( + string id, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsList.g.cs index 0c1a60f..9ff0cb1 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsList.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsList.g.cs @@ -17,5 +17,18 @@ public partial interface IBrowserbaseClient string? q = default, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Sessions + /// + /// + /// + /// 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>> SessionsListAsResponseAsync( + global::Browserbase.SessionsListStatus? status = default, + string? q = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUpdate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUpdate.g.cs index c98eb11..d8eedfb 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUpdate.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUpdate.g.cs @@ -22,6 +22,20 @@ public partial interface IBrowserbaseClient /// Update a Session /// /// + /// + /// 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> SessionsUpdateAsResponseAsync( + string id, + + global::Browserbase.SessionsUpdateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a Session + /// + /// /// /// The Project ID. Can be found in [Settings](https://www.browserbase.com/settings). Optional - if not provided, the project will be inferred from the API key. /// diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUploadFile.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUploadFile.g.cs index cc081ab..2877e91 100644 --- a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUploadFile.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.SessionsUploadFile.g.cs @@ -22,6 +22,20 @@ public partial interface IBrowserbaseClient /// Create Session Uploads /// /// + /// + /// 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> SessionsUploadFileAsResponseAsync( + string id, + + global::Browserbase.SessionsUploadFileRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Session Uploads + /// + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -33,5 +47,40 @@ public partial interface IBrowserbaseClient string filename, global::Browserbase.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Create Session Uploads + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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 SessionsUploadFileAsync( + string id, + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Session Uploads + /// + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// 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> SessionsUploadFileAsResponseAsync( + string id, + global::System.IO.Stream file, + string filename, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.OptionsSupport.g.cs b/src/libs/Browserbase/Generated/Browserbase.OptionsSupport.g.cs index b6dab58..06f663e 100644 --- a/src/libs/Browserbase/Generated/Browserbase.OptionsSupport.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::Browserbase.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::Browserbase.AutoSDKClientOptions clientOptions, global::Browserbase.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Browserbase.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::Browserbase.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode(