diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs index af80179..2fc5c52 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs @@ -60,6 +60,29 @@ partial void ProcessAclBatchUpdateResponseContent( /// public async global::System.Threading.Tasks.Task AclBatchUpdateAsync( + global::Braintrust.AclBatchUpdateRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AclBatchUpdateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Batch update acls
+ /// Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect. + ///
+ /// + /// 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> AclBatchUpdateAsResponseAsync( + global::Braintrust.AclBatchUpdateRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessAclBatchUpdateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl/batch_update", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessAclBatchUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessAclBatchUpdateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessAclBatchUpdateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessAclBatchUpdateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessAclBatchUpdateResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessAclBatchUpdateResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessAclBatchUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessAclBatchUpdateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessAclBatchUpdateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AclBatchUpdateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AclBatchUpdateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessAclBatchUpdateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AclBatchUpdateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AclBatchUpdateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs index 2a9c8fa..d2eb400 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs @@ -133,6 +133,87 @@ partial void ProcessAclListOrgResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AclListOrgAsResponseAsync( + limit: limit, + ids: ids, + startingAfter: startingAfter, + endingBefore: endingBefore, + objectType: objectType, + objectId: objectId, + userId: userId, + groupId: groupId, + permission: permission, + restrictObjectType: restrictObjectType, + roleId: roleId, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List org acls
+ /// List all acls in the org. This query requires the caller to have `read_acls` permission at the organization level + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// + /// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Each permission permits a certain type of operation on an object in the system
+ /// Permissions can be assigned to to objects on an individual basis, or grouped into roles + /// + /// + /// The object type that the ACL applies to + /// + /// + /// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided + /// + /// + /// Filter search results to within a particular organization + /// + /// 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>> AclListOrgAsResponseAsync( + int? limit = default, + global::Braintrust.Ids? ids = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.AclListOrgObjectType? objectType = default, + global::System.Guid? objectId = default, + global::System.Guid? userId = default, + global::System.Guid? groupId = default, + global::Braintrust.AclListPermission? permission = default, + global::Braintrust.AclListRestrictObjectType? restrictObjectType = default, + global::System.Guid? roleId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -173,9 +254,10 @@ partial void ProcessAclListOrgResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl/list_org", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) @@ -188,7 +270,7 @@ partial void ProcessAclListOrgResponseContent( .AddOptionalParameter("permission", permission?.ToValueString()) .AddOptionalParameter("restrict_object_type", restrictObjectType?.ToValueString()) .AddOptionalParameter("role_id", roleId?.ToString()) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -271,6 +353,8 @@ partial void ProcessAclListOrgResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -281,6 +365,11 @@ partial void ProcessAclListOrgResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -298,6 +387,8 @@ partial void ProcessAclListOrgResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -307,8 +398,7 @@ partial void ProcessAclListOrgResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -317,6 +407,11 @@ partial void ProcessAclListOrgResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -333,14 +428,15 @@ partial void ProcessAclListOrgResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -380,6 +476,8 @@ partial void ProcessAclListOrgResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -400,6 +498,8 @@ partial void ProcessAclListOrgResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -614,9 +714,13 @@ partial void ProcessAclListOrgResponseContent( { __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::Braintrust.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -644,9 +748,13 @@ partial void ProcessAclListOrgResponseContent( #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::Braintrust.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs index 95170ce..3018886 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs @@ -60,6 +60,29 @@ partial void ProcessDeleteAclResponseContent( /// public async global::System.Threading.Tasks.Task DeleteAclAsync( + global::Braintrust.AclItem request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAclAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete single acl
+ /// Delete a single acl + ///
+ /// + /// 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> DeleteAclAsResponseAsync( + global::Braintrust.AclItem request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessDeleteAclResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessDeleteAclResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessDeleteAclResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessDeleteAclResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessDeleteAclResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessDeleteAclResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessDeleteAclResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessDeleteAclResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessDeleteAclResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessDeleteAclResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessDeleteAclResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs index f4bdc7a..7d0f960 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteAclIdResponseContent( global::System.Guid aclId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAclIdAsResponseAsync( + aclId: aclId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete acl
+ /// Delete an acl object by its id + ///
+ /// + /// Acl id + /// + /// 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> DeleteAclIdAsResponseAsync( + global::System.Guid aclId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteAclIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/acl/{aclId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteAclIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteAclIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteAclIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteAclIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteAclIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteAclIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteAclIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteAclIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteAclIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteAclIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs index 2aed362..ca66939 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs @@ -127,6 +127,82 @@ partial void ProcessGetAclResponseContent( global::System.Guid? roleId = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAclAsResponseAsync( + objectType: objectType, + objectId: objectId, + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + userId: userId, + groupId: groupId, + permission: permission, + restrictObjectType: restrictObjectType, + roleId: roleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List acls
+ /// List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// + /// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Each permission permits a certain type of operation on an object in the system
+ /// Permissions can be assigned to to objects on an individual basis, or grouped into roles + /// + /// + /// The object type that the ACL applies to + /// + /// + /// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided + /// + /// 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> GetAclAsResponseAsync( + global::Braintrust.AclObjectType objectType, + global::System.Guid objectId, + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + global::System.Guid? userId = default, + global::System.Guid? groupId = default, + global::Braintrust.AclListPermission? permission = default, + global::Braintrust.AclListRestrictObjectType? restrictObjectType = default, + global::System.Guid? roleId = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -166,9 +242,10 @@ partial void ProcessGetAclResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -180,7 +257,7 @@ partial void ProcessGetAclResponseContent( .AddOptionalParameter("group_id", groupId?.ToString()) .AddOptionalParameter("permission", permission?.ToValueString()) .AddOptionalParameter("restrict_object_type", restrictObjectType?.ToValueString()) - .AddOptionalParameter("role_id", roleId?.ToString()) + .AddOptionalParameter("role_id", roleId?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -262,6 +339,8 @@ partial void ProcessGetAclResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -272,6 +351,11 @@ partial void ProcessGetAclResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -289,6 +373,8 @@ partial void ProcessGetAclResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -298,8 +384,7 @@ partial void ProcessGetAclResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +393,11 @@ partial void ProcessGetAclResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -324,14 +414,15 @@ partial void ProcessGetAclResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -371,6 +462,8 @@ partial void ProcessGetAclResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -391,6 +484,8 @@ partial void ProcessGetAclResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -605,9 +700,13 @@ partial void ProcessGetAclResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetAclResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetAclResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -635,9 +734,13 @@ partial void ProcessGetAclResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetAclResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetAclResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs index 9a30bf7..3167969 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetAclIdResponseContent( global::System.Guid aclId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAclIdAsResponseAsync( + aclId: aclId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get acl
+ /// Get an acl object by its id + ///
+ /// + /// Acl id + /// + /// 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> GetAclIdAsResponseAsync( + global::System.Guid aclId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetAclIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/acl/{aclId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetAclIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetAclIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetAclIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetAclIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetAclIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetAclIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetAclIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetAclIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetAclIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetAclIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs index 4ef330d..8ccebe9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostAclResponseContent( /// public async global::System.Threading.Tasks.Task PostAclAsync( + global::Braintrust.AclItem request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostAclAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create acl
+ /// Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified + ///
+ /// + /// 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> PostAclAsResponseAsync( + global::Braintrust.AclItem request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostAclResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostAclResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostAclResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostAclResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostAclResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostAclResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostAclResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostAclResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostAclResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostAclResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Acl.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostAclResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Acl.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.g.cs index a4769a9..c6b82c0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.g.cs @@ -72,10 +72,10 @@ public AclsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AclsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs index 867068e..bce618b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs @@ -60,6 +60,29 @@ partial void ProcessDeleteAiSecretResponseContent( /// public async global::System.Threading.Tasks.Task DeleteAiSecretAsync( + global::Braintrust.DeleteAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAiSecretAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete single ai_secret
+ /// Delete a single ai_secret + ///
+ /// + /// 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> DeleteAiSecretAsResponseAsync( + global::Braintrust.DeleteAISecret request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessDeleteAiSecretResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/ai_secret", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessDeleteAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessDeleteAiSecretResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessDeleteAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessDeleteAiSecretResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessDeleteAiSecretResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessDeleteAiSecretResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessDeleteAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessDeleteAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessDeleteAiSecretResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessDeleteAiSecretResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs index 767521c..386f611 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteAiSecretIdResponseContent( global::System.Guid aiSecretId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAiSecretIdAsResponseAsync( + aiSecretId: aiSecretId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete ai_secret
+ /// Delete an ai_secret object by its id + ///
+ /// + /// AiSecret id + /// + /// 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> DeleteAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteAiSecretIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/ai_secret/{aiSecretId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteAiSecretIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteAiSecretIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteAiSecretIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteAiSecretIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteAiSecretIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteAiSecretIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteAiSecretIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteAiSecretIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteAiSecretIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteAiSecretIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs index fb7d0d8..da62fff 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs @@ -100,6 +100,59 @@ partial void ProcessGetAiSecretResponseContent( global::Braintrust.AISecretType? aiSecretType = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAiSecretAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + aiSecretName: aiSecretName, + orgName: orgName, + aiSecretType: aiSecretType, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List ai_secrets
+ /// List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the ai_secret to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// + /// 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> GetAiSecretAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? aiSecretName = default, + string? orgName = default, + global::Braintrust.AISecretType? aiSecretType = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,9 +188,10 @@ partial void ProcessGetAiSecretResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/ai_secret", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -145,7 +199,7 @@ partial void ProcessGetAiSecretResponseContent( .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("ai_secret_name", aiSecretName) .AddOptionalParameter("org_name", orgName) - .AddOptionalParameter("ai_secret_type", aiSecretType?.ToString()) + .AddOptionalParameter("ai_secret_type", aiSecretType?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -223,6 +277,8 @@ partial void ProcessGetAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +289,11 @@ partial void ProcessGetAiSecretResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +311,8 @@ partial void ProcessGetAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +322,7 @@ partial void ProcessGetAiSecretResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +331,11 @@ partial void ProcessGetAiSecretResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +352,15 @@ partial void ProcessGetAiSecretResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +400,8 @@ partial void ProcessGetAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +422,8 @@ partial void ProcessGetAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -566,9 +638,13 @@ partial void ProcessGetAiSecretResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetAiSecretResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetAiSecretResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -596,9 +672,13 @@ partial void ProcessGetAiSecretResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetAiSecretResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetAiSecretResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs index 9f1556a..8a5f239 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetAiSecretIdResponseContent( global::System.Guid aiSecretId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetAiSecretIdAsResponseAsync( + aiSecretId: aiSecretId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get ai_secret
+ /// Get an ai_secret object by its id + ///
+ /// + /// AiSecret id + /// + /// 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> GetAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetAiSecretIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/ai_secret/{aiSecretId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetAiSecretIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetAiSecretIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetAiSecretIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetAiSecretIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetAiSecretIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetAiSecretIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetAiSecretIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetAiSecretIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetAiSecretIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetAiSecretIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs index 92068c2..8651842 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchAiSecretIdResponseContent( public async global::System.Threading.Tasks.Task PatchAiSecretIdAsync( global::System.Guid aiSecretId, + global::Braintrust.PatchAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchAiSecretIdAsResponseAsync( + aiSecretId: aiSecretId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update ai_secret
+ /// Partially update an ai_secret object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// AiSecret id + /// + /// + /// 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> PatchAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.PatchAISecret request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchAiSecretIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/ai_secret/{aiSecretId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchAiSecretIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchAiSecretIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchAiSecretIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchAiSecretIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchAiSecretIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchAiSecretIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchAiSecretIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchAiSecretIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchAiSecretIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchAiSecretIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs index 244b68d..eac42f3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostAiSecretResponseContent( /// public async global::System.Threading.Tasks.Task PostAiSecretAsync( + global::Braintrust.CreateAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostAiSecretAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create ai_secret
+ /// Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified + ///
+ /// + /// 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> PostAiSecretAsResponseAsync( + global::Braintrust.CreateAISecret request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostAiSecretResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/ai_secret", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostAiSecretResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostAiSecretResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostAiSecretResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostAiSecretResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostAiSecretResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostAiSecretResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs index 25537b1..e06acba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutAiSecretResponseContent( /// public async global::System.Threading.Tasks.Task PutAiSecretAsync( + global::Braintrust.CreateAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutAiSecretAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace ai_secret
+ /// Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields + ///
+ /// + /// 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> PutAiSecretAsResponseAsync( + global::Braintrust.CreateAISecret request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutAiSecretResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/ai_secret", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutAiSecretResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutAiSecretResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutAiSecretResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutAiSecretResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutAiSecretResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutAiSecretResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutAiSecretResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.AISecret.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutAiSecretResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.AISecret.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.g.cs index 5e05f01..f11d641 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.g.cs @@ -72,10 +72,10 @@ public AiSecretsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AiSecretsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs index 96f66cc..2afbd2d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteApiKeyIdResponseContent( global::System.Guid apiKeyId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteApiKeyIdAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete api_key
+ /// Delete an api_key object by its id + ///
+ /// + /// ApiKey id + /// + /// 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> DeleteApiKeyIdAsResponseAsync( + global::System.Guid apiKeyId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteApiKeyIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/api_key/{apiKeyId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteApiKeyIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteApiKeyIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteApiKeyIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteApiKeyIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteApiKeyIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteApiKeyIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteApiKeyIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteApiKeyIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteApiKeyIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteApiKeyIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs index 23b29b9..6a3824b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetApiKeyResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApiKeyAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + apiKeyName: apiKeyName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List api_keys
+ /// List out all api_keys. The api_keys are sorted by creation date, with the most recently-created api_keys coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the api_key to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetApiKeyAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? apiKeyName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/api_key", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("api_key_name", apiKeyName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetApiKeyResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetApiKeyResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetApiKeyResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetApiKeyResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetApiKeyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetApiKeyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs index e3abe7c..4626839 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetApiKeyIdResponseContent( global::System.Guid apiKeyId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApiKeyIdAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get api_key
+ /// Get an api_key object by its id + ///
+ /// + /// ApiKey id + /// + /// 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> GetApiKeyIdAsResponseAsync( + global::System.Guid apiKeyId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetApiKeyIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/api_key/{apiKeyId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetApiKeyIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetApiKeyIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetApiKeyIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetApiKeyIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetApiKeyIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetApiKeyIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetApiKeyIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetApiKeyIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetApiKeyIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ApiKey.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ApiKey.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetApiKeyIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ApiKey.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.PostApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.PostApiKey.g.cs index 6acf75c..d4d114e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.PostApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.PostApiKey.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostApiKeyResponseContent( /// public async global::System.Threading.Tasks.Task PostApiKeyAsync( + global::Braintrust.PostApiKeyRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostApiKeyAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create api_key
+ /// Create a new api_key. It is possible to have multiple API keys with the same name. There is no de-duplication + ///
+ /// + /// 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> PostApiKeyAsResponseAsync( + global::Braintrust.PostApiKeyRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostApiKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/api_key", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostApiKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostApiKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostApiKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostApiKeyResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostApiKeyResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostApiKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostApiKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.CreateApiKeyOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.CreateApiKeyOutput.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostApiKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.CreateApiKeyOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.CreateApiKeyOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.g.cs index 107f393..7a7a367 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.g.cs @@ -72,10 +72,10 @@ public ApiKeysClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ApiKeysClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.AutoSDKHttpResponse.g.cs b/src/libs/Braintrust/Generated/Braintrust.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..1f41c6d --- /dev/null +++ b/src/libs/Braintrust/Generated/Braintrust.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Braintrust +{ + /// + /// 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/Braintrust/Generated/Braintrust.BraintrustClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.BraintrustClient.g.cs index fafad29..24234f0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.BraintrustClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.BraintrustClient.g.cs @@ -45,7 +45,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public AclsClient Acls => new AclsClient(HttpClient, authorizations: Authorizations, options: Options) + public AclsClient Acls => new AclsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -54,7 +54,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public AiSecretsClient AiSecrets => new AiSecretsClient(HttpClient, authorizations: Authorizations, options: Options) + public AiSecretsClient AiSecrets => new AiSecretsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -63,7 +63,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ApiKeysClient ApiKeys => new ApiKeysClient(HttpClient, authorizations: Authorizations, options: Options) + public ApiKeysClient ApiKeys => new ApiKeysClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -72,7 +72,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public CorsClient Cors => new CorsClient(HttpClient, authorizations: Authorizations, options: Options) + public CorsClient Cors => new CorsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -81,7 +81,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public CrossObjectClient CrossObject => new CrossObjectClient(HttpClient, authorizations: Authorizations, options: Options) + public CrossObjectClient CrossObject => new CrossObjectClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -90,7 +90,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public DatasetSnapshotsClient DatasetSnapshots => new DatasetSnapshotsClient(HttpClient, authorizations: Authorizations, options: Options) + public DatasetSnapshotsClient DatasetSnapshots => new DatasetSnapshotsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -99,7 +99,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public DatasetsClient Datasets => new DatasetsClient(HttpClient, authorizations: Authorizations, options: Options) + public DatasetsClient Datasets => new DatasetsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -108,7 +108,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public EnvVarsClient EnvVars => new EnvVarsClient(HttpClient, authorizations: Authorizations, options: Options) + public EnvVarsClient EnvVars => new EnvVarsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -117,7 +117,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public EnvironmentsClient Environments => new EnvironmentsClient(HttpClient, authorizations: Authorizations, options: Options) + public EnvironmentsClient Environments => new EnvironmentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -126,7 +126,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public EvalsClient Evals => new EvalsClient(HttpClient, authorizations: Authorizations, options: Options) + public EvalsClient Evals => new EvalsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -135,7 +135,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ExperimentsClient Experiments => new ExperimentsClient(HttpClient, authorizations: Authorizations, options: Options) + public ExperimentsClient Experiments => new ExperimentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -144,7 +144,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public FunctionsClient Functions => new FunctionsClient(HttpClient, authorizations: Authorizations, options: Options) + public FunctionsClient Functions => new FunctionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -153,7 +153,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public GroupsClient Groups => new GroupsClient(HttpClient, authorizations: Authorizations, options: Options) + public GroupsClient Groups => new GroupsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -162,7 +162,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public LogsClient Logs => new LogsClient(HttpClient, authorizations: Authorizations, options: Options) + public LogsClient Logs => new LogsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -171,7 +171,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public McpServersClient McpServers => new McpServersClient(HttpClient, authorizations: Authorizations, options: Options) + public McpServersClient McpServers => new McpServersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -180,7 +180,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public OrganizationsClient Organizations => new OrganizationsClient(HttpClient, authorizations: Authorizations, options: Options) + public OrganizationsClient Organizations => new OrganizationsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -189,7 +189,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public OtherClient Other => new OtherClient(HttpClient, authorizations: Authorizations, options: Options) + public OtherClient Other => new OtherClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -198,7 +198,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ProjectAutomationsClient ProjectAutomations => new ProjectAutomationsClient(HttpClient, authorizations: Authorizations, options: Options) + public ProjectAutomationsClient ProjectAutomations => new ProjectAutomationsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -207,7 +207,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ProjectScoresClient ProjectScores => new ProjectScoresClient(HttpClient, authorizations: Authorizations, options: Options) + public ProjectScoresClient ProjectScores => new ProjectScoresClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -216,7 +216,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ProjectTagsClient ProjectTags => new ProjectTagsClient(HttpClient, authorizations: Authorizations, options: Options) + public ProjectTagsClient ProjectTags => new ProjectTagsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -225,7 +225,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ProjectsClient Projects => new ProjectsClient(HttpClient, authorizations: Authorizations, options: Options) + public ProjectsClient Projects => new ProjectsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -234,7 +234,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public PromptsClient Prompts => new PromptsClient(HttpClient, authorizations: Authorizations, options: Options) + public PromptsClient Prompts => new PromptsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -243,7 +243,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ProxyClient Proxy => new ProxyClient(HttpClient, authorizations: Authorizations, options: Options) + public ProxyClient Proxy => new ProxyClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -252,7 +252,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public RolesClient Roles => new RolesClient(HttpClient, authorizations: Authorizations, options: Options) + public RolesClient Roles => new RolesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -261,7 +261,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ServiceTokensClient ServiceTokens => new ServiceTokensClient(HttpClient, authorizations: Authorizations, options: Options) + public ServiceTokensClient ServiceTokens => new ServiceTokensClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -270,7 +270,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public SpanIframesClient SpanIframes => new SpanIframesClient(HttpClient, authorizations: Authorizations, options: Options) + public SpanIframesClient SpanIframes => new SpanIframesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -279,7 +279,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public UsersClient Users => new UsersClient(HttpClient, authorizations: Authorizations, options: Options) + public UsersClient Users => new UsersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -288,7 +288,7 @@ public sealed partial class BraintrustClient : global::Braintrust.IBraintrustCli /// /// /// - public ViewsClient Views => new ViewsClient(HttpClient, authorizations: Authorizations, options: Options) + public ViewsClient Views => new ViewsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -327,10 +327,10 @@ public BraintrustClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BraintrustClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs index 7b3e607..59aec48 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsAclResponse( public async global::System.Threading.Tasks.Task OptionsAclAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsAclAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/acl`)
+ /// Enable CORS + ///
+ /// 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 OptionsAclAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsAclResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsAclResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsAclResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsAclResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsAclResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsAclResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsAclResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsAclResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsAclResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsAclResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsAclResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs index 223abe5..ff0ed26 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsAclBatchUpdateResponse( public async global::System.Threading.Tasks.Task OptionsAclBatchUpdateAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsAclBatchUpdateAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/acl/acl/batch_update`)
+ /// Enable CORS + ///
+ /// 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 OptionsAclBatchUpdateAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsAclBatchUpdateResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl/acl/batch_update", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsAclBatchUpdateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsAclBatchUpdateResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsAclBatchUpdateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsAclBatchUpdateResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsAclBatchUpdateResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsAclBatchUpdateResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsAclBatchUpdateResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsAclBatchUpdateResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsAclBatchUpdateResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsAclBatchUpdateResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs index 27ce3cb..ec2614c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsAclIdResponse( global::System.Guid aclId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsAclIdAsResponseAsync( + aclId: aclId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/acl/{acl_id}`)
+ /// Enable CORS + ///
+ /// + /// Acl id + /// + /// 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 OptionsAclIdAsResponseAsync( + global::System.Guid aclId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsAclIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/acl/{aclId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsAclIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsAclIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsAclIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsAclIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsAclIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsAclIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsAclIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsAclIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsAclIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsAclIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs index bd4866b..874e785 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsAclListOrgResponse( public async global::System.Threading.Tasks.Task OptionsAclListOrgAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsAclListOrgAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/acl/list_org`)
+ /// Enable CORS + ///
+ /// 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 OptionsAclListOrgAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsAclListOrgResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/acl/list_org", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsAclListOrgResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsAclListOrgResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsAclListOrgResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsAclListOrgResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsAclListOrgResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsAclListOrgResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsAclListOrgResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsAclListOrgResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsAclListOrgResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsAclListOrgResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs index 0f566d8..4a6fcca 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsAiSecretResponse( public async global::System.Threading.Tasks.Task OptionsAiSecretAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsAiSecretAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/ai_secret`)
+ /// Enable CORS + ///
+ /// 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 OptionsAiSecretAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsAiSecretResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/ai_secret", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsAiSecretResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsAiSecretResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsAiSecretResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsAiSecretResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsAiSecretResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsAiSecretResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsAiSecretResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsAiSecretResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsAiSecretResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsAiSecretResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs index 9ae9749..fd47b1a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsAiSecretIdResponse( global::System.Guid aiSecretId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsAiSecretIdAsResponseAsync( + aiSecretId: aiSecretId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/ai_secret/{ai_secret_id}`)
+ /// Enable CORS + ///
+ /// + /// AiSecret id + /// + /// 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 OptionsAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsAiSecretIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/ai_secret/{aiSecretId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsAiSecretIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsAiSecretIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsAiSecretIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsAiSecretIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsAiSecretIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsAiSecretIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsAiSecretIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsAiSecretIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsAiSecretIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsAiSecretIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs index 76da37b..3b6ff2c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsApiKeyResponse( public async global::System.Threading.Tasks.Task OptionsApiKeyAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsApiKeyAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/api_key`)
+ /// Enable CORS + ///
+ /// 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 OptionsApiKeyAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsApiKeyResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/api_key", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsApiKeyResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsApiKeyResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsApiKeyResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsApiKeyResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsApiKeyResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsApiKeyResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsApiKeyResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsApiKeyResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsApiKeyResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsApiKeyResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs index e663949..0bce34b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsApiKeyIdResponse( global::System.Guid apiKeyId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsApiKeyIdAsResponseAsync( + apiKeyId: apiKeyId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/api_key/{api_key_id}`)
+ /// Enable CORS + ///
+ /// + /// ApiKey id + /// + /// 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 OptionsApiKeyIdAsResponseAsync( + global::System.Guid apiKeyId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsApiKeyIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/api_key/{apiKeyId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsApiKeyIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsApiKeyIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsApiKeyIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsApiKeyIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsApiKeyIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsApiKeyIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsApiKeyIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsApiKeyIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsApiKeyIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsApiKeyIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs index 740f272..aa03605 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsCrossObjectInsertResponse( public async global::System.Threading.Tasks.Task OptionsCrossObjectInsertAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsCrossObjectInsertAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/insert`)
+ /// Enable CORS + ///
+ /// 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 OptionsCrossObjectInsertAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsCrossObjectInsertResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/insert", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsCrossObjectInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsCrossObjectInsertResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsCrossObjectInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsCrossObjectInsertResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsCrossObjectInsertResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsCrossObjectInsertResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsCrossObjectInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsCrossObjectInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsCrossObjectInsertResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsCrossObjectInsertResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs index 3ac5f51..8e01b09 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsDatasetResponse( public async global::System.Threading.Tasks.Task OptionsDatasetAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset`)
+ /// Enable CORS + ///
+ /// 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 OptionsDatasetAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsDatasetResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsDatasetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsDatasetResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsDatasetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsDatasetResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsDatasetResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsDatasetResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsDatasetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsDatasetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsDatasetResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsDatasetResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs index e2307b4..b2d2b45 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsDatasetIdResponse( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetIdAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset/{dataset_id}`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsDatasetIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsDatasetIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsDatasetIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsDatasetIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsDatasetIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsDatasetIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsDatasetIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsDatasetIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsDatasetIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsDatasetIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsDatasetIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs index c3a0747..ebec529 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetIdFeedbackAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/feedback`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdFeedbackAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/feedback", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsDatasetIdFeedbackResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs index 8656d28..1d39d29 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsDatasetIdFetchResponse( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetIdFetchAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/fetch`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdFetchAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsDatasetIdFetchResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/fetch", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsDatasetIdFetchResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsDatasetIdFetchResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsDatasetIdFetchResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsDatasetIdFetchResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsDatasetIdFetchResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsDatasetIdFetchResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsDatasetIdFetchResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsDatasetIdFetchResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsDatasetIdFetchResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsDatasetIdFetchResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs index 2432066..b98c0f6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsDatasetIdInsertResponse( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetIdInsertAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/insert`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdInsertAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsDatasetIdInsertResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/insert", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsDatasetIdInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsDatasetIdInsertResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsDatasetIdInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsDatasetIdInsertResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsDatasetIdInsertResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsDatasetIdInsertResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsDatasetIdInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsDatasetIdInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsDatasetIdInsertResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsDatasetIdInsertResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs index 61ce763..7cc7fe0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetIdSummarizeAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/summarize`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdSummarizeAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/summarize", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsDatasetIdSummarizeResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs index 91b8b60..9f16fee 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsDatasetSnapshotResponse( public async global::System.Threading.Tasks.Task OptionsDatasetSnapshotAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetSnapshotAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset_snapshot`)
+ /// Enable CORS + ///
+ /// 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 OptionsDatasetSnapshotAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsDatasetSnapshotResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset_snapshot", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsDatasetSnapshotResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsDatasetSnapshotResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsDatasetSnapshotResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsDatasetSnapshotResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsDatasetSnapshotResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsDatasetSnapshotResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsDatasetSnapshotResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsDatasetSnapshotResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsDatasetSnapshotResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsDatasetSnapshotResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs index 9496cbb..57a26bb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( global::System.Guid datasetSnapshotId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsDatasetSnapshotIdAsResponseAsync( + datasetSnapshotId: datasetSnapshotId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/dataset_snapshot/{dataset_snapshot_id}`)
+ /// Enable CORS + ///
+ /// + /// DatasetSnapshot id + /// + /// 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 OptionsDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset_snapshot/{datasetSnapshotId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsDatasetSnapshotIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs index 880a6f6..9b31c6f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsEnvVarResponse( public async global::System.Threading.Tasks.Task OptionsEnvVarAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsEnvVarAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/env_var`)
+ /// Enable CORS + ///
+ /// 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 OptionsEnvVarAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsEnvVarResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/env_var", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsEnvVarResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsEnvVarResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsEnvVarResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsEnvVarResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsEnvVarResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsEnvVarResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsEnvVarResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsEnvVarResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsEnvVarResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsEnvVarResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs index 485ee12..89fed14 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsEnvVarIdResponse( global::System.Guid envVarId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsEnvVarIdAsResponseAsync( + envVarId: envVarId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/env_var/{env_var_id}`)
+ /// Enable CORS + ///
+ /// + /// EnvVar id + /// + /// 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 OptionsEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsEnvVarIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/env_var/{envVarId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsEnvVarIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsEnvVarIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsEnvVarIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsEnvVarIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsEnvVarIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsEnvVarIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsEnvVarIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsEnvVarIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsEnvVarIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsEnvVarIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs index bd819cf..e2081e2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsExperimentResponse( public async global::System.Threading.Tasks.Task OptionsExperimentAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsExperimentAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/experiment`)
+ /// Enable CORS + ///
+ /// 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 OptionsExperimentAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsExperimentResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/experiment", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsExperimentResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsExperimentResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsExperimentResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsExperimentResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsExperimentResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsExperimentResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsExperimentResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsExperimentResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsExperimentResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsExperimentResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs index 876e546..0d54b06 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsExperimentIdResponse( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsExperimentIdAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/experiment/{experiment_id}`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsExperimentIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsExperimentIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsExperimentIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsExperimentIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsExperimentIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsExperimentIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsExperimentIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsExperimentIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsExperimentIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsExperimentIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsExperimentIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs index 9528764..e7c9952 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsExperimentIdFeedbackAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/feedback`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdFeedbackAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/feedback", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsExperimentIdFeedbackResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs index 4fa6523..a293a45 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsExperimentIdFetchResponse( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsExperimentIdFetchAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/fetch`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdFetchAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsExperimentIdFetchResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/fetch", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsExperimentIdFetchResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsExperimentIdFetchResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsExperimentIdFetchResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsExperimentIdFetchResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsExperimentIdFetchResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsExperimentIdFetchResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsExperimentIdFetchResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsExperimentIdFetchResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsExperimentIdFetchResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsExperimentIdFetchResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs index 99de2f5..27c4f93 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsExperimentIdInsertResponse( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsExperimentIdInsertAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/insert`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdInsertAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsExperimentIdInsertResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/insert", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsExperimentIdInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsExperimentIdInsertResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsExperimentIdInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsExperimentIdInsertResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsExperimentIdInsertResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsExperimentIdInsertResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsExperimentIdInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsExperimentIdInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsExperimentIdInsertResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsExperimentIdInsertResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs index 0027cc2..70e8279 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsExperimentIdSummarizeAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/summarize`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdSummarizeAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/summarize", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsExperimentIdSummarizeResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs index 38927e2..2ef1ade 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsFunctionResponse( public async global::System.Threading.Tasks.Task OptionsFunctionAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsFunctionAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/function`)
+ /// Enable CORS + ///
+ /// 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 OptionsFunctionAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsFunctionResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/function", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsFunctionResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsFunctionResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsFunctionResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsFunctionResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsFunctionResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsFunctionResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsFunctionResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsFunctionResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsFunctionResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsFunctionResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs index db9d333..7470e35 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsFunctionIdResponse( global::System.Guid functionId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsFunctionIdAsResponseAsync( + functionId: functionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/function/{function_id}`)
+ /// Enable CORS + ///
+ /// + /// Function id + /// + /// 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 OptionsFunctionIdAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsFunctionIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/function/{functionId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsFunctionIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsFunctionIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsFunctionIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsFunctionIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsFunctionIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsFunctionIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsFunctionIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsFunctionIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsFunctionIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsFunctionIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs index 861f2f5..975767d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsFunctionIdInvokeResponse( global::System.Guid functionId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsFunctionIdInvokeAsResponseAsync( + functionId: functionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/function/{function_id}/invoke`)
+ /// Enable CORS + ///
+ /// + /// Function id + /// + /// 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 OptionsFunctionIdInvokeAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsFunctionIdInvokeResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/function/{functionId}/invoke", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsFunctionIdInvokeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsFunctionIdInvokeResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsFunctionIdInvokeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsFunctionIdInvokeResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsFunctionIdInvokeResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsFunctionIdInvokeResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsFunctionIdInvokeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsFunctionIdInvokeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsFunctionIdInvokeResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsFunctionIdInvokeResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs index 9421d8d..1e3d14b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsGroupResponse( public async global::System.Threading.Tasks.Task OptionsGroupAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsGroupAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/group`)
+ /// Enable CORS + ///
+ /// 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 OptionsGroupAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsGroupResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/group", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsGroupResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsGroupResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsGroupResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsGroupResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsGroupResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsGroupResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsGroupResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsGroupResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsGroupResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsGroupResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs index c59dfb3..25e5430 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsGroupIdResponse( global::System.Guid groupId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsGroupIdAsResponseAsync( + groupId: groupId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/group/{group_id}`)
+ /// Enable CORS + ///
+ /// + /// Group id + /// + /// 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 OptionsGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsGroupIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/group/{groupId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsGroupIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsGroupIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsGroupIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsGroupIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsGroupIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsGroupIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsGroupIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsGroupIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsGroupIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsGroupIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs index 26961c3..9364900 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsIndexResponse( public async global::System.Threading.Tasks.Task OptionsIndexAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsIndexAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1`)
+ /// Enable CORS + ///
+ /// 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 OptionsIndexAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsIndexResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsIndexResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsIndexResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsIndexResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsIndexResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsIndexResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsIndexResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsIndexResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsIndexResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsIndexResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsIndexResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs index fd22452..df14f11 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsMcpServerResponse( public async global::System.Threading.Tasks.Task OptionsMcpServerAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsMcpServerAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/mcp_server`)
+ /// Enable CORS + ///
+ /// 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 OptionsMcpServerAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsMcpServerResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/mcp_server", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsMcpServerResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsMcpServerResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsMcpServerResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsMcpServerResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsMcpServerResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsMcpServerResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsMcpServerResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsMcpServerResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsMcpServerResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsMcpServerResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs index 8f35e19..fc5cb2e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsMcpServerIdResponse( global::System.Guid mcpServerId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsMcpServerIdAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/mcp_server/{mcp_server_id}`)
+ /// Enable CORS + ///
+ /// + /// McpServer id + /// + /// 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 OptionsMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsMcpServerIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/mcp_server/{mcpServerId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsMcpServerIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsMcpServerIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsMcpServerIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsMcpServerIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsMcpServerIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsMcpServerIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsMcpServerIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsMcpServerIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsMcpServerIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsMcpServerIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs index 695eae0..bce6622 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsOrganizationResponse( public async global::System.Threading.Tasks.Task OptionsOrganizationAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsOrganizationAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/organization`)
+ /// Enable CORS + ///
+ /// 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 OptionsOrganizationAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsOrganizationResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/organization", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsOrganizationResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsOrganizationResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsOrganizationResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsOrganizationResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsOrganizationResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsOrganizationResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsOrganizationResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsOrganizationResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsOrganizationResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsOrganizationResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs index f5c633b..aa40498 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsOrganizationIdResponse( global::System.Guid organizationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsOrganizationIdAsResponseAsync( + organizationId: organizationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/organization/{organization_id}`)
+ /// Enable CORS + ///
+ /// + /// Organization id + /// + /// 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 OptionsOrganizationIdAsResponseAsync( + global::System.Guid organizationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsOrganizationIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/organization/{organizationId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsOrganizationIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsOrganizationIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsOrganizationIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsOrganizationIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsOrganizationIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsOrganizationIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsOrganizationIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsOrganizationIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsOrganizationIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsOrganizationIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs index 3ae0599..52ca469 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsOrganizationMembersResponse( public async global::System.Threading.Tasks.Task OptionsOrganizationMembersAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsOrganizationMembersAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/organization/members`)
+ /// Enable CORS + ///
+ /// 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 OptionsOrganizationMembersAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsOrganizationMembersResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/organization/members", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsOrganizationMembersResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsOrganizationMembersResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsOrganizationMembersResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsOrganizationMembersResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsOrganizationMembersResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsOrganizationMembersResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsOrganizationMembersResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsOrganizationMembersResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsOrganizationMembersResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsOrganizationMembersResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs index d7f9dff..311767f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProjectResponse( public async global::System.Threading.Tasks.Task OptionsProjectAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProjectResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProjectResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProjectResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProjectResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProjectResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProjectResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProjectResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProjectResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProjectResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProjectResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProjectResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs index 5bc3f23..ac3c45b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProjectAutomationResponse( public async global::System.Threading.Tasks.Task OptionsProjectAutomationAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectAutomationAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_automation`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectAutomationAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProjectAutomationResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_automation", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProjectAutomationResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProjectAutomationResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProjectAutomationResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProjectAutomationResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProjectAutomationResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProjectAutomationResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProjectAutomationResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProjectAutomationResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProjectAutomationResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProjectAutomationResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs index 0e3ca1a..325c0f8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectAutomationIdResponse( global::System.Guid projectAutomationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectAutomationIdAsResponseAsync( + projectAutomationId: projectAutomationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_automation/{project_automation_id}`)
+ /// Enable CORS + ///
+ /// + /// ProjectAutomation id + /// + /// 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 OptionsProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectAutomationIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_automation/{projectAutomationId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectAutomationIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectAutomationIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectAutomationIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectAutomationIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectAutomationIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectAutomationIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectAutomationIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectAutomationIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectAutomationIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectAutomationIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs index 283233a..d4d8b69 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectIdResponse( global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectIdAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project/{project_id}`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project/{projectId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs index d66cc3c..d2b9062 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectLogsIdFeedbackAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_logs/{project_id}/feedback`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectLogsIdFeedbackAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/feedback", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectLogsIdFeedbackResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs index 59b074e..0c8fb1c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectLogsIdFetchAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_logs/{project_id}/fetch`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectLogsIdFetchAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/fetch", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectLogsIdFetchResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs index e530e0b..85c127e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectLogsIdInsertAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_logs/{project_id}/insert`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectLogsIdInsertAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/insert", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectLogsIdInsertResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs index df01f2f..473a5db 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProjectScoreResponse( public async global::System.Threading.Tasks.Task OptionsProjectScoreAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectScoreAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_score`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectScoreAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProjectScoreResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_score", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProjectScoreResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProjectScoreResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProjectScoreResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProjectScoreResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProjectScoreResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProjectScoreResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProjectScoreResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProjectScoreResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProjectScoreResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProjectScoreResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs index 1509129..cf5b130 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectScoreIdResponse( global::System.Guid projectScoreId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectScoreIdAsResponseAsync( + projectScoreId: projectScoreId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_score/{project_score_id}`)
+ /// Enable CORS + ///
+ /// + /// ProjectScore id + /// + /// 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 OptionsProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectScoreIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_score/{projectScoreId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectScoreIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectScoreIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectScoreIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectScoreIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectScoreIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectScoreIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectScoreIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectScoreIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectScoreIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectScoreIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs index e44a24c..e5516b4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProjectTagResponse( public async global::System.Threading.Tasks.Task OptionsProjectTagAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectTagAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_tag`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectTagAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProjectTagResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_tag", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProjectTagResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProjectTagResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProjectTagResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProjectTagResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProjectTagResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProjectTagResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProjectTagResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProjectTagResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProjectTagResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProjectTagResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs index 4facd38..cb2c2f0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsProjectTagIdResponse( global::System.Guid projectTagId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProjectTagIdAsResponseAsync( + projectTagId: projectTagId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/project_tag/{project_tag_id}`)
+ /// Enable CORS + ///
+ /// + /// ProjectTag id + /// + /// 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 OptionsProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsProjectTagIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_tag/{projectTagId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsProjectTagIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsProjectTagIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsProjectTagIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsProjectTagIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsProjectTagIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsProjectTagIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsProjectTagIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsProjectTagIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsProjectTagIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsProjectTagIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs index dbbae68..ec1cd3b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsPromptResponse( public async global::System.Threading.Tasks.Task OptionsPromptAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsPromptAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/prompt`)
+ /// Enable CORS + ///
+ /// 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 OptionsPromptAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsPromptResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/prompt", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsPromptResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsPromptResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsPromptResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsPromptResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsPromptResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsPromptResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsPromptResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsPromptResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsPromptResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsPromptResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs index 8036762..83e6adb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsPromptIdResponse( global::System.Guid promptId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsPromptIdAsResponseAsync( + promptId: promptId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/prompt/{prompt_id}`)
+ /// Enable CORS + ///
+ /// + /// Prompt id + /// + /// 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 OptionsPromptIdAsResponseAsync( + global::System.Guid promptId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsPromptIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/prompt/{promptId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsPromptIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsPromptIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsPromptIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsPromptIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsPromptIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsPromptIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsPromptIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsPromptIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsPromptIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsPromptIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs index 601d111..1394680 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProxyproxyautoResponse( public async global::System.Threading.Tasks.Task OptionsProxyproxyautoAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProxyproxyautoAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/proxy/auto`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxyautoAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProxyproxyautoResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/auto", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProxyproxyautoResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProxyproxyautoResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProxyproxyautoResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProxyproxyautoResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProxyproxyautoResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProxyproxyautoResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProxyproxyautoResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProxyproxyautoResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProxyproxyautoResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProxyproxyautoResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs index fa1bf28..9b93258 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( public async global::System.Threading.Tasks.Task OptionsProxyproxychatCompletionsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProxyproxychatCompletionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/proxy/chat/completions`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxychatCompletionsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/chat/completions", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProxyproxychatCompletionsResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs index bcfd8c1..7a96be7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProxyproxycompletionsResponse( public async global::System.Threading.Tasks.Task OptionsProxyproxycompletionsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProxyproxycompletionsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/proxy/completions`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxycompletionsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProxyproxycompletionsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/completions", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProxyproxycompletionsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProxyproxycompletionsResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProxyproxycompletionsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProxyproxycompletionsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProxyproxycompletionsResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProxyproxycompletionsResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProxyproxycompletionsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProxyproxycompletionsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProxyproxycompletionsResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProxyproxycompletionsResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs index 54381e1..2a78651 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProxyproxycredentialsResponse( public async global::System.Threading.Tasks.Task OptionsProxyproxycredentialsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProxyproxycredentialsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/proxy/credentials`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxycredentialsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProxyproxycredentialsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/credentials", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProxyproxycredentialsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProxyproxycredentialsResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProxyproxycredentialsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProxyproxycredentialsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProxyproxycredentialsResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProxyproxycredentialsResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProxyproxycredentialsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProxyproxycredentialsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProxyproxycredentialsResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProxyproxycredentialsResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs index 832d6a5..af3018b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( public async global::System.Threading.Tasks.Task OptionsProxyproxyembeddingsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsProxyproxyembeddingsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/proxy/embeddings`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxyembeddingsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/embeddings", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsProxyproxyembeddingsResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs index b7c7ae9..2f33930 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsRoleResponse( public async global::System.Threading.Tasks.Task OptionsRoleAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsRoleAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/role`)
+ /// Enable CORS + ///
+ /// 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 OptionsRoleAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsRoleResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/role", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsRoleResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsRoleResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsRoleResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsRoleResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsRoleResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsRoleResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsRoleResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsRoleResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsRoleResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsRoleResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs index 72c9300..7a63697 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsRoleIdResponse( global::System.Guid roleId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsRoleIdAsResponseAsync( + roleId: roleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/role/{role_id}`)
+ /// Enable CORS + ///
+ /// + /// Role id + /// + /// 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 OptionsRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsRoleIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/role/{roleId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsRoleIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsRoleIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsRoleIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsRoleIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsRoleIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsRoleIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsRoleIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsRoleIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsRoleIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsRoleIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs index 15b4ba9..28d4411 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsServiceTokenResponse( public async global::System.Threading.Tasks.Task OptionsServiceTokenAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsServiceTokenAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/service_token`)
+ /// Enable CORS + ///
+ /// 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 OptionsServiceTokenAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsServiceTokenResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/service_token", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsServiceTokenResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsServiceTokenResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsServiceTokenResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsServiceTokenResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsServiceTokenResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsServiceTokenResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsServiceTokenResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsServiceTokenResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsServiceTokenResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsServiceTokenResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs index f23be88..2b95327 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsServiceTokenIdResponse( global::System.Guid serviceTokenId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsServiceTokenIdAsResponseAsync( + serviceTokenId: serviceTokenId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/service_token/{service_token_id}`)
+ /// Enable CORS + ///
+ /// + /// ServiceToken id + /// + /// 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 OptionsServiceTokenIdAsResponseAsync( + global::System.Guid serviceTokenId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsServiceTokenIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/service_token/{serviceTokenId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsServiceTokenIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsServiceTokenIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsServiceTokenIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsServiceTokenIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsServiceTokenIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsServiceTokenIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsServiceTokenIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsServiceTokenIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsServiceTokenIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsServiceTokenIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs index 33f1ba3..cde2e30 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsSpanIframeResponse( public async global::System.Threading.Tasks.Task OptionsSpanIframeAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsSpanIframeAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/span_iframe`)
+ /// Enable CORS + ///
+ /// 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 OptionsSpanIframeAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsSpanIframeResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/span_iframe", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsSpanIframeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsSpanIframeResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsSpanIframeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsSpanIframeResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsSpanIframeResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsSpanIframeResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsSpanIframeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsSpanIframeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsSpanIframeResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsSpanIframeResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs index 19babf4..e1f665f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsSpanIframeIdResponse( global::System.Guid spanIframeId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsSpanIframeIdAsResponseAsync( + spanIframeId: spanIframeId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/span_iframe/{span_iframe_id}`)
+ /// Enable CORS + ///
+ /// + /// SpanIframe id + /// + /// 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 OptionsSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsSpanIframeIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/span_iframe/{spanIframeId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsSpanIframeIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsSpanIframeIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsSpanIframeIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsSpanIframeIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsSpanIframeIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsSpanIframeIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsSpanIframeIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsSpanIframeIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsSpanIframeIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsSpanIframeIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs index a4fde2d..e8fd5bb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsUserResponse( public async global::System.Threading.Tasks.Task OptionsUserAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsUserAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/user`)
+ /// Enable CORS + ///
+ /// 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 OptionsUserAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsUserResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/user", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsUserResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsUserResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsUserResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsUserResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsUserResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsUserResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsUserResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsUserResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsUserResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsUserResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs index 1b999a8..84ecee3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsUserIdResponse( global::System.Guid userId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsUserIdAsResponseAsync( + userId: userId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/user/{user_id}`)
+ /// Enable CORS + ///
+ /// + /// User id + /// + /// 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 OptionsUserIdAsResponseAsync( + global::System.Guid userId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsUserIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/user/{userId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsUserIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsUserIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsUserIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsUserIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsUserIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsUserIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsUserIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsUserIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsUserIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsUserIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs index 4b8fa45..67cc092 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs @@ -24,6 +24,22 @@ partial void ProcessOptionsViewResponse( public async global::System.Threading.Tasks.Task OptionsViewAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsViewAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/view`)
+ /// Enable CORS + ///
+ /// 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 OptionsViewAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -46,6 +62,7 @@ partial void ProcessOptionsViewResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/view", baseUri: HttpClient.BaseAddress); @@ -101,6 +118,8 @@ partial void ProcessOptionsViewResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -111,6 +130,11 @@ partial void ProcessOptionsViewResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -128,6 +152,8 @@ partial void ProcessOptionsViewResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -137,8 +163,7 @@ partial void ProcessOptionsViewResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -147,6 +172,11 @@ partial void ProcessOptionsViewResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -163,14 +193,15 @@ partial void ProcessOptionsViewResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +241,8 @@ partial void ProcessOptionsViewResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -230,6 +263,8 @@ partial void ProcessOptionsViewResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -288,6 +323,10 @@ partial void ProcessOptionsViewResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -309,6 +348,10 @@ partial void ProcessOptionsViewResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs index 58eebf4..b151770 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs @@ -30,6 +30,27 @@ partial void ProcessOptionsViewIdResponse( global::System.Guid viewId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await OptionsViewIdAsResponseAsync( + viewId: viewId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Enable CORS (`/v1/view/{view_id}`)
+ /// Enable CORS + ///
+ /// + /// View id + /// + /// 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 OptionsViewIdAsResponseAsync( + global::System.Guid viewId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -53,6 +74,7 @@ partial void ProcessOptionsViewIdResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/view/{viewId}", baseUri: HttpClient.BaseAddress); @@ -109,6 +131,8 @@ partial void ProcessOptionsViewIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -119,6 +143,11 @@ partial void ProcessOptionsViewIdResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -136,6 +165,8 @@ partial void ProcessOptionsViewIdResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -145,8 +176,7 @@ partial void ProcessOptionsViewIdResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -155,6 +185,11 @@ partial void ProcessOptionsViewIdResponse( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -171,14 +206,15 @@ partial void ProcessOptionsViewIdResponse( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +254,8 @@ partial void ProcessOptionsViewIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -238,6 +276,8 @@ partial void ProcessOptionsViewIdResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -296,6 +336,10 @@ partial void ProcessOptionsViewIdResponse( { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -317,6 +361,10 @@ partial void ProcessOptionsViewIdResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CorsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.g.cs index 8199e41..ceecf27 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.g.cs @@ -72,10 +72,10 @@ public CorsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public CorsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs index d3fe02f..1b7dec3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs @@ -51,6 +51,29 @@ partial void ProcessPostCrossObjectInsertResponseContent( /// public async global::System.Threading.Tasks.Task PostCrossObjectInsertAsync( + global::Braintrust.CrossObjectInsertRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostCrossObjectInsertAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cross-object insert
+ /// Insert events and feedback across object types + ///
+ /// + /// 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> PostCrossObjectInsertAsResponseAsync( + global::Braintrust.CrossObjectInsertRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessPostCrossObjectInsertResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/insert", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessPostCrossObjectInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessPostCrossObjectInsertResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessPostCrossObjectInsertResponseContent( 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 ProcessPostCrossObjectInsertResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessPostCrossObjectInsertResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessPostCrossObjectInsertResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessPostCrossObjectInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessPostCrossObjectInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -507,9 +549,13 @@ partial void ProcessPostCrossObjectInsertResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.CrossObjectInsertResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.CrossObjectInsertResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -537,9 +583,13 @@ partial void ProcessPostCrossObjectInsertResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.CrossObjectInsertResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.CrossObjectInsertResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.g.cs index 9a87636..87ad791 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.g.cs @@ -72,10 +72,10 @@ public CrossObjectClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public CrossObjectClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs index caabf72..657093d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( global::System.Guid datasetSnapshotId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDatasetSnapshotIdAsResponseAsync( + datasetSnapshotId: datasetSnapshotId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete dataset_snapshot
+ /// Delete a dataset_snapshot object by its id + ///
+ /// + /// DatasetSnapshot id + /// + /// 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> DeleteDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset_snapshot/{datasetSnapshotId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs index e9bb8ee..466b0fa 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetDatasetSnapshotResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetSnapshotAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + datasetSnapshotName: datasetSnapshotName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List dataset_snapshots
+ /// List out all dataset_snapshots. The dataset_snapshots are sorted by creation date, with the most recently-created dataset_snapshots coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the dataset_snapshot to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetDatasetSnapshotAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? datasetSnapshotName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetDatasetSnapshotResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset_snapshot", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("dataset_snapshot_name", datasetSnapshotName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetDatasetSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetDatasetSnapshotResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetDatasetSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetDatasetSnapshotResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetDatasetSnapshotResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetDatasetSnapshotResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetDatasetSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetDatasetSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetDatasetSnapshotResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetDatasetSnapshotResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetDatasetSnapshotResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetDatasetSnapshotResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetDatasetSnapshotResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetDatasetSnapshotResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs index 3ad70b6..a4b23e2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( global::System.Guid datasetSnapshotId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetSnapshotIdAsResponseAsync( + datasetSnapshotId: datasetSnapshotId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get dataset_snapshot
+ /// Get a dataset_snapshot object by its id + ///
+ /// + /// DatasetSnapshot id + /// + /// 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> GetDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset_snapshot/{datasetSnapshotId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs index 4465655..f3dc606 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( public async global::System.Threading.Tasks.Task PatchDatasetSnapshotIdAsync( global::System.Guid datasetSnapshotId, + global::Braintrust.PatchDatasetSnapshot request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchDatasetSnapshotIdAsResponseAsync( + datasetSnapshotId: datasetSnapshotId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update dataset_snapshot
+ /// Partially update a dataset_snapshot object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// DatasetSnapshot id + /// + /// + /// 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> PatchDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.PatchDatasetSnapshot request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset_snapshot/{datasetSnapshotId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs index 74567d6..cd74ad3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostDatasetSnapshotResponseContent( /// public async global::System.Threading.Tasks.Task PostDatasetSnapshotAsync( + global::Braintrust.CreateDatasetSnapshot request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostDatasetSnapshotAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create dataset_snapshot
+ /// Create a new dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will return the existing dataset_snapshot unmodified + ///
+ /// + /// 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> PostDatasetSnapshotAsResponseAsync( + global::Braintrust.CreateDatasetSnapshot request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostDatasetSnapshotResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset_snapshot", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostDatasetSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostDatasetSnapshotResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostDatasetSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostDatasetSnapshotResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostDatasetSnapshotResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostDatasetSnapshotResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostDatasetSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostDatasetSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostDatasetSnapshotResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostDatasetSnapshotResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs index 1a5652f..d5dfc77 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutDatasetSnapshotResponseContent( /// public async global::System.Threading.Tasks.Task PutDatasetSnapshotAsync( + global::Braintrust.CreateDatasetSnapshot request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutDatasetSnapshotAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace dataset_snapshot
+ /// Create or replace dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will replace the existing dataset_snapshot with the provided fields + ///
+ /// + /// 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> PutDatasetSnapshotAsResponseAsync( + global::Braintrust.CreateDatasetSnapshot request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutDatasetSnapshotResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset_snapshot", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutDatasetSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutDatasetSnapshotResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutDatasetSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutDatasetSnapshotResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutDatasetSnapshotResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutDatasetSnapshotResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutDatasetSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutDatasetSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutDatasetSnapshotResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.DatasetSnapshot.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutDatasetSnapshotResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.DatasetSnapshot.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.g.cs index 94d826f..44fe762 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.g.cs @@ -72,10 +72,10 @@ public DatasetSnapshotsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DatasetSnapshotsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs index 0c42016..a4359ff 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteDatasetIdResponseContent( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDatasetIdAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete dataset
+ /// Delete a dataset object by its id + ///
+ /// + /// Dataset id + /// + /// 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> DeleteDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteDatasetIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteDatasetIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteDatasetIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteDatasetIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteDatasetIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteDatasetIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteDatasetIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteDatasetIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteDatasetIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteDatasetIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteDatasetIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs index f86219e..544e3d6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs @@ -108,6 +108,66 @@ partial void ProcessGetDatasetResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + datasetName: datasetName, + projectName: projectName, + projectId: projectId, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List datasets
+ /// List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the dataset to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetDatasetAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? datasetName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -144,9 +204,10 @@ partial void ProcessGetDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -155,7 +216,7 @@ partial void ProcessGetDatasetResponseContent( .AddOptionalParameter("dataset_name", datasetName) .AddOptionalParameter("project_name", projectName) .AddOptionalParameter("project_id", projectId?.ToString()) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -234,6 +295,8 @@ partial void ProcessGetDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -244,6 +307,11 @@ partial void ProcessGetDatasetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -261,6 +329,8 @@ partial void ProcessGetDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -270,8 +340,7 @@ partial void ProcessGetDatasetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +349,11 @@ partial void ProcessGetDatasetResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -296,14 +370,15 @@ partial void ProcessGetDatasetResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -343,6 +418,8 @@ partial void ProcessGetDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -363,6 +440,8 @@ partial void ProcessGetDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -577,9 +656,13 @@ partial void ProcessGetDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetDatasetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetDatasetResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -607,9 +690,13 @@ partial void ProcessGetDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetDatasetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetDatasetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs index 39437a2..e3c68d0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetDatasetIdResponseContent( global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetIdAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get dataset
+ /// Get a dataset object by its id + ///
+ /// + /// Dataset id + /// + /// 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> GetDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetDatasetIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetDatasetIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetDatasetIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetDatasetIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetDatasetIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetDatasetIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetDatasetIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetDatasetIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetDatasetIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetDatasetIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetDatasetIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs index c4e44b1..8bc3c54 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs @@ -95,6 +95,56 @@ partial void ProcessGetDatasetIdFetchResponseContent( string? version = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetIdFetchAsResponseAsync( + datasetId: datasetId, + limit: limit, + maxXactId: maxXactId, + maxRootSpanId: maxRootSpanId, + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch dataset (GET form)
+ /// Fetch the events in a dataset. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Dataset id + /// + /// + /// limit the number of traces fetched
+ /// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
+ /// The `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// Retrieve a snapshot of events from a past time
+ /// The version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch. + /// + /// 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> GetDatasetIdFetchAsResponseAsync( + global::System.Guid datasetId, + int? limit = default, + string? maxXactId = default, + string? maxRootSpanId = default, + string? version = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -128,14 +178,15 @@ partial void ProcessGetDatasetIdFetchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/fetch", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("max_xact_id", maxXactId) .AddOptionalParameter("max_root_span_id", maxRootSpanId) - .AddOptionalParameter("version", version) + .AddOptionalParameter("version", version) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -211,6 +262,8 @@ partial void ProcessGetDatasetIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +274,11 @@ partial void ProcessGetDatasetIdFetchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +296,8 @@ partial void ProcessGetDatasetIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +307,7 @@ partial void ProcessGetDatasetIdFetchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +316,11 @@ partial void ProcessGetDatasetIdFetchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +337,15 @@ partial void ProcessGetDatasetIdFetchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +385,8 @@ partial void ProcessGetDatasetIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +407,8 @@ partial void ProcessGetDatasetIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -554,9 +623,13 @@ partial void ProcessGetDatasetIdFetchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FetchDatasetEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FetchDatasetEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -584,9 +657,13 @@ partial void ProcessGetDatasetIdFetchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FetchDatasetEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FetchDatasetEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs index 64a91f5..68f8dbf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs @@ -61,6 +61,34 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( bool? summarizeData = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetIdSummarizeAsResponseAsync( + datasetId: datasetId, + summarizeData: summarizeData, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Summarize dataset
+ /// Summarize dataset + ///
+ /// + /// Dataset id + /// + /// + /// Whether to summarize the data. If false (or omitted), only the metadata will be returned. + /// + /// 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> GetDatasetIdSummarizeAsResponseAsync( + global::System.Guid datasetId, + bool? summarizeData = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -91,11 +119,12 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/summarize", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("summarize_data", summarizeData?.ToString().ToLowerInvariant()) + .AddOptionalParameter("summarize_data", summarizeData?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -168,6 +197,8 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -178,6 +209,11 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -195,6 +231,8 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -204,8 +242,7 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -214,6 +251,11 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -230,14 +272,15 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -277,6 +320,8 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -297,6 +342,8 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -511,9 +558,13 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SummarizeDatasetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SummarizeDatasetResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -541,9 +592,13 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SummarizeDatasetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SummarizeDatasetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs index 629777c..9abdd36 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchDatasetIdResponseContent( public async global::System.Threading.Tasks.Task PatchDatasetIdAsync( global::System.Guid datasetId, + global::Braintrust.PatchDataset request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchDatasetIdAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update dataset
+ /// Partially update a dataset object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Dataset id + /// + /// + /// 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> PatchDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.PatchDataset request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchDatasetIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchDatasetIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchDatasetIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchDatasetIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchDatasetIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchDatasetIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchDatasetIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchDatasetIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchDatasetIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchDatasetIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchDatasetIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs index 80a3ab8..0f04b5c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostDatasetResponseContent( /// public async global::System.Threading.Tasks.Task PostDatasetAsync( + global::Braintrust.CreateDataset request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostDatasetAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create dataset
+ /// Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified + ///
+ /// + /// 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> PostDatasetAsResponseAsync( + global::Braintrust.CreateDataset request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/dataset", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostDatasetResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostDatasetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostDatasetResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostDatasetResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Dataset.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs index 837ad75..7bdf373 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( public async global::System.Threading.Tasks.Task PostDatasetIdFeedbackAsync( global::System.Guid datasetId, + global::Braintrust.FeedbackDatasetEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostDatasetIdFeedbackAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Feedback for dataset events
+ /// Log feedback for a set of dataset events + ///
+ /// + /// Dataset id + /// + /// + /// 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> PostDatasetIdFeedbackAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.FeedbackDatasetEventRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/feedback", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FeedbackResponseSchema.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FeedbackResponseSchema.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FeedbackResponseSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FeedbackResponseSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs index fe31fa7..d6debe2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostDatasetIdFetchResponseContent( public async global::System.Threading.Tasks.Task PostDatasetIdFetchAsync( global::System.Guid datasetId, + global::Braintrust.FetchEventsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostDatasetIdFetchAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch dataset (POST form)
+ /// Fetch the events in a dataset. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Dataset id + /// + /// + /// 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> PostDatasetIdFetchAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.FetchEventsRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostDatasetIdFetchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/fetch", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostDatasetIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostDatasetIdFetchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostDatasetIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostDatasetIdFetchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostDatasetIdFetchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostDatasetIdFetchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostDatasetIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostDatasetIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostDatasetIdFetchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FetchDatasetEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FetchDatasetEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostDatasetIdFetchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FetchDatasetEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FetchDatasetEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs index c18a10f..9f561b3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostDatasetIdInsertResponseContent( public async global::System.Threading.Tasks.Task PostDatasetIdInsertAsync( global::System.Guid datasetId, + global::Braintrust.InsertDatasetEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostDatasetIdInsertAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Insert dataset events
+ /// Insert a set of events into the dataset + ///
+ /// + /// Dataset id + /// + /// + /// 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> PostDatasetIdInsertAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.InsertDatasetEventRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostDatasetIdInsertResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/dataset/{datasetId}/insert", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostDatasetIdInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostDatasetIdInsertResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostDatasetIdInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostDatasetIdInsertResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostDatasetIdInsertResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostDatasetIdInsertResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostDatasetIdInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostDatasetIdInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostDatasetIdInsertResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.InsertEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.InsertEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostDatasetIdInsertResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.InsertEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.InsertEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.g.cs index 68370cc..839da4b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.g.cs @@ -72,10 +72,10 @@ public DatasetsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DatasetsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs index df54fbf..b175132 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteEnvVarIdResponseContent( global::System.Guid envVarId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteEnvVarIdAsResponseAsync( + envVarId: envVarId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete env_var
+ /// Delete an env_var object by its id + ///
+ /// + /// EnvVar id + /// + /// 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> DeleteEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteEnvVarIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/env_var/{envVarId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteEnvVarIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteEnvVarIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteEnvVarIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteEnvVarIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteEnvVarIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteEnvVarIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteEnvVarIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteEnvVarIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteEnvVarIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteEnvVarIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs index 02e7289..a8381e0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs @@ -88,6 +88,49 @@ partial void ProcessGetEnvVarResponseContent( global::System.Guid? objectId = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetEnvVarAsResponseAsync( + limit: limit, + ids: ids, + envVarName: envVarName, + objectType: objectType, + objectId: objectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List env_vars
+ /// List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the env_var to search for + /// + /// + /// The type of the object the environment variable is scoped for + /// + /// + /// The id of the object the environment variable is scoped for + /// + /// 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> GetEnvVarAsResponseAsync( + int? limit = default, + global::Braintrust.Ids? ids = default, + string? envVarName = default, + global::Braintrust.EnvVarObjectType? objectType = default, + global::System.Guid? objectId = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -121,15 +164,16 @@ partial void ProcessGetEnvVarResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/env_var", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("env_var_name", envVarName) .AddOptionalParameter("object_type", objectType?.ToValueString()) - .AddOptionalParameter("object_id", objectId?.ToString()) + .AddOptionalParameter("object_id", objectId?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -205,6 +249,8 @@ partial void ProcessGetEnvVarResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -215,6 +261,11 @@ partial void ProcessGetEnvVarResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -232,6 +283,8 @@ partial void ProcessGetEnvVarResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -241,8 +294,7 @@ partial void ProcessGetEnvVarResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -251,6 +303,11 @@ partial void ProcessGetEnvVarResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -267,14 +324,15 @@ partial void ProcessGetEnvVarResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -314,6 +372,8 @@ partial void ProcessGetEnvVarResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -334,6 +394,8 @@ partial void ProcessGetEnvVarResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -548,9 +610,13 @@ partial void ProcessGetEnvVarResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetEnvVarResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetEnvVarResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -578,9 +644,13 @@ partial void ProcessGetEnvVarResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetEnvVarResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetEnvVarResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs index 8df144e..969ef26 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetEnvVarIdResponseContent( global::System.Guid envVarId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetEnvVarIdAsResponseAsync( + envVarId: envVarId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get env_var
+ /// Get an env_var object by its id + ///
+ /// + /// EnvVar id + /// + /// 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> GetEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetEnvVarIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/env_var/{envVarId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetEnvVarIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetEnvVarIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetEnvVarIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetEnvVarIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetEnvVarIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetEnvVarIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetEnvVarIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetEnvVarIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetEnvVarIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetEnvVarIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs index 31aa642..cfffa5c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchEnvVarIdResponseContent( public async global::System.Threading.Tasks.Task PatchEnvVarIdAsync( global::System.Guid envVarId, + global::Braintrust.PatchEnvVarIdRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchEnvVarIdAsResponseAsync( + envVarId: envVarId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update env_var
+ /// Partially update an env_var object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// EnvVar id + /// + /// + /// 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> PatchEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.PatchEnvVarIdRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchEnvVarIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/env_var/{envVarId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchEnvVarIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchEnvVarIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchEnvVarIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchEnvVarIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchEnvVarIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchEnvVarIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchEnvVarIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchEnvVarIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchEnvVarIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchEnvVarIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs index 393ee3f..c4937bd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostEnvVarResponseContent( /// public async global::System.Threading.Tasks.Task PostEnvVarAsync( + global::Braintrust.PostEnvVarRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostEnvVarAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create env_var
+ /// Create a new env_var. If there is an existing env_var with the same name as the one specified in the request, will return the existing env_var unmodified + ///
+ /// + /// 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> PostEnvVarAsResponseAsync( + global::Braintrust.PostEnvVarRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostEnvVarResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/env_var", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostEnvVarResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostEnvVarResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostEnvVarResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostEnvVarResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostEnvVarResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostEnvVarResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostEnvVarResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostEnvVarResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostEnvVarResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostEnvVarResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs index 427af5f..eac2ab8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutEnvVarResponseContent( /// public async global::System.Threading.Tasks.Task PutEnvVarAsync( + global::Braintrust.PutEnvVarRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutEnvVarAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace env_var
+ /// Create or replace env_var. If there is an existing env_var with the same name as the one specified in the request, will replace the existing env_var with the provided fields + ///
+ /// + /// 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> PutEnvVarAsResponseAsync( + global::Braintrust.PutEnvVarRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutEnvVarResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/env_var", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutEnvVarResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutEnvVarResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutEnvVarResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutEnvVarResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutEnvVarResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutEnvVarResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutEnvVarResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutEnvVarResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutEnvVarResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.EnvVar.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutEnvVarResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.EnvVar.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.g.cs index 3c9b761..2a8be7f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.g.cs @@ -72,10 +72,10 @@ public EnvVarsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EnvVarsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs index 2e47691..3e4f393 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs @@ -60,6 +60,29 @@ partial void ProcessCreateEnvironmentResponseContent( /// public async global::System.Threading.Tasks.Task CreateEnvironmentAsync( + global::Braintrust.CreateEnvironment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateEnvironmentAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create environment
+ /// Create a new environment + ///
+ /// + /// 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> CreateEnvironmentAsResponseAsync( + global::Braintrust.CreateEnvironment request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessCreateEnvironmentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/environment", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessCreateEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessCreateEnvironmentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessCreateEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessCreateEnvironmentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessCreateEnvironmentResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessCreateEnvironmentResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessCreateEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessCreateEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessCreateEnvironmentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessCreateEnvironmentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs index 9f44af8..4272b80 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs @@ -61,6 +61,26 @@ partial void ProcessDeleteEnvironmentResponseContent( global::System.Guid environmentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteEnvironmentAsResponseAsync( + environmentId: environmentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete environment + /// + /// + /// 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> DeleteEnvironmentAsResponseAsync( + global::System.Guid environmentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +110,7 @@ partial void ProcessDeleteEnvironmentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/environment/{environmentId}", baseUri: HttpClient.BaseAddress); @@ -163,6 +184,8 @@ partial void ProcessDeleteEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +196,11 @@ partial void ProcessDeleteEnvironmentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -190,6 +218,8 @@ partial void ProcessDeleteEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -199,8 +229,7 @@ partial void ProcessDeleteEnvironmentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -209,6 +238,11 @@ partial void ProcessDeleteEnvironmentResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -225,14 +259,15 @@ partial void ProcessDeleteEnvironmentResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +307,8 @@ partial void ProcessDeleteEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +329,8 @@ partial void ProcessDeleteEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -506,9 +545,13 @@ partial void ProcessDeleteEnvironmentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -536,9 +579,13 @@ partial void ProcessDeleteEnvironmentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs index 55f6771..5749096 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs @@ -61,6 +61,26 @@ partial void ProcessGetEnvironmentResponseContent( global::System.Guid environmentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetEnvironmentAsResponseAsync( + environmentId: environmentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get environment + /// + /// + /// 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> GetEnvironmentAsResponseAsync( + global::System.Guid environmentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +110,7 @@ partial void ProcessGetEnvironmentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/environment/{environmentId}", baseUri: HttpClient.BaseAddress); @@ -163,6 +184,8 @@ partial void ProcessGetEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +196,11 @@ partial void ProcessGetEnvironmentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -190,6 +218,8 @@ partial void ProcessGetEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -199,8 +229,7 @@ partial void ProcessGetEnvironmentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -209,6 +238,11 @@ partial void ProcessGetEnvironmentResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -225,14 +259,15 @@ partial void ProcessGetEnvironmentResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +307,8 @@ partial void ProcessGetEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +329,8 @@ partial void ProcessGetEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -506,9 +545,13 @@ partial void ProcessGetEnvironmentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -536,9 +579,13 @@ partial void ProcessGetEnvironmentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs index c904366..442ec68 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs @@ -74,6 +74,37 @@ partial void ProcessListEnvironmentsResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListEnvironmentsAsResponseAsync( + ids: ids, + name: name, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List environments
+ /// List out all environments. The environments are sorted by creation date, with the most recently-created environments first. + ///
+ /// + /// Filter by environment IDs. Supports a single ID or multiple values. + /// + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> ListEnvironmentsAsResponseAsync( + global::Braintrust.AnyOf>? ids = default, + string? name = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,13 +136,14 @@ partial void ProcessListEnvironmentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/environment", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("name", name) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -185,6 +217,8 @@ partial void ProcessListEnvironmentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +229,11 @@ partial void ProcessListEnvironmentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +251,8 @@ partial void ProcessListEnvironmentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +262,7 @@ partial void ProcessListEnvironmentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +271,11 @@ partial void ProcessListEnvironmentsResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +292,15 @@ partial void ProcessListEnvironmentsResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +340,8 @@ partial void ProcessListEnvironmentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +362,8 @@ partial void ProcessListEnvironmentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -528,9 +578,13 @@ partial void ProcessListEnvironmentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ListEnvironmentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ListEnvironmentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -558,9 +612,13 @@ partial void ProcessListEnvironmentsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ListEnvironmentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ListEnvironmentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs index 4f14e1d..59c6b07 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs @@ -63,6 +63,31 @@ partial void ProcessUpdateEnvironmentResponseContent( public async global::System.Threading.Tasks.Task UpdateEnvironmentAsync( global::System.Guid environmentId, + global::Braintrust.PatchEnvironment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateEnvironmentAsResponseAsync( + environmentId: environmentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update environment + /// + /// + /// + /// 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> UpdateEnvironmentAsResponseAsync( + global::System.Guid environmentId, + global::Braintrust.PatchEnvironment request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +123,7 @@ partial void ProcessUpdateEnvironmentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/environment/{environmentId}", baseUri: HttpClient.BaseAddress); @@ -178,6 +204,8 @@ partial void ProcessUpdateEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +216,11 @@ partial void ProcessUpdateEnvironmentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +238,8 @@ partial void ProcessUpdateEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +249,7 @@ partial void ProcessUpdateEnvironmentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +258,11 @@ partial void ProcessUpdateEnvironmentResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +279,15 @@ partial void ProcessUpdateEnvironmentResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +327,8 @@ partial void ProcessUpdateEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +349,8 @@ partial void ProcessUpdateEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -521,9 +565,13 @@ partial void ProcessUpdateEnvironmentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Environment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -551,9 +599,13 @@ partial void ProcessUpdateEnvironmentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Environment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.g.cs index 031a07b..77ab6ab 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.g.cs @@ -72,10 +72,10 @@ public EnvironmentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EnvironmentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs b/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs index 40536a1..2a616c6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs @@ -60,6 +60,29 @@ partial void ProcessEvalLaunchResponseContent( /// public async global::System.Threading.Tasks.Task EvalLaunchAsync( + global::Braintrust.RunEval request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EvalLaunchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Launch an eval
+ /// Launch an evaluation. This is the API-equivalent of the `Eval` function that is built into the Braintrust SDK. In the Eval API, you provide pointers to a dataset, task function, and scoring functions. The API will then run the evaluation, create an experiment, and return the results along with a link to the experiment. To learn more about evals, see the [Evals guide](https://www.braintrust.dev/docs/evaluate). + ///
+ /// + /// 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> EvalLaunchAsResponseAsync( + global::Braintrust.RunEval request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,10 +113,11 @@ partial void ProcessEvalLaunchResponseContent( var __maxAttempts = global::Braintrust.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/eval", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessEvalLaunchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessEvalLaunchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessEvalLaunchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessEvalLaunchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessEvalLaunchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessEvalLaunchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessEvalLaunchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessEvalLaunchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,9 +368,13 @@ partial void ProcessEvalLaunchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SummarizeExperimentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SummarizeExperimentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -356,9 +402,13 @@ partial void ProcessEvalLaunchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SummarizeExperimentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SummarizeExperimentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.EvalsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.EvalsClient.g.cs index 01750f8..79ceddd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EvalsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EvalsClient.g.cs @@ -72,10 +72,10 @@ public EvalsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EvalsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs index ed2870d..2d43088 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteExperimentIdResponseContent( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteExperimentIdAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete experiment
+ /// Delete an experiment object by its id + ///
+ /// + /// Experiment id + /// + /// 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> DeleteExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteExperimentIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteExperimentIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteExperimentIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteExperimentIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteExperimentIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteExperimentIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteExperimentIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteExperimentIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteExperimentIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteExperimentIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteExperimentIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs index b493b1b..3b8e4cf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs @@ -109,6 +109,67 @@ partial void ProcessGetExperimentResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetExperimentAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + experimentName: experimentName, + projectName: projectName, + projectId: projectId, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List experiments
+ /// List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first + ///
+ /// + /// Limit the number of objects to return
+ /// Default Value: 1000 + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the experiment to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetExperimentAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? experimentName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -145,9 +206,10 @@ partial void ProcessGetExperimentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/experiment", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -156,7 +218,7 @@ partial void ProcessGetExperimentResponseContent( .AddOptionalParameter("experiment_name", experimentName) .AddOptionalParameter("project_name", projectName) .AddOptionalParameter("project_id", projectId?.ToString()) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -235,6 +297,8 @@ partial void ProcessGetExperimentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -245,6 +309,11 @@ partial void ProcessGetExperimentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -262,6 +331,8 @@ partial void ProcessGetExperimentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -271,8 +342,7 @@ partial void ProcessGetExperimentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +351,11 @@ partial void ProcessGetExperimentResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -297,14 +372,15 @@ partial void ProcessGetExperimentResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -344,6 +420,8 @@ partial void ProcessGetExperimentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -364,6 +442,8 @@ partial void ProcessGetExperimentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -578,9 +658,13 @@ partial void ProcessGetExperimentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetExperimentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetExperimentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -608,9 +692,13 @@ partial void ProcessGetExperimentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetExperimentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetExperimentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs index f5b76b0..43cb952 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetExperimentIdResponseContent( global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetExperimentIdAsResponseAsync( + experimentId: experimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get experiment
+ /// Get an experiment object by its id + ///
+ /// + /// Experiment id + /// + /// 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> GetExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetExperimentIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetExperimentIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetExperimentIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetExperimentIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetExperimentIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetExperimentIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetExperimentIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetExperimentIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetExperimentIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetExperimentIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetExperimentIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs index 9d8e2c6..ad47cb2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs @@ -95,6 +95,56 @@ partial void ProcessGetExperimentIdFetchResponseContent( string? version = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetExperimentIdFetchAsResponseAsync( + experimentId: experimentId, + limit: limit, + maxXactId: maxXactId, + maxRootSpanId: maxRootSpanId, + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch experiment (GET form)
+ /// Fetch the events in an experiment. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Experiment id + /// + /// + /// limit the number of traces fetched
+ /// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
+ /// The `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// Retrieve a snapshot of events from a past time
+ /// The version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch. + /// + /// 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> GetExperimentIdFetchAsResponseAsync( + global::System.Guid experimentId, + int? limit = default, + string? maxXactId = default, + string? maxRootSpanId = default, + string? version = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -128,14 +178,15 @@ partial void ProcessGetExperimentIdFetchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/fetch", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("max_xact_id", maxXactId) .AddOptionalParameter("max_root_span_id", maxRootSpanId) - .AddOptionalParameter("version", version) + .AddOptionalParameter("version", version) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -211,6 +262,8 @@ partial void ProcessGetExperimentIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +274,11 @@ partial void ProcessGetExperimentIdFetchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +296,8 @@ partial void ProcessGetExperimentIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +307,7 @@ partial void ProcessGetExperimentIdFetchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +316,11 @@ partial void ProcessGetExperimentIdFetchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +337,15 @@ partial void ProcessGetExperimentIdFetchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +385,8 @@ partial void ProcessGetExperimentIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +407,8 @@ partial void ProcessGetExperimentIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -554,9 +623,13 @@ partial void ProcessGetExperimentIdFetchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FetchExperimentEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FetchExperimentEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -584,9 +657,13 @@ partial void ProcessGetExperimentIdFetchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FetchExperimentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FetchExperimentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs index 072053e..377cea3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs @@ -67,6 +67,39 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( global::System.Guid? comparisonExperimentId = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetExperimentIdSummarizeAsResponseAsync( + experimentId: experimentId, + summarizeScores: summarizeScores, + comparisonExperimentId: comparisonExperimentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Summarize experiment
+ /// Summarize experiment + ///
+ /// + /// Experiment id + /// + /// + /// Whether to summarize the scores and metrics. If false (or omitted), only the metadata will be returned. + /// + /// + /// The experiment to compare against, if summarizing scores and metrics. If omitted, will fall back to the `base_exp_id` stored in the experiment metadata, and then to the most recent experiment run in the same project. Must pass `summarize_scores=true` for this id to be used + /// + /// 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> GetExperimentIdSummarizeAsResponseAsync( + global::System.Guid experimentId, + bool? summarizeScores = default, + global::System.Guid? comparisonExperimentId = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -98,12 +131,13 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/summarize", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("summarize_scores", summarizeScores?.ToString().ToLowerInvariant()) - .AddOptionalParameter("comparison_experiment_id", comparisonExperimentId?.ToString()) + .AddOptionalParameter("comparison_experiment_id", comparisonExperimentId?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -177,6 +211,8 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -187,6 +223,11 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -204,6 +245,8 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -213,8 +256,7 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -223,6 +265,11 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -239,14 +286,15 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -286,6 +334,8 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -306,6 +356,8 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -520,9 +572,13 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SummarizeExperimentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SummarizeExperimentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -550,9 +606,13 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SummarizeExperimentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SummarizeExperimentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs index 904acab..c6bbdf6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchExperimentIdResponseContent( public async global::System.Threading.Tasks.Task PatchExperimentIdAsync( global::System.Guid experimentId, + global::Braintrust.PatchExperiment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchExperimentIdAsResponseAsync( + experimentId: experimentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update experiment
+ /// Partially update an experiment object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Experiment id + /// + /// + /// 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> PatchExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.PatchExperiment request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchExperimentIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchExperimentIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchExperimentIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchExperimentIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchExperimentIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchExperimentIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchExperimentIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchExperimentIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchExperimentIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchExperimentIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchExperimentIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs index 046e77a..96defde 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostExperimentResponseContent( /// public async global::System.Threading.Tasks.Task PostExperimentAsync( + global::Braintrust.CreateExperiment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostExperimentAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create experiment
+ /// Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified + ///
+ /// + /// 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> PostExperimentAsResponseAsync( + global::Braintrust.CreateExperiment request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostExperimentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/experiment", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostExperimentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostExperimentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostExperimentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostExperimentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostExperimentResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostExperimentResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostExperimentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostExperimentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostExperimentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Experiment.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostExperimentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Experiment.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs index 0317fe4..a5753cf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( public async global::System.Threading.Tasks.Task PostExperimentIdFeedbackAsync( global::System.Guid experimentId, + global::Braintrust.FeedbackExperimentEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostExperimentIdFeedbackAsResponseAsync( + experimentId: experimentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Feedback for experiment events
+ /// Log feedback for a set of experiment events + ///
+ /// + /// Experiment id + /// + /// + /// 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> PostExperimentIdFeedbackAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.FeedbackExperimentEventRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/feedback", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FeedbackResponseSchema.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FeedbackResponseSchema.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FeedbackResponseSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FeedbackResponseSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs index e6da976..aacfbb3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostExperimentIdFetchResponseContent( public async global::System.Threading.Tasks.Task PostExperimentIdFetchAsync( global::System.Guid experimentId, + global::Braintrust.FetchEventsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostExperimentIdFetchAsResponseAsync( + experimentId: experimentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch experiment (POST form)
+ /// Fetch the events in an experiment. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Experiment id + /// + /// + /// 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> PostExperimentIdFetchAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.FetchEventsRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostExperimentIdFetchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/fetch", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostExperimentIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostExperimentIdFetchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostExperimentIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostExperimentIdFetchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostExperimentIdFetchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostExperimentIdFetchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostExperimentIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostExperimentIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostExperimentIdFetchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FetchExperimentEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FetchExperimentEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostExperimentIdFetchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FetchExperimentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FetchExperimentEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs index bc77fc2..ec487d6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostExperimentIdInsertResponseContent( public async global::System.Threading.Tasks.Task PostExperimentIdInsertAsync( global::System.Guid experimentId, + global::Braintrust.InsertExperimentEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostExperimentIdInsertAsResponseAsync( + experimentId: experimentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Insert experiment events
+ /// Insert a set of events into the experiment + ///
+ /// + /// Experiment id + /// + /// + /// 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> PostExperimentIdInsertAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.InsertExperimentEventRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostExperimentIdInsertResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/experiment/{experimentId}/insert", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostExperimentIdInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostExperimentIdInsertResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostExperimentIdInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostExperimentIdInsertResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostExperimentIdInsertResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostExperimentIdInsertResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostExperimentIdInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostExperimentIdInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostExperimentIdInsertResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.InsertEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.InsertEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostExperimentIdInsertResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.InsertEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.InsertEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.g.cs index d10a30c..5f722fc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.g.cs @@ -72,10 +72,10 @@ public ExperimentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ExperimentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs index fb2c81f..e5914ba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteFunctionIdResponseContent( global::System.Guid functionId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteFunctionIdAsResponseAsync( + functionId: functionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete function
+ /// Delete a function object by its id + ///
+ /// + /// Function id + /// + /// 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> DeleteFunctionIdAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteFunctionIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/function/{functionId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteFunctionIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteFunctionIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteFunctionIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteFunctionIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteFunctionIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteFunctionIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteFunctionIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteFunctionIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteFunctionIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteFunctionIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs index 285ec1f..61fe220 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs @@ -128,6 +128,83 @@ partial void ProcessGetFunctionResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFunctionAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + functionName: functionName, + projectName: projectName, + projectId: projectId, + slug: slug, + version: version, + environment: environment, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List functions
+ /// List out all functions. The functions are sorted by creation date, with the most recently-created functions coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the function to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Retrieve prompt with a specific slug + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow results. + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetFunctionAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? functionName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? slug = default, + string? version = default, + string? environment = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -167,9 +244,10 @@ partial void ProcessGetFunctionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/function", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -181,7 +259,7 @@ partial void ProcessGetFunctionResponseContent( .AddOptionalParameter("slug", slug) .AddOptionalParameter("version", version) .AddOptionalParameter("environment", environment) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -263,6 +341,8 @@ partial void ProcessGetFunctionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -273,6 +353,11 @@ partial void ProcessGetFunctionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -290,6 +375,8 @@ partial void ProcessGetFunctionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -299,8 +386,7 @@ partial void ProcessGetFunctionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +395,11 @@ partial void ProcessGetFunctionResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -325,14 +416,15 @@ partial void ProcessGetFunctionResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -372,6 +464,8 @@ partial void ProcessGetFunctionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -392,6 +486,8 @@ partial void ProcessGetFunctionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -606,9 +702,13 @@ partial void ProcessGetFunctionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetFunctionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetFunctionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -636,9 +736,13 @@ partial void ProcessGetFunctionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetFunctionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetFunctionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs index d56c288..46b1abb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs @@ -78,6 +78,41 @@ partial void ProcessGetFunctionIdResponseContent( string? environment = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFunctionIdAsResponseAsync( + functionId: functionId, + version: version, + environment: environment, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get function
+ /// Get a function object by its id + ///
+ /// + /// Function id + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow 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> GetFunctionIdAsResponseAsync( + global::System.Guid functionId, + string? version = default, + string? environment = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,12 +144,13 @@ partial void ProcessGetFunctionIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/function/{functionId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("version", version) - .AddOptionalParameter("environment", environment) + .AddOptionalParameter("environment", environment) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -188,6 +224,8 @@ partial void ProcessGetFunctionIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +236,11 @@ partial void ProcessGetFunctionIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +258,8 @@ partial void ProcessGetFunctionIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +269,7 @@ partial void ProcessGetFunctionIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +278,11 @@ partial void ProcessGetFunctionIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +299,15 @@ partial void ProcessGetFunctionIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +347,8 @@ partial void ProcessGetFunctionIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +369,8 @@ partial void ProcessGetFunctionIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -531,9 +585,13 @@ partial void ProcessGetFunctionIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -561,9 +619,13 @@ partial void ProcessGetFunctionIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs index 2f0ff1c..1e389af 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchFunctionIdResponseContent( public async global::System.Threading.Tasks.Task PatchFunctionIdAsync( global::System.Guid functionId, + global::Braintrust.PatchFunction request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchFunctionIdAsResponseAsync( + functionId: functionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update function
+ /// Partially update a function object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Function id + /// + /// + /// 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> PatchFunctionIdAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.PatchFunction request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchFunctionIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/function/{functionId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchFunctionIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchFunctionIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchFunctionIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchFunctionIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchFunctionIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchFunctionIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchFunctionIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchFunctionIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchFunctionIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchFunctionIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs index 83afc67..ef79d8e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostFunctionResponseContent( /// public async global::System.Threading.Tasks.Task PostFunctionAsync( + global::Braintrust.CreateFunction request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostFunctionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create function
+ /// Create a new function. If there is an existing function in the project with the same slug as the one specified in the request, will return the existing function unmodified + ///
+ /// + /// 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> PostFunctionAsResponseAsync( + global::Braintrust.CreateFunction request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostFunctionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/function", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostFunctionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostFunctionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostFunctionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostFunctionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostFunctionResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostFunctionResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostFunctionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostFunctionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostFunctionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostFunctionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs index fd9482e..cc8a2a9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostFunctionIdInvokeResponseContent( public async global::System.Threading.Tasks.Task PostFunctionIdInvokeAsync( global::System.Guid functionId, + global::Braintrust.InvokeApi request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostFunctionIdInvokeAsResponseAsync( + functionId: functionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Invoke function
+ /// Invoke a function. + ///
+ /// + /// Function id + /// + /// + /// 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> PostFunctionIdInvokeAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.InvokeApi request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,10 +125,11 @@ partial void ProcessPostFunctionIdInvokeResponseContent( var __maxAttempts = global::Braintrust.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/function/{functionId}/invoke", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostFunctionIdInvokeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostFunctionIdInvokeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostFunctionIdInvokeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostFunctionIdInvokeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostFunctionIdInvokeResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostFunctionIdInvokeResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostFunctionIdInvokeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostFunctionIdInvokeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -334,7 +381,11 @@ partial void ProcessPostFunctionIdInvokeResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -362,7 +413,11 @@ partial void ProcessPostFunctionIdInvokeResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs index 6ac6253..784788a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutFunctionResponseContent( /// public async global::System.Threading.Tasks.Task PutFunctionAsync( + global::Braintrust.CreateFunction request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutFunctionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace function
+ /// Create or replace function. If there is an existing function in the project with the same slug as the one specified in the request, will replace the existing function with the provided fields + ///
+ /// + /// 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> PutFunctionAsResponseAsync( + global::Braintrust.CreateFunction request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutFunctionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/function", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutFunctionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutFunctionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutFunctionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutFunctionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutFunctionResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutFunctionResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutFunctionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutFunctionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutFunctionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Function2.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutFunctionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Function2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.g.cs index 71796d3..dac1017 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.g.cs @@ -72,10 +72,10 @@ public FunctionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FunctionsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs index da4cac4..5ca344c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteGroupIdResponseContent( global::System.Guid groupId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteGroupIdAsResponseAsync( + groupId: groupId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete group
+ /// Delete a group object by its id + ///
+ /// + /// Group id + /// + /// 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> DeleteGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteGroupIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/group/{groupId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteGroupIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteGroupIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteGroupIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteGroupIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteGroupIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteGroupIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteGroupIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteGroupIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteGroupIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteGroupIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs index d1e2bfe..73353cb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetGroupResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetGroupAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + groupName: groupName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List groups
+ /// List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the group to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetGroupAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? groupName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetGroupResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/group", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("group_name", groupName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetGroupResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetGroupResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetGroupResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetGroupResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetGroupResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetGroupResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetGroupResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetGroupResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetGroupResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetGroupResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs index 6171bf8..49b12c6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetGroupIdResponseContent( global::System.Guid groupId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetGroupIdAsResponseAsync( + groupId: groupId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get group
+ /// Get a group object by its id + ///
+ /// + /// Group id + /// + /// 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> GetGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetGroupIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/group/{groupId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetGroupIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetGroupIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetGroupIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetGroupIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetGroupIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetGroupIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetGroupIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetGroupIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetGroupIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetGroupIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs index 59493aa..87da094 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchGroupIdResponseContent( public async global::System.Threading.Tasks.Task PatchGroupIdAsync( global::System.Guid groupId, + global::Braintrust.PatchGroup request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchGroupIdAsResponseAsync( + groupId: groupId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update group
+ /// Partially update a group object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Group id + /// + /// + /// 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> PatchGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.PatchGroup request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchGroupIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/group/{groupId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchGroupIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchGroupIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchGroupIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchGroupIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchGroupIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchGroupIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchGroupIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchGroupIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchGroupIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchGroupIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs index be720f0..556c46f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostGroupResponseContent( /// public async global::System.Threading.Tasks.Task PostGroupAsync( + global::Braintrust.CreateGroup request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostGroupAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create group
+ /// Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified + ///
+ /// + /// 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> PostGroupAsResponseAsync( + global::Braintrust.CreateGroup request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostGroupResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/group", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostGroupResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostGroupResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostGroupResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostGroupResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostGroupResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostGroupResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs index eb5aad9..1d2a99a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutGroupResponseContent( /// public async global::System.Threading.Tasks.Task PutGroupAsync( + global::Braintrust.CreateGroup request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutGroupAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace group
+ /// Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields + ///
+ /// + /// 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> PutGroupAsResponseAsync( + global::Braintrust.CreateGroup request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutGroupResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/group", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutGroupResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutGroupResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutGroupResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutGroupResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutGroupResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Group.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutGroupResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.g.cs index b27ea74..fe96737 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.g.cs @@ -72,10 +72,10 @@ public GroupsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public GroupsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclBatchUpdate.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclBatchUpdate.g.cs index 42dd68d..a9849f0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclBatchUpdate.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclBatchUpdate.g.cs @@ -21,6 +21,19 @@ public partial interface IAclsClient /// Batch update acls
/// Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect. /// + /// + /// 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> AclBatchUpdateAsResponseAsync( + + global::Braintrust.AclBatchUpdateRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Batch update acls
+ /// Batch update acls. This operation is idempotent, so adding acls which already exist will have no effect, and removing acls which do not exist will have no effect. + ///
/// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclListOrg.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclListOrg.g.cs index a211cc7..c30d3d9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclListOrg.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.AclListOrg.g.cs @@ -65,5 +65,66 @@ public partial interface IAclsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List org acls
+ /// List all acls in the org. This query requires the caller to have `read_acls` permission at the organization level + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// + /// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Each permission permits a certain type of operation on an object in the system
+ /// Permissions can be assigned to to objects on an individual basis, or grouped into roles + /// + /// + /// The object type that the ACL applies to + /// + /// + /// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided + /// + /// + /// Filter search results to within a particular organization + /// + /// 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>> AclListOrgAsResponseAsync( + int? limit = default, + global::Braintrust.Ids? ids = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.AclListOrgObjectType? objectType = default, + global::System.Guid? objectId = default, + global::System.Guid? userId = default, + global::System.Guid? groupId = default, + global::Braintrust.AclListPermission? permission = default, + global::Braintrust.AclListRestrictObjectType? restrictObjectType = default, + global::System.Guid? roleId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAcl.g.cs index dc80eea..0cc087b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAcl.g.cs @@ -21,6 +21,19 @@ public partial interface IAclsClient /// Delete single acl
/// Delete a single acl /// + /// + /// 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> DeleteAclAsResponseAsync( + + global::Braintrust.AclItem request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete single acl
+ /// Delete a single acl + ///
/// /// The object type that the ACL applies to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAclId.g.cs index 94ee20b..ae19d80 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.DeleteAclId.g.cs @@ -18,5 +18,19 @@ public partial interface IAclsClient global::System.Guid aclId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete acl
+ /// Delete an acl object by its id + ///
+ /// + /// Acl id + /// + /// 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> DeleteAclIdAsResponseAsync( + global::System.Guid aclId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAcl.g.cs index c6af2ee..0f52b63 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAcl.g.cs @@ -61,5 +61,62 @@ public partial interface IAclsClient global::System.Guid? roleId = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List acls
+ /// List out all acls. The acls are sorted by creation date, with the most recently-created acls coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// + /// Id of the user the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Id of the group the ACL applies to. Exactly one of `user_id` and `group_id` will be provided + /// + /// + /// Each permission permits a certain type of operation on an object in the system
+ /// Permissions can be assigned to to objects on an individual basis, or grouped into roles + /// + /// + /// The object type that the ACL applies to + /// + /// + /// Id of the role the ACL grants. Exactly one of `permission` and `role_id` will be provided + /// + /// 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> GetAclAsResponseAsync( + global::Braintrust.AclObjectType objectType, + global::System.Guid objectId, + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + global::System.Guid? userId = default, + global::System.Guid? groupId = default, + global::Braintrust.AclListPermission? permission = default, + global::Braintrust.AclListRestrictObjectType? restrictObjectType = default, + global::System.Guid? roleId = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAclId.g.cs index 3376dfb..a95d5b3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.GetAclId.g.cs @@ -18,5 +18,19 @@ public partial interface IAclsClient global::System.Guid aclId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get acl
+ /// Get an acl object by its id + ///
+ /// + /// Acl id + /// + /// 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> GetAclIdAsResponseAsync( + global::System.Guid aclId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.PostAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.PostAcl.g.cs index d6f8737..8582227 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAclsClient.PostAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAclsClient.PostAcl.g.cs @@ -21,6 +21,19 @@ public partial interface IAclsClient /// Create acl
/// Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified /// + /// + /// 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> PostAclAsResponseAsync( + + global::Braintrust.AclItem request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create acl
+ /// Create a new acl. If there is an existing acl with the same contents as the one specified in the request, will return the existing acl unmodified + ///
/// /// The object type that the ACL applies to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecret.g.cs index 2e08765..bb90247 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecret.g.cs @@ -21,6 +21,19 @@ public partial interface IAiSecretsClient /// Delete single ai_secret
/// Delete a single ai_secret /// + /// + /// 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> DeleteAiSecretAsResponseAsync( + + global::Braintrust.DeleteAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete single ai_secret
+ /// Delete a single ai_secret + ///
/// /// Name of the AI secret /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecretId.g.cs index 8647995..797a770 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.DeleteAiSecretId.g.cs @@ -18,5 +18,19 @@ public partial interface IAiSecretsClient global::System.Guid aiSecretId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete ai_secret
+ /// Delete an ai_secret object by its id + ///
+ /// + /// AiSecret id + /// + /// 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> DeleteAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecret.g.cs index 99bde58..ad1dc04 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecret.g.cs @@ -42,5 +42,43 @@ public partial interface IAiSecretsClient global::Braintrust.AISecretType? aiSecretType = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List ai_secrets
+ /// List out all ai_secrets. The ai_secrets are sorted by creation date, with the most recently-created ai_secrets coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the ai_secret to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// + /// 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> GetAiSecretAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? aiSecretName = default, + string? orgName = default, + global::Braintrust.AISecretType? aiSecretType = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecretId.g.cs index ae9664c..bc0f962 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.GetAiSecretId.g.cs @@ -18,5 +18,19 @@ public partial interface IAiSecretsClient global::System.Guid aiSecretId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get ai_secret
+ /// Get an ai_secret object by its id + ///
+ /// + /// AiSecret id + /// + /// 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> GetAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PatchAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PatchAiSecretId.g.cs index 830d52f..dc33e96 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PatchAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PatchAiSecretId.g.cs @@ -28,6 +28,23 @@ public partial interface IAiSecretsClient /// /// AiSecret id /// + /// + /// 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> PatchAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + + global::Braintrust.PatchAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update ai_secret
+ /// Partially update an ai_secret object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// AiSecret id + /// /// /// Name of the AI secret /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PostAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PostAiSecret.g.cs index 828efdb..ee98684 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PostAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PostAiSecret.g.cs @@ -21,6 +21,19 @@ public partial interface IAiSecretsClient /// Create ai_secret
/// Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified /// + /// + /// 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> PostAiSecretAsResponseAsync( + + global::Braintrust.CreateAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create ai_secret
+ /// Create a new ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will return the existing ai_secret unmodified + ///
/// /// Name of the AI secret /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PutAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PutAiSecret.g.cs index 0f78495..380a275 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PutAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IAiSecretsClient.PutAiSecret.g.cs @@ -21,6 +21,19 @@ public partial interface IAiSecretsClient /// Create or replace ai_secret
/// Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields /// + /// + /// 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> PutAiSecretAsResponseAsync( + + global::Braintrust.CreateAISecret request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace ai_secret
+ /// Create or replace ai_secret. If there is an existing ai_secret with the same name as the one specified in the request, will replace the existing ai_secret with the provided fields + ///
/// /// Name of the AI secret /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.DeleteApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.DeleteApiKeyId.g.cs index 0ea5f8f..cc8a076 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.DeleteApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.DeleteApiKeyId.g.cs @@ -18,5 +18,19 @@ public partial interface IApiKeysClient global::System.Guid apiKeyId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete api_key
+ /// Delete an api_key object by its id + ///
+ /// + /// ApiKey id + /// + /// 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> DeleteApiKeyIdAsResponseAsync( + global::System.Guid apiKeyId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKey.g.cs index a511d68..2836e1a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKey.g.cs @@ -40,5 +40,41 @@ public partial interface IApiKeysClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List api_keys
+ /// List out all api_keys. The api_keys are sorted by creation date, with the most recently-created api_keys coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the api_key to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetApiKeyAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? apiKeyName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKeyId.g.cs index b3d8bf3..3de3ef3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.GetApiKeyId.g.cs @@ -18,5 +18,19 @@ public partial interface IApiKeysClient global::System.Guid apiKeyId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get api_key
+ /// Get an api_key object by its id + ///
+ /// + /// ApiKey id + /// + /// 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> GetApiKeyIdAsResponseAsync( + global::System.Guid apiKeyId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.PostApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.PostApiKey.g.cs index 3d4b738..0845d4b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.PostApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IApiKeysClient.PostApiKey.g.cs @@ -21,6 +21,19 @@ public partial interface IApiKeysClient /// Create api_key
/// Create a new api_key. It is possible to have multiple API keys with the same name. There is no de-duplication /// + /// + /// 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> PostApiKeyAsResponseAsync( + + global::Braintrust.PostApiKeyRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create api_key
+ /// Create a new api_key. It is possible to have multiple API keys with the same name. There is no de-duplication + ///
/// /// Name of the api key. Does not have to be unique /// diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAcl.g.cs index 973a425..4e30e60 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAcl.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsAclAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/acl`)
+ /// Enable CORS + ///
+ /// 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 OptionsAclAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclBatchUpdate.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclBatchUpdate.g.cs index b9ee4e8..a095412 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclBatchUpdate.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclBatchUpdate.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsAclBatchUpdateAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/acl/acl/batch_update`)
+ /// Enable CORS + ///
+ /// 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 OptionsAclBatchUpdateAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclId.g.cs index e8baef9..e501fa6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid aclId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/acl/{acl_id}`)
+ /// Enable CORS + ///
+ /// + /// Acl id + /// + /// 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 OptionsAclIdAsResponseAsync( + global::System.Guid aclId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclListOrg.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclListOrg.g.cs index 8c30d20..bb38c18 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclListOrg.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAclListOrg.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsAclListOrgAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/acl/list_org`)
+ /// Enable CORS + ///
+ /// 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 OptionsAclListOrgAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecret.g.cs index 9e3994b..358cb1e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecret.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsAiSecretAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/ai_secret`)
+ /// Enable CORS + ///
+ /// 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 OptionsAiSecretAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecretId.g.cs index 0396c59..1115c0f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsAiSecretId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid aiSecretId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/ai_secret/{ai_secret_id}`)
+ /// Enable CORS + ///
+ /// + /// AiSecret id + /// + /// 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 OptionsAiSecretIdAsResponseAsync( + global::System.Guid aiSecretId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKey.g.cs index 0350db2..c3da1dd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKey.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsApiKeyAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/api_key`)
+ /// Enable CORS + ///
+ /// 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 OptionsApiKeyAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKeyId.g.cs index ecd8d3d..789c94a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsApiKeyId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid apiKeyId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/api_key/{api_key_id}`)
+ /// Enable CORS + ///
+ /// + /// ApiKey id + /// + /// 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 OptionsApiKeyIdAsResponseAsync( + global::System.Guid apiKeyId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsCrossObjectInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsCrossObjectInsert.g.cs index 3b0a2bb..2f81ec5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsCrossObjectInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsCrossObjectInsert.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsCrossObjectInsertAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/insert`)
+ /// Enable CORS + ///
+ /// 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 OptionsCrossObjectInsertAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDataset.g.cs index 027b5b4..a442001 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDataset.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsDatasetAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset`)
+ /// Enable CORS + ///
+ /// 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 OptionsDatasetAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetId.g.cs index c77112c..61c5a7c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset/{dataset_id}`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFeedback.g.cs index 82fa4c7..7615dcd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFeedback.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/feedback`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdFeedbackAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFetch.g.cs index 22c4221..7c89a3f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdFetch.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/fetch`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdFetchAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdInsert.g.cs index 26f3067..24322ee 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdInsert.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/insert`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdInsertAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdSummarize.g.cs index f2e32e8..c3672bf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetIdSummarize.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset/{dataset_id}/summarize`)
+ /// Enable CORS + ///
+ /// + /// Dataset id + /// + /// 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 OptionsDatasetIdSummarizeAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshot.g.cs index 43f5997..b99b9ad 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshot.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsDatasetSnapshotAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset_snapshot`)
+ /// Enable CORS + ///
+ /// 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 OptionsDatasetSnapshotAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshotId.g.cs index 10d120c..2884abc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsDatasetSnapshotId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid datasetSnapshotId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/dataset_snapshot/{dataset_snapshot_id}`)
+ /// Enable CORS + ///
+ /// + /// DatasetSnapshot id + /// + /// 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 OptionsDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVar.g.cs index da8d7f0..e2cc467 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVar.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsEnvVarAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/env_var`)
+ /// Enable CORS + ///
+ /// 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 OptionsEnvVarAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVarId.g.cs index 99183f0..4be6f31 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsEnvVarId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid envVarId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/env_var/{env_var_id}`)
+ /// Enable CORS + ///
+ /// + /// EnvVar id + /// + /// 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 OptionsEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperiment.g.cs index 788e0f3..d426722 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperiment.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsExperimentAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/experiment`)
+ /// Enable CORS + ///
+ /// 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 OptionsExperimentAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentId.g.cs index d2124f9..26d84c7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/experiment/{experiment_id}`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFeedback.g.cs index 0e103e9..c567155 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFeedback.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/feedback`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdFeedbackAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFetch.g.cs index bf4e93f..8320fa1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdFetch.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/fetch`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdFetchAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdInsert.g.cs index c29bc5b..93c93e5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdInsert.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/insert`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdInsertAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdSummarize.g.cs index bfb5c31..481400a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsExperimentIdSummarize.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/experiment/{experiment_id}/summarize`)
+ /// Enable CORS + ///
+ /// + /// Experiment id + /// + /// 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 OptionsExperimentIdSummarizeAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunction.g.cs index c62e83e..5ae1dff 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunction.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsFunctionAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/function`)
+ /// Enable CORS + ///
+ /// 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 OptionsFunctionAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionId.g.cs index a3d9eb6..42c2292 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid functionId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/function/{function_id}`)
+ /// Enable CORS + ///
+ /// + /// Function id + /// + /// 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 OptionsFunctionIdAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionIdInvoke.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionIdInvoke.g.cs index 0158f3c..9f19c8d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionIdInvoke.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsFunctionIdInvoke.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid functionId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/function/{function_id}/invoke`)
+ /// Enable CORS + ///
+ /// + /// Function id + /// + /// 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 OptionsFunctionIdInvokeAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroup.g.cs index ee5abc6..ffaf34a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroup.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsGroupAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/group`)
+ /// Enable CORS + ///
+ /// 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 OptionsGroupAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroupId.g.cs index 09d61c4..04257e3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsGroupId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid groupId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/group/{group_id}`)
+ /// Enable CORS + ///
+ /// + /// Group id + /// + /// 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 OptionsGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsIndex.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsIndex.g.cs index 13730ea..56fdae9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsIndex.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsIndex.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsIndexAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1`)
+ /// Enable CORS + ///
+ /// 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 OptionsIndexAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServer.g.cs index 08bce77..7b65007 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServer.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsMcpServerAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/mcp_server`)
+ /// Enable CORS + ///
+ /// 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 OptionsMcpServerAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServerId.g.cs index 1cdccec..3a371bc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsMcpServerId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid mcpServerId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/mcp_server/{mcp_server_id}`)
+ /// Enable CORS + ///
+ /// + /// McpServer id + /// + /// 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 OptionsMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganization.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganization.g.cs index 7ec798d..f6210ba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganization.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganization.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsOrganizationAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/organization`)
+ /// Enable CORS + ///
+ /// 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 OptionsOrganizationAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationId.g.cs index 9a7960c..1bb37b6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid organizationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/organization/{organization_id}`)
+ /// Enable CORS + ///
+ /// + /// Organization id + /// + /// 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 OptionsOrganizationIdAsResponseAsync( + global::System.Guid organizationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationMembers.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationMembers.g.cs index 6f5dd58..0fab7df 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationMembers.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsOrganizationMembers.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsOrganizationMembersAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/organization/members`)
+ /// Enable CORS + ///
+ /// 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 OptionsOrganizationMembersAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProject.g.cs index b7b8bf9..be4952e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProject.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProjectAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomation.g.cs index 7da517c..3d22446 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomation.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProjectAutomationAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_automation`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectAutomationAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomationId.g.cs index b8a76b6..e8ca21a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectAutomationId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectAutomationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_automation/{project_automation_id}`)
+ /// Enable CORS + ///
+ /// + /// ProjectAutomation id + /// + /// 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 OptionsProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectId.g.cs index 47b2236..6684360 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project/{project_id}`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFeedback.g.cs index 2b79128..1dd4573 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFeedback.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_logs/{project_id}/feedback`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectLogsIdFeedbackAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFetch.g.cs index aee8715..ccf292b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdFetch.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_logs/{project_id}/fetch`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectLogsIdFetchAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdInsert.g.cs index 3736a11..0b682bf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectLogsIdInsert.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_logs/{project_id}/insert`)
+ /// Enable CORS + ///
+ /// + /// Project id + /// + /// 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 OptionsProjectLogsIdInsertAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScore.g.cs index 2d918cf..f912e1b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScore.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProjectScoreAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_score`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectScoreAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScoreId.g.cs index 517d820..9d71fa5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectScoreId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectScoreId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_score/{project_score_id}`)
+ /// Enable CORS + ///
+ /// + /// ProjectScore id + /// + /// 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 OptionsProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTag.g.cs index 9e47ff6..5a83142 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTag.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProjectTagAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_tag`)
+ /// Enable CORS + ///
+ /// 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 OptionsProjectTagAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTagId.g.cs index 6d68459..fceb9ef 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProjectTagId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid projectTagId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/project_tag/{project_tag_id}`)
+ /// Enable CORS + ///
+ /// + /// ProjectTag id + /// + /// 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 OptionsProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPrompt.g.cs index 7ac9bd4..f274d1d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPrompt.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsPromptAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/prompt`)
+ /// Enable CORS + ///
+ /// 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 OptionsPromptAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPromptId.g.cs index 70a51c1..cb1d00a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsPromptId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid promptId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/prompt/{prompt_id}`)
+ /// Enable CORS + ///
+ /// + /// Prompt id + /// + /// 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 OptionsPromptIdAsResponseAsync( + global::System.Guid promptId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyauto.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyauto.g.cs index 4f68fe1..8cf5bce 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyauto.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyauto.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProxyproxyautoAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/proxy/auto`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxyautoAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxychatCompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxychatCompletions.g.cs index 67230dc..ada3b9e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxychatCompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxychatCompletions.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProxyproxychatCompletionsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/proxy/chat/completions`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxychatCompletionsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycompletions.g.cs index 4e374a8..e28c07e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycompletions.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProxyproxycompletionsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/proxy/completions`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxycompletionsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycredentials.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycredentials.g.cs index 91a4630..7e1f35f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycredentials.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxycredentials.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProxyproxycredentialsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/proxy/credentials`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxycredentialsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyembeddings.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyembeddings.g.cs index bf25576..eedc72d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyembeddings.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsProxyproxyembeddings.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsProxyproxyembeddingsAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/proxy/embeddings`)
+ /// Enable CORS + ///
+ /// 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 OptionsProxyproxyembeddingsAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRole.g.cs index 4575689..0644ee8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRole.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsRoleAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/role`)
+ /// Enable CORS + ///
+ /// 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 OptionsRoleAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRoleId.g.cs index ddf03dc..309c592 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsRoleId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid roleId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/role/{role_id}`)
+ /// Enable CORS + ///
+ /// + /// Role id + /// + /// 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 OptionsRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceToken.g.cs index 26db312..efdb313 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceToken.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsServiceTokenAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/service_token`)
+ /// Enable CORS + ///
+ /// 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 OptionsServiceTokenAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceTokenId.g.cs index ff37abc..a419ba7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsServiceTokenId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid serviceTokenId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/service_token/{service_token_id}`)
+ /// Enable CORS + ///
+ /// + /// ServiceToken id + /// + /// 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 OptionsServiceTokenIdAsResponseAsync( + global::System.Guid serviceTokenId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframe.g.cs index 5017711..b401804 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframe.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsSpanIframeAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/span_iframe`)
+ /// Enable CORS + ///
+ /// 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 OptionsSpanIframeAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframeId.g.cs index ace7247..11ede20 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsSpanIframeId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid spanIframeId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/span_iframe/{span_iframe_id}`)
+ /// Enable CORS + ///
+ /// + /// SpanIframe id + /// + /// 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 OptionsSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUser.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUser.g.cs index 49036bd..e5b8ecb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUser.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUser.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsUserAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/user`)
+ /// Enable CORS + ///
+ /// 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 OptionsUserAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUserId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUserId.g.cs index 3846534..e69b143 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUserId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsUserId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid userId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/user/{user_id}`)
+ /// Enable CORS + ///
+ /// + /// User id + /// + /// 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 OptionsUserIdAsResponseAsync( + global::System.Guid userId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsView.g.cs index d806d50..2a445a2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsView.g.cs @@ -14,5 +14,15 @@ public partial interface ICorsClient global::System.Threading.Tasks.Task OptionsViewAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/view`)
+ /// Enable CORS + ///
+ /// 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 OptionsViewAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsViewId.g.cs index 170b499..fadd308 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICorsClient.OptionsViewId.g.cs @@ -18,5 +18,19 @@ public partial interface ICorsClient global::System.Guid viewId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Enable CORS (`/v1/view/{view_id}`)
+ /// Enable CORS + ///
+ /// + /// View id + /// + /// 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 OptionsViewIdAsResponseAsync( + global::System.Guid viewId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ICrossObjectClient.PostCrossObjectInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ICrossObjectClient.PostCrossObjectInsert.g.cs index 124c3ea..1c2b0b6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ICrossObjectClient.PostCrossObjectInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ICrossObjectClient.PostCrossObjectInsert.g.cs @@ -21,6 +21,19 @@ public partial interface ICrossObjectClient /// Cross-object insert
/// Insert events and feedback across object types /// + /// + /// 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> PostCrossObjectInsertAsResponseAsync( + + global::Braintrust.CrossObjectInsertRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cross-object insert
+ /// Insert events and feedback across object types + ///
/// /// A mapping from experiment id to a set of log events and feedback items to insert /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs index 80ef46b..b4279de 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs @@ -18,5 +18,19 @@ public partial interface IDatasetSnapshotsClient global::System.Guid datasetSnapshotId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete dataset_snapshot
+ /// Delete a dataset_snapshot object by its id + ///
+ /// + /// DatasetSnapshot id + /// + /// 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> DeleteDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshot.g.cs index b12a29f..7ca9d68 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshot.g.cs @@ -40,5 +40,41 @@ public partial interface IDatasetSnapshotsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List dataset_snapshots
+ /// List out all dataset_snapshots. The dataset_snapshots are sorted by creation date, with the most recently-created dataset_snapshots coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the dataset_snapshot to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetDatasetSnapshotAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? datasetSnapshotName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshotId.g.cs index 4bffbe0..501874c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.GetDatasetSnapshotId.g.cs @@ -18,5 +18,19 @@ public partial interface IDatasetSnapshotsClient global::System.Guid datasetSnapshotId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get dataset_snapshot
+ /// Get a dataset_snapshot object by its id + ///
+ /// + /// DatasetSnapshot id + /// + /// 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> GetDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs index 15993e8..7928629 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs @@ -28,6 +28,23 @@ public partial interface IDatasetSnapshotsClient /// /// DatasetSnapshot id /// + /// + /// 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> PatchDatasetSnapshotIdAsResponseAsync( + global::System.Guid datasetSnapshotId, + + global::Braintrust.PatchDatasetSnapshot request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update dataset_snapshot
+ /// Partially update a dataset_snapshot object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// DatasetSnapshot id + /// /// /// Name of the dataset snapshot /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PostDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PostDatasetSnapshot.g.cs index ce0caf2..b3f14db 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PostDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PostDatasetSnapshot.g.cs @@ -21,6 +21,19 @@ public partial interface IDatasetSnapshotsClient /// Create dataset_snapshot
/// Create a new dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will return the existing dataset_snapshot unmodified /// + /// + /// 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> PostDatasetSnapshotAsResponseAsync( + + global::Braintrust.CreateDatasetSnapshot request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create dataset_snapshot
+ /// Create a new dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will return the existing dataset_snapshot unmodified + ///
/// /// Unique identifier for the dataset that this snapshot belongs to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PutDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PutDatasetSnapshot.g.cs index d558a3c..3268c5a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PutDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetSnapshotsClient.PutDatasetSnapshot.g.cs @@ -21,6 +21,19 @@ public partial interface IDatasetSnapshotsClient /// Create or replace dataset_snapshot
/// Create or replace dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will replace the existing dataset_snapshot with the provided fields /// + /// + /// 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> PutDatasetSnapshotAsResponseAsync( + + global::Braintrust.CreateDatasetSnapshot request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace dataset_snapshot
+ /// Create or replace dataset_snapshot. If there is an existing dataset_snapshot with the same name as the one specified in the request, will replace the existing dataset_snapshot with the provided fields + ///
/// /// Unique identifier for the dataset that this snapshot belongs to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.DeleteDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.DeleteDatasetId.g.cs index e0f5276..18a176e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.DeleteDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.DeleteDatasetId.g.cs @@ -18,5 +18,19 @@ public partial interface IDatasetsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete dataset
+ /// Delete a dataset object by its id + ///
+ /// + /// Dataset id + /// + /// 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> DeleteDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDataset.g.cs index c14bf1a..6b00046 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDataset.g.cs @@ -48,5 +48,49 @@ public partial interface IDatasetsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List datasets
+ /// List out all datasets. The datasets are sorted by creation date, with the most recently-created datasets coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the dataset to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetDatasetAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? datasetName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetId.g.cs index 320988c..8ce7fc4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetId.g.cs @@ -18,5 +18,19 @@ public partial interface IDatasetsClient global::System.Guid datasetId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get dataset
+ /// Get a dataset object by its id + ///
+ /// + /// Dataset id + /// + /// 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> GetDatasetIdAsResponseAsync( + global::System.Guid datasetId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdFetch.g.cs index dbd7b55..1d3d965 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdFetch.g.cs @@ -41,5 +41,42 @@ public partial interface IDatasetsClient string? version = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch dataset (GET form)
+ /// Fetch the events in a dataset. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Dataset id + /// + /// + /// limit the number of traces fetched
+ /// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
+ /// The `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// Retrieve a snapshot of events from a past time
+ /// The version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch. + /// + /// 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> GetDatasetIdFetchAsResponseAsync( + global::System.Guid datasetId, + int? limit = default, + string? maxXactId = default, + string? maxRootSpanId = default, + string? version = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdSummarize.g.cs index 6a0fe08..497fa7a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.GetDatasetIdSummarize.g.cs @@ -22,5 +22,23 @@ public partial interface IDatasetsClient bool? summarizeData = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Summarize dataset
+ /// Summarize dataset + ///
+ /// + /// Dataset id + /// + /// + /// Whether to summarize the data. If false (or omitted), only the metadata will be returned. + /// + /// 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> GetDatasetIdSummarizeAsResponseAsync( + global::System.Guid datasetId, + bool? summarizeData = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PatchDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PatchDatasetId.g.cs index 567dd3b..1d00594 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PatchDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PatchDatasetId.g.cs @@ -28,6 +28,23 @@ public partial interface IDatasetsClient /// /// Dataset id /// + /// + /// 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> PatchDatasetIdAsResponseAsync( + global::System.Guid datasetId, + + global::Braintrust.PatchDataset request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update dataset
+ /// Partially update a dataset object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Dataset id + /// /// /// Name of the dataset. Within a project, dataset names are unique /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDataset.g.cs index e2ad36f..e28efdc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDataset.g.cs @@ -21,6 +21,19 @@ public partial interface IDatasetsClient /// Create dataset
/// Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified /// + /// + /// 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> PostDatasetAsResponseAsync( + + global::Braintrust.CreateDataset request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create dataset
+ /// Create a new dataset. If there is an existing dataset in the project with the same name as the one specified in the request, will return the existing dataset unmodified + ///
/// /// Unique identifier for the project that the dataset belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFeedback.g.cs index d6a1f04..4bb463b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFeedback.g.cs @@ -28,6 +28,23 @@ public partial interface IDatasetsClient /// /// Dataset id /// + /// + /// 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> PostDatasetIdFeedbackAsResponseAsync( + global::System.Guid datasetId, + + global::Braintrust.FeedbackDatasetEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Feedback for dataset events
+ /// Log feedback for a set of dataset events + ///
+ /// + /// Dataset id + /// /// /// A list of dataset feedback items /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFetch.g.cs index bf9767e..77e550f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdFetch.g.cs @@ -28,6 +28,23 @@ public partial interface IDatasetsClient /// /// Dataset id /// + /// + /// 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> PostDatasetIdFetchAsResponseAsync( + global::System.Guid datasetId, + + global::Braintrust.FetchEventsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch dataset (POST form)
+ /// Fetch the events in a dataset. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Dataset id + /// /// /// limit the number of traces fetched
/// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
diff --git a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdInsert.g.cs index 219c3e5..5accc36 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IDatasetsClient.PostDatasetIdInsert.g.cs @@ -28,6 +28,23 @@ public partial interface IDatasetsClient /// /// Dataset id /// + /// + /// 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> PostDatasetIdInsertAsResponseAsync( + global::System.Guid datasetId, + + global::Braintrust.InsertDatasetEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Insert dataset events
+ /// Insert a set of events into the dataset + ///
+ /// + /// Dataset id + /// /// /// A list of dataset events to insert /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.DeleteEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.DeleteEnvVarId.g.cs index 7b20dc5..5a8af24 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.DeleteEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.DeleteEnvVarId.g.cs @@ -18,5 +18,19 @@ public partial interface IEnvVarsClient global::System.Guid envVarId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete env_var
+ /// Delete an env_var object by its id + ///
+ /// + /// EnvVar id + /// + /// 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> DeleteEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVar.g.cs index ef83ec8..c2fe02d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVar.g.cs @@ -34,5 +34,35 @@ public partial interface IEnvVarsClient global::System.Guid? objectId = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List env_vars
+ /// List out all env_vars. The env_vars are sorted by creation date, with the most recently-created env_vars coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the env_var to search for + /// + /// + /// The type of the object the environment variable is scoped for + /// + /// + /// The id of the object the environment variable is scoped for + /// + /// 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> GetEnvVarAsResponseAsync( + int? limit = default, + global::Braintrust.Ids? ids = default, + string? envVarName = default, + global::Braintrust.EnvVarObjectType? objectType = default, + global::System.Guid? objectId = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVarId.g.cs index 9db18f2..e4c862f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.GetEnvVarId.g.cs @@ -18,5 +18,19 @@ public partial interface IEnvVarsClient global::System.Guid envVarId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get env_var
+ /// Get an env_var object by its id + ///
+ /// + /// EnvVar id + /// + /// 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> GetEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PatchEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PatchEnvVarId.g.cs index 6e51bb7..92e7210 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PatchEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PatchEnvVarId.g.cs @@ -28,6 +28,23 @@ public partial interface IEnvVarsClient /// /// EnvVar id /// + /// + /// 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> PatchEnvVarIdAsResponseAsync( + global::System.Guid envVarId, + + global::Braintrust.PatchEnvVarIdRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update env_var
+ /// Partially update an env_var object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// EnvVar id + /// /// /// The name of the environment variable /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PostEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PostEnvVar.g.cs index dc9d008..0a5b57f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PostEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PostEnvVar.g.cs @@ -21,6 +21,19 @@ public partial interface IEnvVarsClient /// Create env_var
/// Create a new env_var. If there is an existing env_var with the same name as the one specified in the request, will return the existing env_var unmodified /// + /// + /// 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> PostEnvVarAsResponseAsync( + + global::Braintrust.PostEnvVarRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create env_var
+ /// Create a new env_var. If there is an existing env_var with the same name as the one specified in the request, will return the existing env_var unmodified + ///
/// /// The type of the object the environment variable is scoped for /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PutEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PutEnvVar.g.cs index dfe672b..781f9b8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PutEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvVarsClient.PutEnvVar.g.cs @@ -21,6 +21,19 @@ public partial interface IEnvVarsClient /// Create or replace env_var
/// Create or replace env_var. If there is an existing env_var with the same name as the one specified in the request, will replace the existing env_var with the provided fields /// + /// + /// 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> PutEnvVarAsResponseAsync( + + global::Braintrust.PutEnvVarRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace env_var
+ /// Create or replace env_var. If there is an existing env_var with the same name as the one specified in the request, will replace the existing env_var with the provided fields + ///
/// /// The type of the object the environment variable is scoped for /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.CreateEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.CreateEnvironment.g.cs index 01ba0e5..f5ccc15 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.CreateEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.CreateEnvironment.g.cs @@ -21,6 +21,19 @@ public partial interface IEnvironmentsClient /// Create environment
/// Create a new environment /// + /// + /// 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> CreateEnvironmentAsResponseAsync( + + global::Braintrust.CreateEnvironment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create environment
+ /// Create a new environment + ///
/// /// Name of the environment /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.DeleteEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.DeleteEnvironment.g.cs index 23b67a7..ac8e968 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.DeleteEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.DeleteEnvironment.g.cs @@ -15,5 +15,16 @@ public partial interface IEnvironmentsClient global::System.Guid environmentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete environment + /// + /// + /// 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> DeleteEnvironmentAsResponseAsync( + global::System.Guid environmentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.GetEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.GetEnvironment.g.cs index 1fc122d..f1232b2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.GetEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.GetEnvironment.g.cs @@ -15,5 +15,16 @@ public partial interface IEnvironmentsClient global::System.Guid environmentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get environment + /// + /// + /// 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> GetEnvironmentAsResponseAsync( + global::System.Guid environmentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.ListEnvironments.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.ListEnvironments.g.cs index ddfd23e..fefea7d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.ListEnvironments.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.ListEnvironments.g.cs @@ -24,5 +24,25 @@ public partial interface IEnvironmentsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List environments
+ /// List out all environments. The environments are sorted by creation date, with the most recently-created environments first. + ///
+ /// + /// Filter by environment IDs. Supports a single ID or multiple values. + /// + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> ListEnvironmentsAsResponseAsync( + global::Braintrust.AnyOf>? ids = default, + string? name = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.UpdateEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.UpdateEnvironment.g.cs index f70fd55..6a12734 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.UpdateEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEnvironmentsClient.UpdateEnvironment.g.cs @@ -22,6 +22,20 @@ public partial interface IEnvironmentsClient /// Partially update environment /// /// + /// + /// 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> UpdateEnvironmentAsResponseAsync( + global::System.Guid environmentId, + + global::Braintrust.PatchEnvironment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update environment + /// + /// /// /// Name of the environment /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IEvalsClient.EvalLaunch.g.cs b/src/libs/Braintrust/Generated/Braintrust.IEvalsClient.EvalLaunch.g.cs index 96da0ad..2c3ed8f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IEvalsClient.EvalLaunch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IEvalsClient.EvalLaunch.g.cs @@ -21,6 +21,19 @@ public partial interface IEvalsClient /// Launch an eval
/// Launch an evaluation. This is the API-equivalent of the `Eval` function that is built into the Braintrust SDK. In the Eval API, you provide pointers to a dataset, task function, and scoring functions. The API will then run the evaluation, create an experiment, and return the results along with a link to the experiment. To learn more about evals, see the [Evals guide](https://www.braintrust.dev/docs/evaluate). /// + /// + /// 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> EvalLaunchAsResponseAsync( + + global::Braintrust.RunEval request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Launch an eval
+ /// Launch an evaluation. This is the API-equivalent of the `Eval` function that is built into the Braintrust SDK. In the Eval API, you provide pointers to a dataset, task function, and scoring functions. The API will then run the evaluation, create an experiment, and return the results along with a link to the experiment. To learn more about evals, see the [Evals guide](https://www.braintrust.dev/docs/evaluate). + ///
/// /// Unique identifier for the project to run the eval in /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.DeleteExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.DeleteExperimentId.g.cs index a9383b9..2391fa6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.DeleteExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.DeleteExperimentId.g.cs @@ -18,5 +18,19 @@ public partial interface IExperimentsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete experiment
+ /// Delete an experiment object by its id + ///
+ /// + /// Experiment id + /// + /// 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> DeleteExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperiment.g.cs index aadc99a..e120fe4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperiment.g.cs @@ -49,5 +49,50 @@ public partial interface IExperimentsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List experiments
+ /// List out all experiments. The experiments are sorted by creation date, with the most recently-created experiments coming first + ///
+ /// + /// Limit the number of objects to return
+ /// Default Value: 1000 + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the experiment to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetExperimentAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? experimentName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentId.g.cs index 0154492..43d8df1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentId.g.cs @@ -18,5 +18,19 @@ public partial interface IExperimentsClient global::System.Guid experimentId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get experiment
+ /// Get an experiment object by its id + ///
+ /// + /// Experiment id + /// + /// 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> GetExperimentIdAsResponseAsync( + global::System.Guid experimentId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdFetch.g.cs index 738966c..98aa7b1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdFetch.g.cs @@ -41,5 +41,42 @@ public partial interface IExperimentsClient string? version = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch experiment (GET form)
+ /// Fetch the events in an experiment. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Experiment id + /// + /// + /// limit the number of traces fetched
+ /// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
+ /// The `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// Retrieve a snapshot of events from a past time
+ /// The version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch. + /// + /// 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> GetExperimentIdFetchAsResponseAsync( + global::System.Guid experimentId, + int? limit = default, + string? maxXactId = default, + string? maxRootSpanId = default, + string? version = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdSummarize.g.cs index 5b0dbe2..be8ca59 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.GetExperimentIdSummarize.g.cs @@ -26,5 +26,27 @@ public partial interface IExperimentsClient global::System.Guid? comparisonExperimentId = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Summarize experiment
+ /// Summarize experiment + ///
+ /// + /// Experiment id + /// + /// + /// Whether to summarize the scores and metrics. If false (or omitted), only the metadata will be returned. + /// + /// + /// The experiment to compare against, if summarizing scores and metrics. If omitted, will fall back to the `base_exp_id` stored in the experiment metadata, and then to the most recent experiment run in the same project. Must pass `summarize_scores=true` for this id to be used + /// + /// 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> GetExperimentIdSummarizeAsResponseAsync( + global::System.Guid experimentId, + bool? summarizeScores = default, + global::System.Guid? comparisonExperimentId = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PatchExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PatchExperimentId.g.cs index 3a08520..c13bdf0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PatchExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PatchExperimentId.g.cs @@ -28,6 +28,23 @@ public partial interface IExperimentsClient /// /// Experiment id /// + /// + /// 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> PatchExperimentIdAsResponseAsync( + global::System.Guid experimentId, + + global::Braintrust.PatchExperiment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update experiment
+ /// Partially update an experiment object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Experiment id + /// /// /// Name of the experiment. Within a project, experiment names are unique /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperiment.g.cs index af3c8e3..f76d5f0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperiment.g.cs @@ -21,6 +21,19 @@ public partial interface IExperimentsClient /// Create experiment
/// Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified /// + /// + /// 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> PostExperimentAsResponseAsync( + + global::Braintrust.CreateExperiment request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create experiment
+ /// Create a new experiment. If there is an existing experiment in the project with the same name as the one specified in the request, will return the existing experiment unmodified + ///
/// /// Unique identifier for the project that the experiment belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFeedback.g.cs index 3c13fd5..75acccf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFeedback.g.cs @@ -28,6 +28,23 @@ public partial interface IExperimentsClient /// /// Experiment id /// + /// + /// 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> PostExperimentIdFeedbackAsResponseAsync( + global::System.Guid experimentId, + + global::Braintrust.FeedbackExperimentEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Feedback for experiment events
+ /// Log feedback for a set of experiment events + ///
+ /// + /// Experiment id + /// /// /// A list of experiment feedback items /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFetch.g.cs index 810fd42..81321b3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdFetch.g.cs @@ -28,6 +28,23 @@ public partial interface IExperimentsClient /// /// Experiment id /// + /// + /// 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> PostExperimentIdFetchAsResponseAsync( + global::System.Guid experimentId, + + global::Braintrust.FetchEventsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch experiment (POST form)
+ /// Fetch the events in an experiment. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Experiment id + /// /// /// limit the number of traces fetched
/// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
diff --git a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdInsert.g.cs index 4c0e601..ace7715 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IExperimentsClient.PostExperimentIdInsert.g.cs @@ -28,6 +28,23 @@ public partial interface IExperimentsClient /// /// Experiment id /// + /// + /// 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> PostExperimentIdInsertAsResponseAsync( + global::System.Guid experimentId, + + global::Braintrust.InsertExperimentEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Insert experiment events
+ /// Insert a set of events into the experiment + ///
+ /// + /// Experiment id + /// /// /// A list of experiment events to insert /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.DeleteFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.DeleteFunctionId.g.cs index 271606b..6b5268a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.DeleteFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.DeleteFunctionId.g.cs @@ -18,5 +18,19 @@ public partial interface IFunctionsClient global::System.Guid functionId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete function
+ /// Delete a function object by its id + ///
+ /// + /// Function id + /// + /// 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> DeleteFunctionIdAsResponseAsync( + global::System.Guid functionId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunction.g.cs index 73c59f7..c552030 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunction.g.cs @@ -62,5 +62,63 @@ public partial interface IFunctionsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List functions
+ /// List out all functions. The functions are sorted by creation date, with the most recently-created functions coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the function to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Retrieve prompt with a specific slug + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow results. + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetFunctionAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? functionName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? slug = default, + string? version = default, + string? environment = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunctionId.g.cs index aaaca61..8cbe8be 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.GetFunctionId.g.cs @@ -28,5 +28,29 @@ public partial interface IFunctionsClient string? environment = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get function
+ /// Get a function object by its id + ///
+ /// + /// Function id + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow 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> GetFunctionIdAsResponseAsync( + global::System.Guid functionId, + string? version = default, + string? environment = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PatchFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PatchFunctionId.g.cs index 78f0d61..f1cd0b6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PatchFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PatchFunctionId.g.cs @@ -28,6 +28,23 @@ public partial interface IFunctionsClient /// /// Function id /// + /// + /// 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> PatchFunctionIdAsResponseAsync( + global::System.Guid functionId, + + global::Braintrust.PatchFunction request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update function
+ /// Partially update a function object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Function id + /// /// /// Name of the prompt /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunction.g.cs index fd0624f..186e024 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunction.g.cs @@ -21,6 +21,19 @@ public partial interface IFunctionsClient /// Create function
/// Create a new function. If there is an existing function in the project with the same slug as the one specified in the request, will return the existing function unmodified /// + /// + /// 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> PostFunctionAsResponseAsync( + + global::Braintrust.CreateFunction request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create function
+ /// Create a new function. If there is an existing function in the project with the same slug as the one specified in the request, will return the existing function unmodified + ///
/// /// Unique identifier for the project that the prompt belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunctionIdInvoke.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunctionIdInvoke.g.cs index a00aae9..2d3aeeb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunctionIdInvoke.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PostFunctionIdInvoke.g.cs @@ -28,6 +28,23 @@ public partial interface IFunctionsClient /// /// Function id /// + /// + /// 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> PostFunctionIdInvokeAsResponseAsync( + global::System.Guid functionId, + + global::Braintrust.InvokeApi request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Invoke function
+ /// Invoke a function. + ///
+ /// + /// Function id + /// /// /// Argument to the function, which can be any JSON serializable value /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PutFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PutFunction.g.cs index c82c4ef..cac4a18 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PutFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IFunctionsClient.PutFunction.g.cs @@ -21,6 +21,19 @@ public partial interface IFunctionsClient /// Create or replace function
/// Create or replace function. If there is an existing function in the project with the same slug as the one specified in the request, will replace the existing function with the provided fields /// + /// + /// 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> PutFunctionAsResponseAsync( + + global::Braintrust.CreateFunction request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace function
+ /// Create or replace function. If there is an existing function in the project with the same slug as the one specified in the request, will replace the existing function with the provided fields + ///
/// /// Unique identifier for the project that the prompt belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.DeleteGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.DeleteGroupId.g.cs index f21abcb..9441b13 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.DeleteGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.DeleteGroupId.g.cs @@ -18,5 +18,19 @@ public partial interface IGroupsClient global::System.Guid groupId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete group
+ /// Delete a group object by its id + ///
+ /// + /// Group id + /// + /// 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> DeleteGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroup.g.cs index c1436c4..daf7259 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroup.g.cs @@ -40,5 +40,41 @@ public partial interface IGroupsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List groups
+ /// List out all groups. The groups are sorted by creation date, with the most recently-created groups coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the group to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetGroupAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? groupName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroupId.g.cs index ce918fc..eda0e05 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.GetGroupId.g.cs @@ -18,5 +18,19 @@ public partial interface IGroupsClient global::System.Guid groupId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get group
+ /// Get a group object by its id + ///
+ /// + /// Group id + /// + /// 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> GetGroupIdAsResponseAsync( + global::System.Guid groupId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PatchGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PatchGroupId.g.cs index 83bd6d5..9315ffd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PatchGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PatchGroupId.g.cs @@ -28,6 +28,23 @@ public partial interface IGroupsClient /// /// Group id /// + /// + /// 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> PatchGroupIdAsResponseAsync( + global::System.Guid groupId, + + global::Braintrust.PatchGroup request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update group
+ /// Partially update a group object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Group id + /// /// /// Textual description of the group /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PostGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PostGroup.g.cs index cb17093..f46a1d3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PostGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PostGroup.g.cs @@ -21,6 +21,19 @@ public partial interface IGroupsClient /// Create group
/// Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified /// + /// + /// 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> PostGroupAsResponseAsync( + + global::Braintrust.CreateGroup request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create group
+ /// Create a new group. If there is an existing group with the same name as the one specified in the request, will return the existing group unmodified + ///
/// /// Name of the group /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PutGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PutGroup.g.cs index c40c217..ac46091 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PutGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IGroupsClient.PutGroup.g.cs @@ -21,6 +21,19 @@ public partial interface IGroupsClient /// Create or replace group
/// Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields /// + /// + /// 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> PutGroupAsResponseAsync( + + global::Braintrust.CreateGroup request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace group
+ /// Create or replace group. If there is an existing group with the same name as the one specified in the request, will replace the existing group with the provided fields + ///
/// /// Name of the group /// diff --git a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.GetProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.GetProjectLogsIdFetch.g.cs index f0e2d92..c7246c2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.GetProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.GetProjectLogsIdFetch.g.cs @@ -41,5 +41,42 @@ public partial interface ILogsClient string? version = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch project logs (GET form)
+ /// Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Project id + /// + /// + /// limit the number of traces fetched
+ /// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
+ /// The `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// Retrieve a snapshot of events from a past time
+ /// The version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch. + /// + /// 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> GetProjectLogsIdFetchAsResponseAsync( + global::System.Guid projectId, + int? limit = default, + string? maxXactId = default, + string? maxRootSpanId = default, + string? version = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFeedback.g.cs index fde9e5e..240078c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFeedback.g.cs @@ -28,6 +28,23 @@ public partial interface ILogsClient /// /// Project id /// + /// + /// 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> PostProjectLogsIdFeedbackAsResponseAsync( + global::System.Guid projectId, + + global::Braintrust.FeedbackProjectLogsEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Feedback for project logs events
+ /// Log feedback for a set of project logs events + ///
+ /// + /// Project id + /// /// /// A list of project logs feedback items /// diff --git a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFetch.g.cs index 5996673..8c8c641 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdFetch.g.cs @@ -28,6 +28,23 @@ public partial interface ILogsClient /// /// Project id /// + /// + /// 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> PostProjectLogsIdFetchAsResponseAsync( + global::System.Guid projectId, + + global::Braintrust.FetchEventsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fetch project logs (POST form)
+ /// Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Project id + /// /// /// limit the number of traces fetched
/// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
diff --git a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdInsert.g.cs index d50a077..eaac5f6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ILogsClient.PostProjectLogsIdInsert.g.cs @@ -28,6 +28,23 @@ public partial interface ILogsClient /// /// Project id /// + /// + /// 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> PostProjectLogsIdInsertAsResponseAsync( + global::System.Guid projectId, + + global::Braintrust.InsertProjectLogsEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Insert project logs events
+ /// Insert a set of events into the project logs + ///
+ /// + /// Project id + /// /// /// A list of project logs events to insert /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.DeleteMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.DeleteMcpServerId.g.cs index 024f86a..b0e5429 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.DeleteMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.DeleteMcpServerId.g.cs @@ -18,5 +18,19 @@ public partial interface IMcpServersClient global::System.Guid mcpServerId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete mcp_server
+ /// Delete a mcp_server object by its id + ///
+ /// + /// McpServer id + /// + /// 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> DeleteMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServer.g.cs index 8f352e2..4a1a3a1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServer.g.cs @@ -40,5 +40,41 @@ public partial interface IMcpServersClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List mcp_servers
+ /// List out all mcp_servers. The mcp_servers are sorted by creation date, with the most recently-created mcp_servers coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the mcp_server to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetMcpServerAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? mcpServerName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServerId.g.cs index 9804a5a..9a39791 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.GetMcpServerId.g.cs @@ -18,5 +18,19 @@ public partial interface IMcpServersClient global::System.Guid mcpServerId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get mcp_server
+ /// Get a mcp_server object by its id + ///
+ /// + /// McpServer id + /// + /// 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> GetMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PatchMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PatchMcpServerId.g.cs index 8f6b4b0..abc2e40 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PatchMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PatchMcpServerId.g.cs @@ -28,6 +28,23 @@ public partial interface IMcpServersClient /// /// McpServer id /// + /// + /// 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> PatchMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + + global::Braintrust.PatchMCPServer request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update mcp_server
+ /// Partially update a mcp_server object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// McpServer id + /// /// /// Name of the MCP server. Within a project, MCP server names are unique /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PostMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PostMcpServer.g.cs index 05b1e71..e5e4653 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PostMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PostMcpServer.g.cs @@ -21,6 +21,19 @@ public partial interface IMcpServersClient /// Create mcp_server
/// Create a new mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will return the existing mcp_server unmodified /// + /// + /// 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> PostMcpServerAsResponseAsync( + + global::Braintrust.CreateMCPServer request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create mcp_server
+ /// Create a new mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will return the existing mcp_server unmodified + ///
/// /// Unique identifier for the project that the MCP server belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PutMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PutMcpServer.g.cs index 0a34909..4d40639 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PutMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IMcpServersClient.PutMcpServer.g.cs @@ -21,6 +21,19 @@ public partial interface IMcpServersClient /// Create or replace mcp_server
/// Create or replace mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will replace the existing mcp_server with the provided fields /// + /// + /// 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> PutMcpServerAsResponseAsync( + + global::Braintrust.CreateMCPServer request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace mcp_server
+ /// Create or replace mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will replace the existing mcp_server with the provided fields + ///
/// /// Unique identifier for the project that the MCP server belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganization.g.cs b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganization.g.cs index a248d34..fbe336c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganization.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganization.g.cs @@ -36,5 +36,37 @@ public partial interface IOrganizationsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List organizations
+ /// List out all organizations. The organizations are sorted by creation date, with the most recently-created organizations coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetOrganizationAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganizationId.g.cs index aad040b..db2ca4d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.GetOrganizationId.g.cs @@ -18,5 +18,19 @@ public partial interface IOrganizationsClient global::System.Guid organizationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get organization
+ /// Get an organization object by its id + ///
+ /// + /// Organization id + /// + /// 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> GetOrganizationIdAsResponseAsync( + global::System.Guid organizationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationId.g.cs index f74ac96..b94ee06 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationId.g.cs @@ -28,6 +28,23 @@ public partial interface IOrganizationsClient /// /// Organization id /// + /// + /// 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> PatchOrganizationIdAsResponseAsync( + global::System.Guid organizationId, + + global::Braintrust.PatchOrganization request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update organization
+ /// Partially update an organization object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Organization id + /// /// /// Name of the organization /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationMembers.g.cs b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationMembers.g.cs index 4d6499e..46f66da 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationMembers.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IOrganizationsClient.PatchOrganizationMembers.g.cs @@ -21,6 +21,19 @@ public partial interface IOrganizationsClient /// Modify organization membership
/// Modify organization membership /// + /// + /// 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> PatchOrganizationMembersAsResponseAsync( + + global::Braintrust.PatchOrganizationMembers request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify organization membership
+ /// Modify organization membership + ///
/// /// Users to invite to the organization /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IOtherClient.GetIndex.g.cs b/src/libs/Braintrust/Generated/Braintrust.IOtherClient.GetIndex.g.cs index efbe222..8604322 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IOtherClient.GetIndex.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IOtherClient.GetIndex.g.cs @@ -14,5 +14,15 @@ public partial interface IOtherClient global::System.Threading.Tasks.Task GetIndexAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Hello world endpoint
+ /// Default endpoint. Simply replies with 'Hello, World!'. Authorization is not required + ///
+ /// 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> GetIndexAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.DeleteProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.DeleteProjectAutomationId.g.cs index b390eb0..a7c7086 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.DeleteProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.DeleteProjectAutomationId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectAutomationsClient global::System.Guid projectAutomationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete project_automation
+ /// Delete a project_automation object by its id + ///
+ /// + /// ProjectAutomation id + /// + /// 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> DeleteProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomation.g.cs index faec5f6..556fbfc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomation.g.cs @@ -40,5 +40,41 @@ public partial interface IProjectAutomationsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List project_automations
+ /// List out all project_automations. The project_automations are sorted by creation date, with the most recently-created project_automations coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project_automation to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetProjectAutomationAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectAutomationName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomationId.g.cs index 61a444d..fc694c8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.GetProjectAutomationId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectAutomationsClient global::System.Guid projectAutomationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get project_automation
+ /// Get a project_automation object by its id + ///
+ /// + /// ProjectAutomation id + /// + /// 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> GetProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PatchProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PatchProjectAutomationId.g.cs index 26c2810..4c4e789 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PatchProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PatchProjectAutomationId.g.cs @@ -28,6 +28,23 @@ public partial interface IProjectAutomationsClient /// /// ProjectAutomation id /// + /// + /// 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> PatchProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + + global::Braintrust.PatchProjectAutomation request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update project_automation
+ /// Partially update a project_automation object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// ProjectAutomation id + /// /// /// Name of the project automation /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PostProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PostProjectAutomation.g.cs index 818dc42..25274fe 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PostProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PostProjectAutomation.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectAutomationsClient /// Create project_automation
/// Create a new project_automation. If there is an existing project_automation with the same name as the one specified in the request, will return the existing project_automation unmodified /// + /// + /// 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> PostProjectAutomationAsResponseAsync( + + global::Braintrust.CreateProjectAutomation request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create project_automation
+ /// Create a new project_automation. If there is an existing project_automation with the same name as the one specified in the request, will return the existing project_automation unmodified + ///
/// /// Unique identifier for the project that the project automation belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PutProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PutProjectAutomation.g.cs index 64a819d..e957eb9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PutProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectAutomationsClient.PutProjectAutomation.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectAutomationsClient /// Create or replace project_automation
/// Create or replace project_automation. If there is an existing project_automation with the same name as the one specified in the request, will replace the existing project_automation with the provided fields /// + /// + /// 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> PutProjectAutomationAsResponseAsync( + + global::Braintrust.CreateProjectAutomation request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace project_automation
+ /// Create or replace project_automation. If there is an existing project_automation with the same name as the one specified in the request, will replace the existing project_automation with the provided fields + ///
/// /// Unique identifier for the project that the project automation belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.DeleteProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.DeleteProjectScoreId.g.cs index a238dae..0f87564 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.DeleteProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.DeleteProjectScoreId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectScoresClient global::System.Guid projectScoreId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete project_score
+ /// Delete a project_score object by its id + ///
+ /// + /// ProjectScore id + /// + /// 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> DeleteProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScore.g.cs index 0bacf51..6c3670f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScore.g.cs @@ -50,5 +50,51 @@ public partial interface IProjectScoresClient global::Braintrust.AnyOf>>? scoreType = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List project_scores
+ /// List out all project_scores. The project_scores are sorted by creation date, with the most recently-created project_scores coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project_score to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// + /// 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> GetProjectScoreAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectScoreName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AnyOf>>? scoreType = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScoreId.g.cs index afbf890..4a4e804 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.GetProjectScoreId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectScoresClient global::System.Guid projectScoreId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get project_score
+ /// Get a project_score object by its id + ///
+ /// + /// ProjectScore id + /// + /// 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> GetProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PatchProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PatchProjectScoreId.g.cs index 7933947..5a3cea4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PatchProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PatchProjectScoreId.g.cs @@ -28,6 +28,23 @@ public partial interface IProjectScoresClient /// /// ProjectScore id /// + /// + /// 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> PatchProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + + global::Braintrust.PatchProjectScore request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update project_score
+ /// Partially update a project_score object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// ProjectScore id + /// /// /// Name of the project score /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PostProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PostProjectScore.g.cs index 2b589fa..0ba02d3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PostProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PostProjectScore.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectScoresClient /// Create project_score
/// Create a new project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will return the existing project_score unmodified /// + /// + /// 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> PostProjectScoreAsResponseAsync( + + global::Braintrust.CreateProjectScore request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create project_score
+ /// Create a new project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will return the existing project_score unmodified + ///
/// /// Unique identifier for the project that the project score belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PutProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PutProjectScore.g.cs index d3660df..6a81694 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PutProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectScoresClient.PutProjectScore.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectScoresClient /// Create or replace project_score
/// Create or replace project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will replace the existing project_score with the provided fields /// + /// + /// 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> PutProjectScoreAsResponseAsync( + + global::Braintrust.CreateProjectScore request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace project_score
+ /// Create or replace project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will replace the existing project_score with the provided fields + ///
/// /// Unique identifier for the project that the project score belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.DeleteProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.DeleteProjectTagId.g.cs index 38a84c2..268c15e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.DeleteProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.DeleteProjectTagId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectTagsClient global::System.Guid projectTagId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete project_tag
+ /// Delete a project_tag object by its id + ///
+ /// + /// ProjectTag id + /// + /// 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> DeleteProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTag.g.cs index 922ca33..60d1937 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTag.g.cs @@ -48,5 +48,49 @@ public partial interface IProjectTagsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List project_tags
+ /// List out all project_tags. The project_tags are sorted by creation date, with the most recently-created project_tags coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project_tag to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetProjectTagAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectTagName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTagId.g.cs index f7e2055..bdbd2d1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.GetProjectTagId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectTagsClient global::System.Guid projectTagId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get project_tag
+ /// Get a project_tag object by its id + ///
+ /// + /// ProjectTag id + /// + /// 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> GetProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PatchProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PatchProjectTagId.g.cs index dabffdc..272fce6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PatchProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PatchProjectTagId.g.cs @@ -28,6 +28,23 @@ public partial interface IProjectTagsClient /// /// ProjectTag id /// + /// + /// 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> PatchProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + + global::Braintrust.PatchProjectTag request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update project_tag
+ /// Partially update a project_tag object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// ProjectTag id + /// /// /// Name of the project tag /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PostProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PostProjectTag.g.cs index 9016d3b..4655805 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PostProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PostProjectTag.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectTagsClient /// Create project_tag
/// Create a new project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will return the existing project_tag unmodified /// + /// + /// 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> PostProjectTagAsResponseAsync( + + global::Braintrust.CreateProjectTag request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create project_tag
+ /// Create a new project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will return the existing project_tag unmodified + ///
/// /// Unique identifier for the project that the project tag belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PutProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PutProjectTag.g.cs index 1dc0bfb..ed5c985 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PutProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectTagsClient.PutProjectTag.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectTagsClient /// Create or replace project_tag
/// Create or replace project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will replace the existing project_tag with the provided fields /// + /// + /// 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> PutProjectTagAsResponseAsync( + + global::Braintrust.CreateProjectTag request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace project_tag
+ /// Create or replace project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will replace the existing project_tag with the provided fields + ///
/// /// Unique identifier for the project that the project tag belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.DeleteProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.DeleteProjectId.g.cs index b85942f..7b584e2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.DeleteProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.DeleteProjectId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectsClient global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete project
+ /// Delete a project object by its id + ///
+ /// + /// Project id + /// + /// 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> DeleteProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProject.g.cs index 5fb5bbe..eab6598 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProject.g.cs @@ -40,5 +40,41 @@ public partial interface IProjectsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List projects
+ /// List out all projects. The projects are sorted by creation date, with the most recently-created projects coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetProjectAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProjectId.g.cs index 43e68cf..f58a951 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.GetProjectId.g.cs @@ -18,5 +18,19 @@ public partial interface IProjectsClient global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get project
+ /// Get a project object by its id + ///
+ /// + /// Project id + /// + /// 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> GetProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PatchProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PatchProjectId.g.cs index 9dce03c..7c3df3b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PatchProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PatchProjectId.g.cs @@ -28,6 +28,23 @@ public partial interface IProjectsClient /// /// Project id /// + /// + /// 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> PatchProjectIdAsResponseAsync( + global::System.Guid projectId, + + global::Braintrust.PatchProject request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update project
+ /// Partially update a project object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Project id + /// /// /// Name of the project /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PostProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PostProject.g.cs index ccb75fd..2f367b5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PostProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProjectsClient.PostProject.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectsClient /// Create project
/// Create a new project. If there is an existing project with the same name as the one specified in the request, will return the existing project unmodified /// + /// + /// 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> PostProjectAsResponseAsync( + + global::Braintrust.CreateProject request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create project
+ /// Create a new project. If there is an existing project with the same name as the one specified in the request, will return the existing project unmodified + ///
/// /// Name of the project /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.DeletePromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.DeletePromptId.g.cs index 9e233f1..9cb6d37 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.DeletePromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.DeletePromptId.g.cs @@ -18,5 +18,19 @@ public partial interface IPromptsClient global::System.Guid promptId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete prompt
+ /// Delete a prompt object by its id + ///
+ /// + /// Prompt id + /// + /// 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> DeletePromptIdAsResponseAsync( + global::System.Guid promptId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPrompt.g.cs index c5b8f76..334d02d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPrompt.g.cs @@ -62,5 +62,63 @@ public partial interface IPromptsClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List prompts
+ /// List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the prompt to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Retrieve prompt with a specific slug + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow results. + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetPromptAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? promptName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? slug = default, + string? version = default, + string? environment = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPromptId.g.cs index 949535f..866e386 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.GetPromptId.g.cs @@ -28,5 +28,29 @@ public partial interface IPromptsClient string? environment = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get prompt
+ /// Get a prompt object by its id + ///
+ /// + /// Prompt id + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow 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> GetPromptIdAsResponseAsync( + global::System.Guid promptId, + string? version = default, + string? environment = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PatchPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PatchPromptId.g.cs index cecd3dc..32105cc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PatchPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PatchPromptId.g.cs @@ -28,6 +28,23 @@ public partial interface IPromptsClient /// /// Prompt id /// + /// + /// 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> PatchPromptIdAsResponseAsync( + global::System.Guid promptId, + + global::Braintrust.PatchPrompt request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update prompt
+ /// Partially update a prompt object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Prompt id + /// /// /// Name of the prompt /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PostPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PostPrompt.g.cs index 39f594d..92ebb02 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PostPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PostPrompt.g.cs @@ -21,6 +21,19 @@ public partial interface IPromptsClient /// Create prompt
/// Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified /// + /// + /// 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> PostPromptAsResponseAsync( + + global::Braintrust.CreatePrompt request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create prompt
+ /// Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified + ///
/// /// Unique identifier for the project that the prompt belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PutPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PutPrompt.g.cs index a673322..bd6a76c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PutPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IPromptsClient.PutPrompt.g.cs @@ -21,6 +21,19 @@ public partial interface IPromptsClient /// Create or replace prompt
/// Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields /// + /// + /// 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> PutPromptAsResponseAsync( + + global::Braintrust.CreatePrompt request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace prompt
+ /// Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields + ///
/// /// Unique identifier for the project that the prompt belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyauto.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyauto.g.cs index 13a2d7f..d44aad8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyauto.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyauto.g.cs @@ -21,6 +21,19 @@ public partial interface IProxyClient /// Proxy a model to chat/completions or completions automatically
/// Proxy a request to either chat/completions or completions automatically based on the model. Will cache if temperature=0 or seed is set. /// + /// + /// 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> ProxyautoAsResponseAsync( + + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy a model to chat/completions or completions automatically
+ /// Proxy a request to either chat/completions or completions automatically based on the model. Will cache if temperature=0 or seed is set. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.ProxychatCompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.ProxychatCompletions.g.cs index 0551a36..eb66bb7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.ProxychatCompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.ProxychatCompletions.g.cs @@ -21,6 +21,19 @@ public partial interface IProxyClient /// Proxy chat/completions
/// Proxy a chat/completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set. /// + /// + /// 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> ProxychatCompletionsAsResponseAsync( + + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy chat/completions
+ /// Proxy a chat/completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycompletions.g.cs index a362fd9..b66893e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycompletions.g.cs @@ -21,6 +21,19 @@ public partial interface IProxyClient /// Proxy completions
/// Proxy a completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set. /// + /// + /// 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> ProxycompletionsAsResponseAsync( + + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy completions
+ /// Proxy a completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycredentials.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycredentials.g.cs index 29c3ed6..45d13ad 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycredentials.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxycredentials.g.cs @@ -21,6 +21,19 @@ public partial interface IProxyClient /// Create temporary credential
/// Create a temporary credential which can access the proxy for a limited time. The temporary credential will be allowed to make requests on behalf of the Braintrust API key (or model provider API key) provided in the `Authorization` header. See [docs](/docs/deploy/ai-proxy#create-temporary-credentials) for code examples. /// + /// + /// 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> ProxycredentialsAsResponseAsync( + + global::Braintrust.ProxycredentialsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create temporary credential
+ /// Create a temporary credential which can access the proxy for a limited time. The temporary credential will be allowed to make requests on behalf of the Braintrust API key (or model provider API key) provided in the `Authorization` header. See [docs](/docs/deploy/ai-proxy#create-temporary-credentials) for code examples. + ///
/// /// Granted model name. Null/undefined to grant usage of all models. /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyembeddings.g.cs b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyembeddings.g.cs index 21bbe46..39dfc7f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyembeddings.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IProxyClient.Proxyembeddings.g.cs @@ -21,6 +21,19 @@ public partial interface IProxyClient /// Proxy embeddings
/// Proxy an embeddings request to the specified model, converting its format as needed. Will cache automatically. /// + /// + /// 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> ProxyembeddingsAsResponseAsync( + + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Proxy embeddings
+ /// Proxy an embeddings request to the specified model, converting its format as needed. Will cache automatically. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.DeleteRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.DeleteRoleId.g.cs index da6369e..379eb02 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.DeleteRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.DeleteRoleId.g.cs @@ -18,5 +18,19 @@ public partial interface IRolesClient global::System.Guid roleId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete role
+ /// Delete a role object by its id + ///
+ /// + /// Role id + /// + /// 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> DeleteRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRole.g.cs index 5d074b5..7abe916 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRole.g.cs @@ -40,5 +40,41 @@ public partial interface IRolesClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List roles
+ /// List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the role to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetRoleAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? roleName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRoleId.g.cs index 443b96d..6c60008 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.GetRoleId.g.cs @@ -18,5 +18,19 @@ public partial interface IRolesClient global::System.Guid roleId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get role
+ /// Get a role object by its id + ///
+ /// + /// Role id + /// + /// 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> GetRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PatchRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PatchRoleId.g.cs index e343719..507d6e6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PatchRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PatchRoleId.g.cs @@ -28,6 +28,23 @@ public partial interface IRolesClient /// /// Role id /// + /// + /// 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> PatchRoleIdAsResponseAsync( + global::System.Guid roleId, + + global::Braintrust.PatchRole request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update role
+ /// Partially update a role object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Role id + /// /// /// Textual description of the role /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PostRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PostRole.g.cs index 2836d0e..c90713d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PostRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PostRole.g.cs @@ -21,6 +21,19 @@ public partial interface IRolesClient /// Create role
/// Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified /// + /// + /// 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> PostRoleAsResponseAsync( + + global::Braintrust.CreateRole request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create role
+ /// Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified + ///
/// /// Name of the role /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PutRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PutRole.g.cs index 8960acb..2dbcda2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PutRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IRolesClient.PutRole.g.cs @@ -21,6 +21,19 @@ public partial interface IRolesClient /// Create or replace role
/// Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields /// + /// + /// 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> PutRoleAsResponseAsync( + + global::Braintrust.CreateRole request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace role
+ /// Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields + ///
/// /// Name of the role /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceToken.g.cs index 19674fe..d7e6bdc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceToken.g.cs @@ -21,6 +21,19 @@ public partial interface IServiceTokensClient /// Delete single service_token
/// Delete a single service_token /// + /// + /// 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> DeleteServiceTokenAsResponseAsync( + + global::Braintrust.DeleteServiceToken request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete single service_token
+ /// Delete a single service_token + ///
/// /// Unique identifier for the service token. /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceTokenId.g.cs index 9d52b58..2dd0560 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.DeleteServiceTokenId.g.cs @@ -18,5 +18,19 @@ public partial interface IServiceTokensClient global::System.Guid serviceTokenId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete service_token
+ /// Delete a service_token object by its id + ///
+ /// + /// ServiceToken id + /// + /// 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> DeleteServiceTokenIdAsResponseAsync( + global::System.Guid serviceTokenId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceToken.g.cs index d0c92cd..0556fa9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceToken.g.cs @@ -40,5 +40,41 @@ public partial interface IServiceTokensClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List service_tokens
+ /// List out all service_tokens. The service_tokens are sorted by creation date, with the most recently-created service_tokens coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the service_token to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetServiceTokenAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? serviceTokenName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceTokenId.g.cs index 37e2eaa..601254f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.GetServiceTokenId.g.cs @@ -18,5 +18,19 @@ public partial interface IServiceTokensClient global::System.Guid serviceTokenId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get service_token
+ /// Get a service_token object by its id + ///
+ /// + /// ServiceToken id + /// + /// 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> GetServiceTokenIdAsResponseAsync( + global::System.Guid serviceTokenId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PostServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PostServiceToken.g.cs index b5654df..3897b8b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PostServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PostServiceToken.g.cs @@ -21,6 +21,19 @@ public partial interface IServiceTokensClient /// Create service_token
/// Create a new service_token. It is possible to have multiple API keys with the same name. There is no de-duplication /// + /// + /// 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> PostServiceTokenAsResponseAsync( + + global::Braintrust.PostServiceTokenRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create service_token
+ /// Create a new service_token. It is possible to have multiple API keys with the same name. There is no de-duplication + ///
/// /// Name of the service token. Does not have to be unique /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PutServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PutServiceToken.g.cs index e06b1ae..6da5b47 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PutServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IServiceTokensClient.PutServiceToken.g.cs @@ -21,6 +21,19 @@ public partial interface IServiceTokensClient /// Create or replace service_token
/// Create or replace service_token. If there is an existing service_token with the same name as the one specified in the request, will replace the existing service_token with the provided fields /// + /// + /// 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> PutServiceTokenAsResponseAsync( + + global::Braintrust.PutServiceTokenRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace service_token
+ /// Create or replace service_token. If there is an existing service_token with the same name as the one specified in the request, will replace the existing service_token with the provided fields + ///
/// /// Name of the service token. Does not have to be unique /// diff --git a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.DeleteSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.DeleteSpanIframeId.g.cs index 9b10f10..4531ab0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.DeleteSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.DeleteSpanIframeId.g.cs @@ -18,5 +18,19 @@ public partial interface ISpanIframesClient global::System.Guid spanIframeId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete span_iframe
+ /// Delete a span_iframe object by its id + ///
+ /// + /// SpanIframe id + /// + /// 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> DeleteSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframe.g.cs index fbd35ff..f394196 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframe.g.cs @@ -40,5 +40,41 @@ public partial interface ISpanIframesClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List span_iframes
+ /// List out all span_iframes. The span_iframes are sorted by creation date, with the most recently-created span_iframes coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the span_iframe to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetSpanIframeAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? spanIframeName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframeId.g.cs index 8a47a81..09ba3ae 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.GetSpanIframeId.g.cs @@ -18,5 +18,19 @@ public partial interface ISpanIframesClient global::System.Guid spanIframeId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get span_iframe
+ /// Get a span_iframe object by its id + ///
+ /// + /// SpanIframe id + /// + /// 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> GetSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PatchSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PatchSpanIframeId.g.cs index 16c6e92..ffe3129 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PatchSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PatchSpanIframeId.g.cs @@ -28,6 +28,23 @@ public partial interface ISpanIframesClient /// /// SpanIframe id /// + /// + /// 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> PatchSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + + global::Braintrust.PatchSpanIFrame request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update span_iframe
+ /// Partially update a span_iframe object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// SpanIframe id + /// /// /// Name of the span iframe /// diff --git a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PostSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PostSpanIframe.g.cs index c02de13..1726d8d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PostSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PostSpanIframe.g.cs @@ -21,6 +21,19 @@ public partial interface ISpanIframesClient /// Create span_iframe
/// Create a new span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will return the existing span_iframe unmodified /// + /// + /// 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> PostSpanIframeAsResponseAsync( + + global::Braintrust.CreateSpanIFrame request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create span_iframe
+ /// Create a new span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will return the existing span_iframe unmodified + ///
/// /// Unique identifier for the project that the span iframe belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PutSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PutSpanIframe.g.cs index 9f59bcf..4cb7f02 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PutSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ISpanIframesClient.PutSpanIframe.g.cs @@ -21,6 +21,19 @@ public partial interface ISpanIframesClient /// Create or replace span_iframe
/// Create or replace span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will replace the existing span_iframe with the provided fields /// + /// + /// 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> PutSpanIframeAsResponseAsync( + + global::Braintrust.CreateSpanIFrame request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace span_iframe
+ /// Create or replace span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will replace the existing span_iframe with the provided fields + ///
/// /// Unique identifier for the project that the span iframe belongs under /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUser.g.cs b/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUser.g.cs index 9e1f7e8..fcb7bca 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUser.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUser.g.cs @@ -48,5 +48,49 @@ public partial interface IUsersClient string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List users
+ /// List out all users. The users are sorted by creation date, with the most recently-created users coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Given name of the user to search for. You may pass the param multiple times to filter for more than one given name + /// + /// + /// Family name of the user to search for. You may pass the param multiple times to filter for more than one family name + /// + /// + /// Email of the user to search for. You may pass the param multiple times to filter for more than one email + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetUserAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + global::Braintrust.UserGivenName? givenName = default, + global::Braintrust.UserFamilyName? familyName = default, + global::Braintrust.UserEmail? email = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUserId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUserId.g.cs index 955162f..c7d3480 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUserId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IUsersClient.GetUserId.g.cs @@ -18,5 +18,19 @@ public partial interface IUsersClient global::System.Guid userId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get user
+ /// Get a user object by its id + ///
+ /// + /// User id + /// + /// 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> GetUserIdAsResponseAsync( + global::System.Guid userId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.DeleteViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.DeleteViewId.g.cs index 0e86c97..685c0dc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.DeleteViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.DeleteViewId.g.cs @@ -28,6 +28,23 @@ public partial interface IViewsClient /// /// View id /// + /// + /// 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> DeleteViewIdAsResponseAsync( + global::System.Guid viewId, + + global::Braintrust.DeleteView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete view
+ /// Delete a view object by its id + ///
+ /// + /// View id + /// /// /// The object type that the ACL applies to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetView.g.cs b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetView.g.cs index f61b0d2..30ebc51 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetView.g.cs @@ -48,5 +48,49 @@ public partial interface IViewsClient global::Braintrust.ViewType? viewType = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List views
+ /// List out all views. The views are sorted by creation date, with the most recently-created views coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the view to search for + /// + /// + /// Type of object that the view corresponds to. + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// 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> GetViewAsResponseAsync( + global::Braintrust.AclObjectType objectType, + global::System.Guid objectId, + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? viewName = default, + global::Braintrust.ViewType? viewType = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetViewId.g.cs index f62c9ab..85fea52 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.GetViewId.g.cs @@ -26,5 +26,27 @@ public partial interface IViewsClient global::System.Guid objectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get view
+ /// Get a view object by its id + ///
+ /// + /// View id + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// 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> GetViewIdAsResponseAsync( + global::System.Guid viewId, + global::Braintrust.AclObjectType objectType, + global::System.Guid objectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PatchViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PatchViewId.g.cs index 512951f..65ac062 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PatchViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PatchViewId.g.cs @@ -28,6 +28,23 @@ public partial interface IViewsClient /// /// View id /// + /// + /// 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> PatchViewIdAsResponseAsync( + global::System.Guid viewId, + + global::Braintrust.PatchView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Partially update view
+ /// Partially update a view object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// View id + /// /// /// The object type that the ACL applies to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PostView.g.cs b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PostView.g.cs index 2a274d5..8bad3aa 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PostView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PostView.g.cs @@ -21,6 +21,19 @@ public partial interface IViewsClient /// Create view
/// Create a new view. If there is an existing view with the same name as the one specified in the request, will return the existing view unmodified /// + /// + /// 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> PostViewAsResponseAsync( + + global::Braintrust.CreateView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create view
+ /// Create a new view. If there is an existing view with the same name as the one specified in the request, will return the existing view unmodified + ///
/// /// The object type that the ACL applies to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PutView.g.cs b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PutView.g.cs index 1258496..1bdc6e2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PutView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.IViewsClient.PutView.g.cs @@ -21,6 +21,19 @@ public partial interface IViewsClient /// Create or replace view
/// Create or replace view. If there is an existing view with the same name as the one specified in the request, will replace the existing view with the provided fields /// + /// + /// 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> PutViewAsResponseAsync( + + global::Braintrust.CreateView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create or replace view
+ /// Create or replace view. If there is an existing view with the same name as the one specified in the request, will replace the existing view with the provided fields + ///
/// /// The object type that the ACL applies to /// diff --git a/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs index be92926..e02cbcc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs @@ -95,6 +95,56 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( string? version = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectLogsIdFetchAsResponseAsync( + projectId: projectId, + limit: limit, + maxXactId: maxXactId, + maxRootSpanId: maxRootSpanId, + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch project logs (GET form)
+ /// Fetch the events in a project logs. Equivalent to the POST form of the same path, but with the parameters in the URL query rather than in the request body. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Project id + /// + /// + /// limit the number of traces fetched
+ /// Fetch queries may be paginated if the total result size is expected to be large (e.g. project_logs which accumulate over a long time). Note that fetch queries only support pagination in descending time order (from latest to earliest `_xact_id`. Furthermore, later pages may return rows which showed up in earlier pages, except with an earlier `_xact_id`. This happens because pagination occurs over the whole version history of the event log. You will most likely want to exclude any such duplicate, outdated rows (by `id`) from your combined result set.
+ /// The `limit` parameter controls the number of full traces to return. So you may end up with more individual rows than the specified limit if you are fetching events containing traces. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// DEPRECATION NOTICE: The manually-constructed pagination cursor is deprecated in favor of the explicit 'cursor' returned by object fetch requests. Please prefer the 'cursor' argument going forwards.
+ /// Together, `max_xact_id` and `max_root_span_id` form a pagination cursor
+ /// Since a paginated fetch query returns results in order from latest to earliest, the cursor for the next page can be found as the row with the minimum (earliest) value of the tuple `(_xact_id, root_span_id)`. See the documentation of `limit` for an overview of paginating fetch queries. + /// + /// + /// Retrieve a snapshot of events from a past time
+ /// The version id is essentially a filter on the latest event transaction id. You can use the `max_xact_id` returned by a past fetch as the version to reproduce that exact fetch. + /// + /// 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> GetProjectLogsIdFetchAsResponseAsync( + global::System.Guid projectId, + int? limit = default, + string? maxXactId = default, + string? maxRootSpanId = default, + string? version = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -128,14 +178,15 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/fetch", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("max_xact_id", maxXactId) .AddOptionalParameter("max_root_span_id", maxRootSpanId) - .AddOptionalParameter("version", version) + .AddOptionalParameter("version", version) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -211,6 +262,8 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -221,6 +274,11 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -238,6 +296,8 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -247,8 +307,7 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -257,6 +316,11 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -273,14 +337,15 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -320,6 +385,8 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -340,6 +407,8 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -554,9 +623,13 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FetchProjectLogsEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FetchProjectLogsEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -584,9 +657,13 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FetchProjectLogsEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FetchProjectLogsEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs index e74c573..a49d566 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( public async global::System.Threading.Tasks.Task PostProjectLogsIdFeedbackAsync( global::System.Guid projectId, + global::Braintrust.FeedbackProjectLogsEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectLogsIdFeedbackAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Feedback for project logs events
+ /// Log feedback for a set of project logs events + ///
+ /// + /// Project id + /// + /// + /// 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> PostProjectLogsIdFeedbackAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.FeedbackProjectLogsEventRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/feedback", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FeedbackResponseSchema.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FeedbackResponseSchema.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FeedbackResponseSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FeedbackResponseSchema.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs index be8618a..7ed5837 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( public async global::System.Threading.Tasks.Task PostProjectLogsIdFetchAsync( global::System.Guid projectId, + global::Braintrust.FetchEventsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectLogsIdFetchAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fetch project logs (POST form)
+ /// Fetch the events in a project logs. Equivalent to the GET form of the same path, but with the parameters in the request body rather than in the URL query. For more complex queries, use the `POST /btql` endpoint. + ///
+ /// + /// Project id + /// + /// + /// 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> PostProjectLogsIdFetchAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.FetchEventsRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/fetch", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.FetchProjectLogsEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.FetchProjectLogsEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.FetchProjectLogsEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.FetchProjectLogsEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs index 1fe8060..090f61f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs @@ -66,6 +66,34 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( public async global::System.Threading.Tasks.Task PostProjectLogsIdInsertAsync( global::System.Guid projectId, + global::Braintrust.InsertProjectLogsEventRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectLogsIdInsertAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Insert project logs events
+ /// Insert a set of events into the project logs + ///
+ /// + /// Project id + /// + /// + /// 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> PostProjectLogsIdInsertAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.InsertProjectLogsEventRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_logs/{projectId}/insert", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.InsertEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.InsertEventsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.InsertEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.InsertEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.LogsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.g.cs index 83de5ca..26c9745 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.g.cs @@ -72,10 +72,10 @@ public LogsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public LogsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs index 0026158..88e3c7c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteMcpServerIdResponseContent( global::System.Guid mcpServerId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteMcpServerIdAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete mcp_server
+ /// Delete a mcp_server object by its id + ///
+ /// + /// McpServer id + /// + /// 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> DeleteMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteMcpServerIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/mcp_server/{mcpServerId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteMcpServerIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteMcpServerIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteMcpServerIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteMcpServerIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteMcpServerIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteMcpServerIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteMcpServerIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteMcpServerIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteMcpServerIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteMcpServerIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs index 9a10cd4..f5d2550 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetMcpServerResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMcpServerAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + mcpServerName: mcpServerName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List mcp_servers
+ /// List out all mcp_servers. The mcp_servers are sorted by creation date, with the most recently-created mcp_servers coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the mcp_server to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetMcpServerAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? mcpServerName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/mcp_server", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("mcp_server_name", mcpServerName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetMcpServerResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetMcpServerResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetMcpServerResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetMcpServerResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetMcpServerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetMcpServerResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs index 8281e22..d178c36 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetMcpServerIdResponseContent( global::System.Guid mcpServerId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetMcpServerIdAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get mcp_server
+ /// Get a mcp_server object by its id + ///
+ /// + /// McpServer id + /// + /// 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> GetMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetMcpServerIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/mcp_server/{mcpServerId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetMcpServerIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetMcpServerIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetMcpServerIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetMcpServerIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetMcpServerIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetMcpServerIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetMcpServerIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetMcpServerIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetMcpServerIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetMcpServerIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs index a821675..ab246ef 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchMcpServerIdResponseContent( public async global::System.Threading.Tasks.Task PatchMcpServerIdAsync( global::System.Guid mcpServerId, + global::Braintrust.PatchMCPServer request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchMcpServerIdAsResponseAsync( + mcpServerId: mcpServerId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update mcp_server
+ /// Partially update a mcp_server object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// McpServer id + /// + /// + /// 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> PatchMcpServerIdAsResponseAsync( + global::System.Guid mcpServerId, + global::Braintrust.PatchMCPServer request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchMcpServerIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/mcp_server/{mcpServerId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchMcpServerIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchMcpServerIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchMcpServerIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchMcpServerIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchMcpServerIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchMcpServerIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchMcpServerIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchMcpServerIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchMcpServerIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchMcpServerIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs index 09ae4db..ded723e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostMcpServerResponseContent( /// public async global::System.Threading.Tasks.Task PostMcpServerAsync( + global::Braintrust.CreateMCPServer request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostMcpServerAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create mcp_server
+ /// Create a new mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will return the existing mcp_server unmodified + ///
+ /// + /// 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> PostMcpServerAsResponseAsync( + global::Braintrust.CreateMCPServer request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/mcp_server", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostMcpServerResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostMcpServerResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs index 5c8b4ce..e28fdde 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutMcpServerResponseContent( /// public async global::System.Threading.Tasks.Task PutMcpServerAsync( + global::Braintrust.CreateMCPServer request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutMcpServerAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace mcp_server
+ /// Create or replace mcp_server. If there is an existing mcp_server with the same name as the one specified in the request, will replace the existing mcp_server with the provided fields + ///
+ /// + /// 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> PutMcpServerAsResponseAsync( + global::Braintrust.CreateMCPServer request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/mcp_server", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutMcpServerResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutMcpServerResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.MCPServer.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.MCPServer.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.g.cs index 29ca37a..32e0947 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.g.cs @@ -72,10 +72,10 @@ public McpServersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public McpServersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs b/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs index f4f7df3..735c83c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OptionsSupport.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.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::Braintrust.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::Braintrust.AutoSDKClientOptions clientOptions, global::Braintrust.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Braintrust.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::Braintrust.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( diff --git a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs index 879e54e..32c98e9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs @@ -90,6 +90,51 @@ partial void ProcessGetOrganizationResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetOrganizationAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List organizations
+ /// List out all organizations. The organizations are sorted by creation date, with the most recently-created organizations coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetOrganizationAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -123,15 +168,16 @@ partial void ProcessGetOrganizationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/organization", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -207,6 +253,8 @@ partial void ProcessGetOrganizationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -217,6 +265,11 @@ partial void ProcessGetOrganizationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -234,6 +287,8 @@ partial void ProcessGetOrganizationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -243,8 +298,7 @@ partial void ProcessGetOrganizationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -253,6 +307,11 @@ partial void ProcessGetOrganizationResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -269,14 +328,15 @@ partial void ProcessGetOrganizationResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -316,6 +376,8 @@ partial void ProcessGetOrganizationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -336,6 +398,8 @@ partial void ProcessGetOrganizationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -550,9 +614,13 @@ partial void ProcessGetOrganizationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetOrganizationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetOrganizationResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -580,9 +648,13 @@ partial void ProcessGetOrganizationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetOrganizationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetOrganizationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs index ab3101e..121b106 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetOrganizationIdResponseContent( global::System.Guid organizationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetOrganizationIdAsResponseAsync( + organizationId: organizationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get organization
+ /// Get an organization object by its id + ///
+ /// + /// Organization id + /// + /// 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> GetOrganizationIdAsResponseAsync( + global::System.Guid organizationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetOrganizationIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/organization/{organizationId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetOrganizationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetOrganizationIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetOrganizationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetOrganizationIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetOrganizationIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetOrganizationIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetOrganizationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetOrganizationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetOrganizationIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Organization.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Organization.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetOrganizationIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Organization.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Organization.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs index bad60b5..b879656 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchOrganizationIdResponseContent( public async global::System.Threading.Tasks.Task PatchOrganizationIdAsync( global::System.Guid organizationId, + global::Braintrust.PatchOrganization request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchOrganizationIdAsResponseAsync( + organizationId: organizationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update organization
+ /// Partially update an organization object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Organization id + /// + /// + /// 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> PatchOrganizationIdAsResponseAsync( + global::System.Guid organizationId, + global::Braintrust.PatchOrganization request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchOrganizationIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/organization/{organizationId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchOrganizationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchOrganizationIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchOrganizationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchOrganizationIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchOrganizationIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchOrganizationIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchOrganizationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchOrganizationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchOrganizationIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Organization.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Organization.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchOrganizationIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Organization.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Organization.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs index 5474938..6170832 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs @@ -60,6 +60,29 @@ partial void ProcessPatchOrganizationMembersResponseContent( /// public async global::System.Threading.Tasks.Task PatchOrganizationMembersAsync( + global::Braintrust.PatchOrganizationMembers request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchOrganizationMembersAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify organization membership
+ /// Modify organization membership + ///
+ /// + /// 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> PatchOrganizationMembersAsResponseAsync( + global::Braintrust.PatchOrganizationMembers request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPatchOrganizationMembersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/organization/members", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPatchOrganizationMembersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPatchOrganizationMembersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPatchOrganizationMembersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPatchOrganizationMembersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPatchOrganizationMembersResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPatchOrganizationMembersResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPatchOrganizationMembersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPatchOrganizationMembersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPatchOrganizationMembersResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.PatchOrganizationMembersOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.PatchOrganizationMembersOutput.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPatchOrganizationMembersResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.PatchOrganizationMembersOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.PatchOrganizationMembersOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.g.cs index f868abd..90c85c9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.g.cs @@ -72,10 +72,10 @@ public OrganizationsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public OrganizationsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs b/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs index 7dac741..5e2ffa9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs @@ -29,6 +29,24 @@ partial void ProcessGetIndexResponseContent( public async global::System.Threading.Tasks.Task GetIndexAsync( global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetIndexAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Hello world endpoint
+ /// Default endpoint. Simply replies with 'Hello, World!'. Authorization is not required + ///
+ /// 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> GetIndexAsResponseAsync( + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -51,6 +69,7 @@ partial void ProcessGetIndexResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1", baseUri: HttpClient.BaseAddress); @@ -106,6 +125,8 @@ partial void ProcessGetIndexResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -116,6 +137,11 @@ partial void ProcessGetIndexResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -133,6 +159,8 @@ partial void ProcessGetIndexResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -142,8 +170,7 @@ partial void ProcessGetIndexResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -152,6 +179,11 @@ partial void ProcessGetIndexResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -168,14 +200,15 @@ partial void ProcessGetIndexResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +248,8 @@ partial void ProcessGetIndexResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -235,6 +270,8 @@ partial void ProcessGetIndexResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -335,7 +372,11 @@ partial void ProcessGetIndexResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -363,7 +404,11 @@ partial void ProcessGetIndexResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.OtherClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.OtherClient.g.cs index 9365410..d9de218 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OtherClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OtherClient.g.cs @@ -72,10 +72,10 @@ public OtherClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public OtherClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs index 4121083..3ad1aea 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( global::System.Guid projectAutomationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteProjectAutomationIdAsResponseAsync( + projectAutomationId: projectAutomationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete project_automation
+ /// Delete a project_automation object by its id + ///
+ /// + /// ProjectAutomation id + /// + /// 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> DeleteProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_automation/{projectAutomationId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs index 6e8a950..cf585f0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetProjectAutomationResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectAutomationAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + projectAutomationName: projectAutomationName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List project_automations
+ /// List out all project_automations. The project_automations are sorted by creation date, with the most recently-created project_automations coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project_automation to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetProjectAutomationAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectAutomationName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetProjectAutomationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_automation", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("project_automation_name", projectAutomationName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetProjectAutomationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetProjectAutomationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetProjectAutomationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetProjectAutomationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetProjectAutomationResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetProjectAutomationResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetProjectAutomationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetProjectAutomationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetProjectAutomationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetProjectAutomationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetProjectAutomationResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetProjectAutomationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetProjectAutomationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetProjectAutomationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs index 4955ce9..f6d97a2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetProjectAutomationIdResponseContent( global::System.Guid projectAutomationId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectAutomationIdAsResponseAsync( + projectAutomationId: projectAutomationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get project_automation
+ /// Get a project_automation object by its id + ///
+ /// + /// ProjectAutomation id + /// + /// 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> GetProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetProjectAutomationIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_automation/{projectAutomationId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetProjectAutomationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetProjectAutomationIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetProjectAutomationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetProjectAutomationIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetProjectAutomationIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetProjectAutomationIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetProjectAutomationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetProjectAutomationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetProjectAutomationIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetProjectAutomationIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs index acd7a22..e43ab7a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchProjectAutomationIdResponseContent( public async global::System.Threading.Tasks.Task PatchProjectAutomationIdAsync( global::System.Guid projectAutomationId, + global::Braintrust.PatchProjectAutomation request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchProjectAutomationIdAsResponseAsync( + projectAutomationId: projectAutomationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update project_automation
+ /// Partially update a project_automation object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// ProjectAutomation id + /// + /// + /// 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> PatchProjectAutomationIdAsResponseAsync( + global::System.Guid projectAutomationId, + global::Braintrust.PatchProjectAutomation request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchProjectAutomationIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_automation/{projectAutomationId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchProjectAutomationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchProjectAutomationIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchProjectAutomationIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchProjectAutomationIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchProjectAutomationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchProjectAutomationIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchProjectAutomationIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchProjectAutomationIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs index 971cd0a..819c211 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostProjectAutomationResponseContent( /// public async global::System.Threading.Tasks.Task PostProjectAutomationAsync( + global::Braintrust.CreateProjectAutomation request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectAutomationAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create project_automation
+ /// Create a new project_automation. If there is an existing project_automation with the same name as the one specified in the request, will return the existing project_automation unmodified + ///
+ /// + /// 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> PostProjectAutomationAsResponseAsync( + global::Braintrust.CreateProjectAutomation request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostProjectAutomationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_automation", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostProjectAutomationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostProjectAutomationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostProjectAutomationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostProjectAutomationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostProjectAutomationResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostProjectAutomationResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostProjectAutomationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostProjectAutomationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostProjectAutomationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostProjectAutomationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs index 639bfee..7d65ea6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutProjectAutomationResponseContent( /// public async global::System.Threading.Tasks.Task PutProjectAutomationAsync( + global::Braintrust.CreateProjectAutomation request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutProjectAutomationAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace project_automation
+ /// Create or replace project_automation. If there is an existing project_automation with the same name as the one specified in the request, will replace the existing project_automation with the provided fields + ///
+ /// + /// 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> PutProjectAutomationAsResponseAsync( + global::Braintrust.CreateProjectAutomation request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutProjectAutomationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_automation", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutProjectAutomationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutProjectAutomationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutProjectAutomationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutProjectAutomationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutProjectAutomationResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutProjectAutomationResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutProjectAutomationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutProjectAutomationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutProjectAutomationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectAutomation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutProjectAutomationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectAutomation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.g.cs index 01b5206..d20a8ae 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.g.cs @@ -72,10 +72,10 @@ public ProjectAutomationsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProjectAutomationsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs index 6294f1a..d08adf5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteProjectScoreIdResponseContent( global::System.Guid projectScoreId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteProjectScoreIdAsResponseAsync( + projectScoreId: projectScoreId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete project_score
+ /// Delete a project_score object by its id + ///
+ /// + /// ProjectScore id + /// + /// 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> DeleteProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteProjectScoreIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_score/{projectScoreId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteProjectScoreIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteProjectScoreIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteProjectScoreIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteProjectScoreIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteProjectScoreIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteProjectScoreIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteProjectScoreIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteProjectScoreIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs index 990a0ca..1e2c479 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs @@ -112,6 +112,69 @@ partial void ProcessGetProjectScoreResponseContent( global::Braintrust.AnyOf>>? scoreType = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectScoreAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + projectScoreName: projectScoreName, + projectName: projectName, + projectId: projectId, + orgName: orgName, + scoreType: scoreType, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List project_scores
+ /// List out all project_scores. The project_scores are sorted by creation date, with the most recently-created project_scores coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project_score to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// + /// 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> GetProjectScoreAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectScoreName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AnyOf>>? scoreType = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -149,9 +212,10 @@ partial void ProcessGetProjectScoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_score", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -161,7 +225,7 @@ partial void ProcessGetProjectScoreResponseContent( .AddOptionalParameter("project_name", projectName) .AddOptionalParameter("project_id", projectId?.ToString()) .AddOptionalParameter("org_name", orgName) - .AddOptionalParameter("score_type", scoreType?.ToString()) + .AddOptionalParameter("score_type", scoreType?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -241,6 +305,8 @@ partial void ProcessGetProjectScoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -251,6 +317,11 @@ partial void ProcessGetProjectScoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -268,6 +339,8 @@ partial void ProcessGetProjectScoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -277,8 +350,7 @@ partial void ProcessGetProjectScoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +359,11 @@ partial void ProcessGetProjectScoreResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -303,14 +380,15 @@ partial void ProcessGetProjectScoreResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -350,6 +428,8 @@ partial void ProcessGetProjectScoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -370,6 +450,8 @@ partial void ProcessGetProjectScoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -584,9 +666,13 @@ partial void ProcessGetProjectScoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetProjectScoreResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetProjectScoreResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -614,9 +700,13 @@ partial void ProcessGetProjectScoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetProjectScoreResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetProjectScoreResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs index 5cb2935..b45ec85 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetProjectScoreIdResponseContent( global::System.Guid projectScoreId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectScoreIdAsResponseAsync( + projectScoreId: projectScoreId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get project_score
+ /// Get a project_score object by its id + ///
+ /// + /// ProjectScore id + /// + /// 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> GetProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetProjectScoreIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_score/{projectScoreId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetProjectScoreIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetProjectScoreIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetProjectScoreIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetProjectScoreIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetProjectScoreIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetProjectScoreIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetProjectScoreIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetProjectScoreIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetProjectScoreIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetProjectScoreIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs index 434461c..57bf129 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchProjectScoreIdResponseContent( public async global::System.Threading.Tasks.Task PatchProjectScoreIdAsync( global::System.Guid projectScoreId, + global::Braintrust.PatchProjectScore request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchProjectScoreIdAsResponseAsync( + projectScoreId: projectScoreId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update project_score
+ /// Partially update a project_score object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// ProjectScore id + /// + /// + /// 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> PatchProjectScoreIdAsResponseAsync( + global::System.Guid projectScoreId, + global::Braintrust.PatchProjectScore request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchProjectScoreIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_score/{projectScoreId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchProjectScoreIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchProjectScoreIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchProjectScoreIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchProjectScoreIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchProjectScoreIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchProjectScoreIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchProjectScoreIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchProjectScoreIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchProjectScoreIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchProjectScoreIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs index 0bd03e9..b0c0409 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostProjectScoreResponseContent( /// public async global::System.Threading.Tasks.Task PostProjectScoreAsync( + global::Braintrust.CreateProjectScore request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectScoreAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create project_score
+ /// Create a new project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will return the existing project_score unmodified + ///
+ /// + /// 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> PostProjectScoreAsResponseAsync( + global::Braintrust.CreateProjectScore request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostProjectScoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_score", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostProjectScoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostProjectScoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostProjectScoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostProjectScoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostProjectScoreResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostProjectScoreResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostProjectScoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostProjectScoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostProjectScoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostProjectScoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs index 587c5a0..b37bcad 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutProjectScoreResponseContent( /// public async global::System.Threading.Tasks.Task PutProjectScoreAsync( + global::Braintrust.CreateProjectScore request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutProjectScoreAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace project_score
+ /// Create or replace project_score. If there is an existing project_score in the project with the same name as the one specified in the request, will replace the existing project_score with the provided fields + ///
+ /// + /// 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> PutProjectScoreAsResponseAsync( + global::Braintrust.CreateProjectScore request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutProjectScoreResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_score", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutProjectScoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutProjectScoreResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutProjectScoreResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutProjectScoreResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutProjectScoreResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutProjectScoreResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutProjectScoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutProjectScoreResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutProjectScoreResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectScore.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutProjectScoreResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectScore.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.g.cs index 2fd8fd1..f045db2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.g.cs @@ -72,10 +72,10 @@ public ProjectScoresClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProjectScoresClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs index 117d923..6de45de 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteProjectTagIdResponseContent( global::System.Guid projectTagId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteProjectTagIdAsResponseAsync( + projectTagId: projectTagId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete project_tag
+ /// Delete a project_tag object by its id + ///
+ /// + /// ProjectTag id + /// + /// 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> DeleteProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteProjectTagIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_tag/{projectTagId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteProjectTagIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteProjectTagIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteProjectTagIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteProjectTagIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteProjectTagIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteProjectTagIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteProjectTagIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteProjectTagIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteProjectTagIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteProjectTagIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs index 02e36e3..3050d17 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs @@ -108,6 +108,66 @@ partial void ProcessGetProjectTagResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectTagAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + projectTagName: projectTagName, + projectName: projectName, + projectId: projectId, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List project_tags
+ /// List out all project_tags. The project_tags are sorted by creation date, with the most recently-created project_tags coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project_tag to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetProjectTagAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectTagName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -144,9 +204,10 @@ partial void ProcessGetProjectTagResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_tag", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -155,7 +216,7 @@ partial void ProcessGetProjectTagResponseContent( .AddOptionalParameter("project_tag_name", projectTagName) .AddOptionalParameter("project_name", projectName) .AddOptionalParameter("project_id", projectId?.ToString()) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -234,6 +295,8 @@ partial void ProcessGetProjectTagResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -244,6 +307,11 @@ partial void ProcessGetProjectTagResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -261,6 +329,8 @@ partial void ProcessGetProjectTagResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -270,8 +340,7 @@ partial void ProcessGetProjectTagResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +349,11 @@ partial void ProcessGetProjectTagResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -296,14 +370,15 @@ partial void ProcessGetProjectTagResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -343,6 +418,8 @@ partial void ProcessGetProjectTagResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -363,6 +440,8 @@ partial void ProcessGetProjectTagResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -577,9 +656,13 @@ partial void ProcessGetProjectTagResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetProjectTagResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetProjectTagResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -607,9 +690,13 @@ partial void ProcessGetProjectTagResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetProjectTagResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetProjectTagResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs index 86ee18f..a0aa13c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetProjectTagIdResponseContent( global::System.Guid projectTagId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectTagIdAsResponseAsync( + projectTagId: projectTagId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get project_tag
+ /// Get a project_tag object by its id + ///
+ /// + /// ProjectTag id + /// + /// 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> GetProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetProjectTagIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_tag/{projectTagId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetProjectTagIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetProjectTagIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetProjectTagIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetProjectTagIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetProjectTagIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetProjectTagIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetProjectTagIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetProjectTagIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetProjectTagIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetProjectTagIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs index 5b47dce..7220c90 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchProjectTagIdResponseContent( public async global::System.Threading.Tasks.Task PatchProjectTagIdAsync( global::System.Guid projectTagId, + global::Braintrust.PatchProjectTag request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchProjectTagIdAsResponseAsync( + projectTagId: projectTagId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update project_tag
+ /// Partially update a project_tag object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// ProjectTag id + /// + /// + /// 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> PatchProjectTagIdAsResponseAsync( + global::System.Guid projectTagId, + global::Braintrust.PatchProjectTag request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchProjectTagIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project_tag/{projectTagId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchProjectTagIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchProjectTagIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchProjectTagIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchProjectTagIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchProjectTagIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchProjectTagIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchProjectTagIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchProjectTagIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchProjectTagIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchProjectTagIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs index 87af497..12813f8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostProjectTagResponseContent( /// public async global::System.Threading.Tasks.Task PostProjectTagAsync( + global::Braintrust.CreateProjectTag request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectTagAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create project_tag
+ /// Create a new project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will return the existing project_tag unmodified + ///
+ /// + /// 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> PostProjectTagAsResponseAsync( + global::Braintrust.CreateProjectTag request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostProjectTagResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_tag", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostProjectTagResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostProjectTagResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostProjectTagResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostProjectTagResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostProjectTagResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostProjectTagResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostProjectTagResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostProjectTagResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostProjectTagResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostProjectTagResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs index 9c49430..2f5f6fd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutProjectTagResponseContent( /// public async global::System.Threading.Tasks.Task PutProjectTagAsync( + global::Braintrust.CreateProjectTag request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutProjectTagAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace project_tag
+ /// Create or replace project_tag. If there is an existing project_tag in the project with the same name as the one specified in the request, will replace the existing project_tag with the provided fields + ///
+ /// + /// 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> PutProjectTagAsResponseAsync( + global::Braintrust.CreateProjectTag request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutProjectTagResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project_tag", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutProjectTagResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutProjectTagResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutProjectTagResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutProjectTagResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutProjectTagResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutProjectTagResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutProjectTagResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutProjectTagResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutProjectTagResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProjectTag.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutProjectTagResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProjectTag.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.g.cs index 5bb70d5..f393361 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.g.cs @@ -72,10 +72,10 @@ public ProjectTagsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProjectTagsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs index 706e403..70e4d23 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteProjectIdResponseContent( global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteProjectIdAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete project
+ /// Delete a project object by its id + ///
+ /// + /// Project id + /// + /// 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> DeleteProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteProjectIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project/{projectId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteProjectIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteProjectIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteProjectIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteProjectIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteProjectIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteProjectIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteProjectIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteProjectIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteProjectIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteProjectIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs index 087db98..2225de4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetProjectResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + projectName: projectName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List projects
+ /// List out all projects. The projects are sorted by creation date, with the most recently-created projects coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the project to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetProjectAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? projectName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("project_name", projectName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetProjectResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetProjectResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs index 6a2ff14..7cad8a5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetProjectIdResponseContent( global::System.Guid projectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectIdAsResponseAsync( + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get project
+ /// Get a project object by its id + ///
+ /// + /// Project id + /// + /// 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> GetProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetProjectIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project/{projectId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetProjectIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetProjectIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetProjectIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetProjectIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetProjectIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetProjectIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetProjectIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetProjectIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetProjectIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetProjectIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs index 0e958d8..33f92cd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchProjectIdResponseContent( public async global::System.Threading.Tasks.Task PatchProjectIdAsync( global::System.Guid projectId, + global::Braintrust.PatchProject request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchProjectIdAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update project
+ /// Partially update a project object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Project id + /// + /// + /// 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> PatchProjectIdAsResponseAsync( + global::System.Guid projectId, + global::Braintrust.PatchProject request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchProjectIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/project/{projectId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchProjectIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchProjectIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchProjectIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchProjectIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchProjectIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchProjectIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchProjectIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchProjectIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchProjectIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchProjectIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs index 9e9ed5d..6ed0e65 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostProjectResponseContent( /// public async global::System.Threading.Tasks.Task PostProjectAsync( + global::Braintrust.CreateProject request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostProjectAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create project
+ /// Create a new project. If there is an existing project with the same name as the one specified in the request, will return the existing project unmodified + ///
+ /// + /// 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> PostProjectAsResponseAsync( + global::Braintrust.CreateProject request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/project", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostProjectResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostProjectResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.g.cs index 999d2f7..b30c14d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.g.cs @@ -72,10 +72,10 @@ public ProjectsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProjectsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs index 6bb7254..d6379ff 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeletePromptIdResponseContent( global::System.Guid promptId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeletePromptIdAsResponseAsync( + promptId: promptId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete prompt
+ /// Delete a prompt object by its id + ///
+ /// + /// Prompt id + /// + /// 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> DeletePromptIdAsResponseAsync( + global::System.Guid promptId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeletePromptIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/prompt/{promptId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeletePromptIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeletePromptIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeletePromptIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeletePromptIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeletePromptIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeletePromptIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeletePromptIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeletePromptIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeletePromptIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeletePromptIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs index 69f1f03..9d978e7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs @@ -128,6 +128,83 @@ partial void ProcessGetPromptResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetPromptAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + promptName: promptName, + projectName: projectName, + projectId: projectId, + slug: slug, + version: version, + environment: environment, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List prompts
+ /// List out all prompts. The prompts are sorted by creation date, with the most recently-created prompts coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the prompt to search for + /// + /// + /// Name of the project to search for + /// + /// + /// Project id + /// + /// + /// Retrieve prompt with a specific slug + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow results. + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetPromptAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? promptName = default, + string? projectName = default, + global::System.Guid? projectId = default, + string? slug = default, + string? version = default, + string? environment = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -167,9 +244,10 @@ partial void ProcessGetPromptResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/prompt", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -181,7 +259,7 @@ partial void ProcessGetPromptResponseContent( .AddOptionalParameter("slug", slug) .AddOptionalParameter("version", version) .AddOptionalParameter("environment", environment) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -263,6 +341,8 @@ partial void ProcessGetPromptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -273,6 +353,11 @@ partial void ProcessGetPromptResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -290,6 +375,8 @@ partial void ProcessGetPromptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -299,8 +386,7 @@ partial void ProcessGetPromptResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +395,11 @@ partial void ProcessGetPromptResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -325,14 +416,15 @@ partial void ProcessGetPromptResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -372,6 +464,8 @@ partial void ProcessGetPromptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -392,6 +486,8 @@ partial void ProcessGetPromptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -606,9 +702,13 @@ partial void ProcessGetPromptResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetPromptResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetPromptResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -636,9 +736,13 @@ partial void ProcessGetPromptResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetPromptResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetPromptResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs index 77f32ef..0591c65 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs @@ -78,6 +78,41 @@ partial void ProcessGetPromptIdResponseContent( string? environment = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetPromptIdAsResponseAsync( + promptId: promptId, + version: version, + environment: environment, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get prompt
+ /// Get a prompt object by its id + ///
+ /// + /// Prompt id + /// + /// + /// Retrieve prompt at a specific version.
+ /// The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3'). + /// + /// + /// Filter by environment slug. Cannot be used together with `version`.
+ /// For `GET /v1/prompt`, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns `400` (for example when `limit=1` is not set). Use `limit=1` or other filters (for example `slug`, `project_id`) to narrow 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> GetPromptIdAsResponseAsync( + global::System.Guid promptId, + string? version = default, + string? environment = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,12 +144,13 @@ partial void ProcessGetPromptIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/prompt/{promptId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("version", version) - .AddOptionalParameter("environment", environment) + .AddOptionalParameter("environment", environment) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -188,6 +224,8 @@ partial void ProcessGetPromptIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +236,11 @@ partial void ProcessGetPromptIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +258,8 @@ partial void ProcessGetPromptIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +269,7 @@ partial void ProcessGetPromptIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +278,11 @@ partial void ProcessGetPromptIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +299,15 @@ partial void ProcessGetPromptIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +347,8 @@ partial void ProcessGetPromptIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +369,8 @@ partial void ProcessGetPromptIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -531,9 +585,13 @@ partial void ProcessGetPromptIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -561,9 +619,13 @@ partial void ProcessGetPromptIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs index 2636d0c..2f1a23a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchPromptIdResponseContent( public async global::System.Threading.Tasks.Task PatchPromptIdAsync( global::System.Guid promptId, + global::Braintrust.PatchPrompt request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchPromptIdAsResponseAsync( + promptId: promptId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update prompt
+ /// Partially update a prompt object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Prompt id + /// + /// + /// 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> PatchPromptIdAsResponseAsync( + global::System.Guid promptId, + global::Braintrust.PatchPrompt request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchPromptIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/prompt/{promptId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchPromptIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchPromptIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchPromptIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchPromptIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchPromptIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchPromptIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchPromptIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchPromptIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchPromptIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchPromptIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs index e71aae4..ffd09bb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostPromptResponseContent( /// public async global::System.Threading.Tasks.Task PostPromptAsync( + global::Braintrust.CreatePrompt request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostPromptAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create prompt
+ /// Create a new prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will return the existing prompt unmodified + ///
+ /// + /// 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> PostPromptAsResponseAsync( + global::Braintrust.CreatePrompt request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostPromptResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/prompt", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostPromptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostPromptResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostPromptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostPromptResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostPromptResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostPromptResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostPromptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostPromptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostPromptResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostPromptResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs index 05d9d6f..5b04abf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutPromptResponseContent( /// public async global::System.Threading.Tasks.Task PutPromptAsync( + global::Braintrust.CreatePrompt request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutPromptAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace prompt
+ /// Create or replace prompt. If there is an existing prompt in the project with the same slug as the one specified in the request, will replace the existing prompt with the provided fields + ///
+ /// + /// 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> PutPromptAsResponseAsync( + global::Braintrust.CreatePrompt request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutPromptResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/prompt", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutPromptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutPromptResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutPromptResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutPromptResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutPromptResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutPromptResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutPromptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutPromptResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutPromptResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Prompt.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutPromptResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Prompt.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.g.cs index e61b3e4..72b2ec6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.g.cs @@ -72,10 +72,10 @@ public PromptsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PromptsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs index a87fef1..ee249d8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs @@ -60,6 +60,29 @@ partial void ProcessProxyautoResponseContent( /// public async global::System.Threading.Tasks.Task ProxyautoAsync( + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyautoAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy a model to chat/completions or completions automatically
+ /// Proxy a request to either chat/completions or completions automatically based on the model. Will cache if temperature=0 or seed is set. + ///
+ /// + /// 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> ProxyautoAsResponseAsync( + object request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessProxyautoResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/auto", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessProxyautoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessProxyautoResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessProxyautoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessProxyautoResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessProxyautoResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessProxyautoResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessProxyautoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessProxyautoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,7 +368,11 @@ partial void ProcessProxyautoResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -354,7 +400,11 @@ partial void ProcessProxyautoResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs index ed62c5c..296064f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs @@ -60,6 +60,29 @@ partial void ProcessProxychatCompletionsResponseContent( /// public async global::System.Threading.Tasks.Task ProxychatCompletionsAsync( + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxychatCompletionsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy chat/completions
+ /// Proxy a chat/completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set. + ///
+ /// + /// 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> ProxychatCompletionsAsResponseAsync( + object request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessProxychatCompletionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/chat/completions", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessProxychatCompletionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessProxychatCompletionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessProxychatCompletionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessProxychatCompletionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessProxychatCompletionsResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessProxychatCompletionsResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessProxychatCompletionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessProxychatCompletionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,7 +368,11 @@ partial void ProcessProxychatCompletionsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -354,7 +400,11 @@ partial void ProcessProxychatCompletionsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs index dd502c0..9fbc220 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs @@ -60,6 +60,29 @@ partial void ProcessProxycompletionsResponseContent( /// public async global::System.Threading.Tasks.Task ProxycompletionsAsync( + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxycompletionsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy completions
+ /// Proxy a completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set. + ///
+ /// + /// 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> ProxycompletionsAsResponseAsync( + object request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessProxycompletionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/completions", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessProxycompletionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessProxycompletionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessProxycompletionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessProxycompletionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessProxycompletionsResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessProxycompletionsResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessProxycompletionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessProxycompletionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,7 +368,11 @@ partial void ProcessProxycompletionsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -354,7 +400,11 @@ partial void ProcessProxycompletionsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs index c6992f3..d165669 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs @@ -60,6 +60,29 @@ partial void ProcessProxycredentialsResponseContent( /// public async global::System.Threading.Tasks.Task ProxycredentialsAsync( + global::Braintrust.ProxycredentialsRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxycredentialsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create temporary credential
+ /// Create a temporary credential which can access the proxy for a limited time. The temporary credential will be allowed to make requests on behalf of the Braintrust API key (or model provider API key) provided in the `Authorization` header. See [docs](/docs/deploy/ai-proxy#create-temporary-credentials) for code examples. + ///
+ /// + /// 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> ProxycredentialsAsResponseAsync( + global::Braintrust.ProxycredentialsRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessProxycredentialsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/credentials", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessProxycredentialsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessProxycredentialsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessProxycredentialsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessProxycredentialsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessProxycredentialsResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessProxycredentialsResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessProxycredentialsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessProxycredentialsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -364,9 +406,13 @@ partial void ProcessProxycredentialsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ProxycredentialsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ProxycredentialsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -394,9 +440,13 @@ partial void ProcessProxycredentialsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ProxycredentialsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ProxycredentialsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs index c362c6b..4d05b49 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs @@ -60,6 +60,29 @@ partial void ProcessProxyembeddingsResponseContent( /// public async global::System.Threading.Tasks.Task ProxyembeddingsAsync( + object request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProxyembeddingsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Proxy embeddings
+ /// Proxy an embeddings request to the specified model, converting its format as needed. Will cache automatically. + ///
+ /// + /// 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> ProxyembeddingsAsResponseAsync( + object request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessProxyembeddingsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/proxy/embeddings", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessProxyembeddingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessProxyembeddingsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessProxyembeddingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessProxyembeddingsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessProxyembeddingsResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessProxyembeddingsResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessProxyembeddingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessProxyembeddingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,7 +368,11 @@ partial void ProcessProxyembeddingsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -354,7 +400,11 @@ partial void ProcessProxyembeddingsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.g.cs index 4d81a71..087e9d7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.g.cs @@ -72,10 +72,10 @@ public ProxyClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProxyClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs index 92b4bae..d368f41 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteRoleIdResponseContent( global::System.Guid roleId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteRoleIdAsResponseAsync( + roleId: roleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete role
+ /// Delete a role object by its id + ///
+ /// + /// Role id + /// + /// 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> DeleteRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteRoleIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/role/{roleId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteRoleIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteRoleIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteRoleIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteRoleIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteRoleIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteRoleIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteRoleIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteRoleIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteRoleIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteRoleIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs index c1f5de9..a1f7c0f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetRoleResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRoleAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + roleName: roleName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List roles
+ /// List out all roles. The roles are sorted by creation date, with the most recently-created roles coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the role to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetRoleAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? roleName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetRoleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/role", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("role_name", roleName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetRoleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetRoleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetRoleResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetRoleResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetRoleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetRoleResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetRoleResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetRoleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetRoleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetRoleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs index a3b5ecd..083e5c0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetRoleIdResponseContent( global::System.Guid roleId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRoleIdAsResponseAsync( + roleId: roleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get role
+ /// Get a role object by its id + ///
+ /// + /// Role id + /// + /// 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> GetRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetRoleIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/role/{roleId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetRoleIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetRoleIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetRoleIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetRoleIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetRoleIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetRoleIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetRoleIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetRoleIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetRoleIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetRoleIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs index 8a3a8d9..2f6f4ea 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchRoleIdResponseContent( public async global::System.Threading.Tasks.Task PatchRoleIdAsync( global::System.Guid roleId, + global::Braintrust.PatchRole request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchRoleIdAsResponseAsync( + roleId: roleId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update role
+ /// Partially update a role object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// Role id + /// + /// + /// 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> PatchRoleIdAsResponseAsync( + global::System.Guid roleId, + global::Braintrust.PatchRole request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchRoleIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/role/{roleId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchRoleIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchRoleIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchRoleIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchRoleIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchRoleIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchRoleIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchRoleIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchRoleIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchRoleIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchRoleIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs index 6f89ca3..7dbdfca 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostRoleResponseContent( /// public async global::System.Threading.Tasks.Task PostRoleAsync( + global::Braintrust.CreateRole request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostRoleAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create role
+ /// Create a new role. If there is an existing role with the same name as the one specified in the request, will return the existing role unmodified + ///
+ /// + /// 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> PostRoleAsResponseAsync( + global::Braintrust.CreateRole request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostRoleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/role", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostRoleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostRoleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostRoleResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostRoleResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostRoleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostRoleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs index 6b21147..87d2976 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutRoleResponseContent( /// public async global::System.Threading.Tasks.Task PutRoleAsync( + global::Braintrust.CreateRole request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutRoleAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace role
+ /// Create or replace role. If there is an existing role with the same name as the one specified in the request, will replace the existing role with the provided fields + ///
+ /// + /// 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> PutRoleAsResponseAsync( + global::Braintrust.CreateRole request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutRoleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/role", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutRoleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutRoleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutRoleResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutRoleResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutRoleResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.Role.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutRoleResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.Role.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.RolesClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.g.cs index 3f5a659..c214af2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.g.cs @@ -72,10 +72,10 @@ public RolesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public RolesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs index db349f1..2c063f7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs @@ -60,6 +60,29 @@ partial void ProcessDeleteServiceTokenResponseContent( /// public async global::System.Threading.Tasks.Task DeleteServiceTokenAsync( + global::Braintrust.DeleteServiceToken request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteServiceTokenAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete single service_token
+ /// Delete a single service_token + ///
+ /// + /// 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> DeleteServiceTokenAsResponseAsync( + global::Braintrust.DeleteServiceToken request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessDeleteServiceTokenResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/service_token", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessDeleteServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessDeleteServiceTokenResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessDeleteServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessDeleteServiceTokenResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessDeleteServiceTokenResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessDeleteServiceTokenResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessDeleteServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessDeleteServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessDeleteServiceTokenResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ServiceToken.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ServiceToken.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessDeleteServiceTokenResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ServiceToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ServiceToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs index 2cf3710..122249d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteServiceTokenIdResponseContent( global::System.Guid serviceTokenId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteServiceTokenIdAsResponseAsync( + serviceTokenId: serviceTokenId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete service_token
+ /// Delete a service_token object by its id + ///
+ /// + /// ServiceToken id + /// + /// 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> DeleteServiceTokenIdAsResponseAsync( + global::System.Guid serviceTokenId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteServiceTokenIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/service_token/{serviceTokenId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteServiceTokenIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteServiceTokenIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteServiceTokenIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteServiceTokenIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteServiceTokenIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteServiceTokenIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteServiceTokenIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ServiceToken.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ServiceToken.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteServiceTokenIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ServiceToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ServiceToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs index b9a7918..6b76a9d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetServiceTokenResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetServiceTokenAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + serviceTokenName: serviceTokenName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List service_tokens
+ /// List out all service_tokens. The service_tokens are sorted by creation date, with the most recently-created service_tokens coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the service_token to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetServiceTokenAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? serviceTokenName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetServiceTokenResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/service_token", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("service_token_name", serviceTokenName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetServiceTokenResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetServiceTokenResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetServiceTokenResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetServiceTokenResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetServiceTokenResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetServiceTokenResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetServiceTokenResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetServiceTokenResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetServiceTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetServiceTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs index 930f048..6539980 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetServiceTokenIdResponseContent( global::System.Guid serviceTokenId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetServiceTokenIdAsResponseAsync( + serviceTokenId: serviceTokenId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get service_token
+ /// Get a service_token object by its id + ///
+ /// + /// ServiceToken id + /// + /// 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> GetServiceTokenIdAsResponseAsync( + global::System.Guid serviceTokenId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetServiceTokenIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/service_token/{serviceTokenId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetServiceTokenIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetServiceTokenIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetServiceTokenIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetServiceTokenIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetServiceTokenIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetServiceTokenIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetServiceTokenIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetServiceTokenIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetServiceTokenIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.ServiceToken.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.ServiceToken.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetServiceTokenIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.ServiceToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.ServiceToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PostServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PostServiceToken.g.cs index 5509cc8..d10dde9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PostServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PostServiceToken.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostServiceTokenResponseContent( /// public async global::System.Threading.Tasks.Task PostServiceTokenAsync( + global::Braintrust.PostServiceTokenRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostServiceTokenAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create service_token
+ /// Create a new service_token. It is possible to have multiple API keys with the same name. There is no de-duplication + ///
+ /// + /// 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> PostServiceTokenAsResponseAsync( + global::Braintrust.PostServiceTokenRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostServiceTokenResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/service_token", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostServiceTokenResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostServiceTokenResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostServiceTokenResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostServiceTokenResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostServiceTokenResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.CreateServiceTokenOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.CreateServiceTokenOutput.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostServiceTokenResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.CreateServiceTokenOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.CreateServiceTokenOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PutServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PutServiceToken.g.cs index af05169..2ed7e14 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PutServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.PutServiceToken.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutServiceTokenResponseContent( /// public async global::System.Threading.Tasks.Task PutServiceTokenAsync( + global::Braintrust.PutServiceTokenRequest request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutServiceTokenAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace service_token
+ /// Create or replace service_token. If there is an existing service_token with the same name as the one specified in the request, will replace the existing service_token with the provided fields + ///
+ /// + /// 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> PutServiceTokenAsResponseAsync( + global::Braintrust.PutServiceTokenRequest request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutServiceTokenResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/service_token", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutServiceTokenResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutServiceTokenResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutServiceTokenResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutServiceTokenResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutServiceTokenResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutServiceTokenResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutServiceTokenResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.CreateServiceTokenOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.CreateServiceTokenOutput.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutServiceTokenResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.CreateServiceTokenOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.CreateServiceTokenOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.g.cs index 2b1cf5f..9455d04 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.g.cs @@ -72,10 +72,10 @@ public ServiceTokensClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ServiceTokensClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs index 189c8fb..75e4df3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs @@ -64,6 +64,29 @@ partial void ProcessDeleteSpanIframeIdResponseContent( global::System.Guid spanIframeId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteSpanIframeIdAsResponseAsync( + spanIframeId: spanIframeId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete span_iframe
+ /// Delete a span_iframe object by its id + ///
+ /// + /// SpanIframe id + /// + /// 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> DeleteSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessDeleteSpanIframeIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/span_iframe/{spanIframeId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessDeleteSpanIframeIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessDeleteSpanIframeIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessDeleteSpanIframeIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessDeleteSpanIframeIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessDeleteSpanIframeIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessDeleteSpanIframeIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessDeleteSpanIframeIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessDeleteSpanIframeIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs index 6d0c864..b76df4a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs @@ -96,6 +96,56 @@ partial void ProcessGetSpanIframeResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSpanIframeAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + spanIframeName: spanIframeName, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List span_iframes
+ /// List out all span_iframes. The span_iframes are sorted by creation date, with the most recently-created span_iframes coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the span_iframe to search for + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetSpanIframeAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? spanIframeName = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -130,16 +180,17 @@ partial void ProcessGetSpanIframeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/span_iframe", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) .AddOptionalParameter("ending_before", endingBefore?.ToString()) .AddOptionalParameter("ids", ids?.ToString()) .AddOptionalParameter("span_iframe_name", spanIframeName) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -216,6 +267,8 @@ partial void ProcessGetSpanIframeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -226,6 +279,11 @@ partial void ProcessGetSpanIframeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -243,6 +301,8 @@ partial void ProcessGetSpanIframeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -252,8 +312,7 @@ partial void ProcessGetSpanIframeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -262,6 +321,11 @@ partial void ProcessGetSpanIframeResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -278,14 +342,15 @@ partial void ProcessGetSpanIframeResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -325,6 +390,8 @@ partial void ProcessGetSpanIframeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -345,6 +412,8 @@ partial void ProcessGetSpanIframeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -559,9 +628,13 @@ partial void ProcessGetSpanIframeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetSpanIframeResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetSpanIframeResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -589,9 +662,13 @@ partial void ProcessGetSpanIframeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetSpanIframeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetSpanIframeResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs index b3ea452..a46790b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetSpanIframeIdResponseContent( global::System.Guid spanIframeId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSpanIframeIdAsResponseAsync( + spanIframeId: spanIframeId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get span_iframe
+ /// Get a span_iframe object by its id + ///
+ /// + /// SpanIframe id + /// + /// 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> GetSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetSpanIframeIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/span_iframe/{spanIframeId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetSpanIframeIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetSpanIframeIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetSpanIframeIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetSpanIframeIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetSpanIframeIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetSpanIframeIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetSpanIframeIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetSpanIframeIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetSpanIframeIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetSpanIframeIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs index ba40087..bdd6aed 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchSpanIframeIdResponseContent( public async global::System.Threading.Tasks.Task PatchSpanIframeIdAsync( global::System.Guid spanIframeId, + global::Braintrust.PatchSpanIFrame request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchSpanIframeIdAsResponseAsync( + spanIframeId: spanIframeId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update span_iframe
+ /// Partially update a span_iframe object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// SpanIframe id + /// + /// + /// 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> PatchSpanIframeIdAsResponseAsync( + global::System.Guid spanIframeId, + global::Braintrust.PatchSpanIFrame request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchSpanIframeIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/span_iframe/{spanIframeId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchSpanIframeIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchSpanIframeIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchSpanIframeIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchSpanIframeIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchSpanIframeIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchSpanIframeIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchSpanIframeIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchSpanIframeIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchSpanIframeIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchSpanIframeIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs index ab98e23..92d084a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostSpanIframeResponseContent( /// public async global::System.Threading.Tasks.Task PostSpanIframeAsync( + global::Braintrust.CreateSpanIFrame request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostSpanIframeAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create span_iframe
+ /// Create a new span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will return the existing span_iframe unmodified + ///
+ /// + /// 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> PostSpanIframeAsResponseAsync( + global::Braintrust.CreateSpanIFrame request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostSpanIframeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/span_iframe", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostSpanIframeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostSpanIframeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostSpanIframeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostSpanIframeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostSpanIframeResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostSpanIframeResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostSpanIframeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostSpanIframeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostSpanIframeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostSpanIframeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs index b153831..4491d00 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutSpanIframeResponseContent( /// public async global::System.Threading.Tasks.Task PutSpanIframeAsync( + global::Braintrust.CreateSpanIFrame request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutSpanIframeAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace span_iframe
+ /// Create or replace span_iframe. If there is an existing span_iframe with the same name as the one specified in the request, will replace the existing span_iframe with the provided fields + ///
+ /// + /// 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> PutSpanIframeAsResponseAsync( + global::Braintrust.CreateSpanIFrame request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutSpanIframeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/span_iframe", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutSpanIframeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutSpanIframeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutSpanIframeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutSpanIframeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutSpanIframeResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutSpanIframeResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutSpanIframeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutSpanIframeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutSpanIframeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.SpanIFrame.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutSpanIframeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.SpanIFrame.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.g.cs index 3b657e2..76439ba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.g.cs @@ -72,10 +72,10 @@ public SpanIframesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SpanIframesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs index 5c973e9..06fab34 100644 --- a/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs @@ -108,6 +108,66 @@ partial void ProcessGetUserResponseContent( string? orgName = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetUserAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + givenName: givenName, + familyName: familyName, + email: email, + orgName: orgName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List users
+ /// List out all users. The users are sorted by creation date, with the most recently-created users coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Given name of the user to search for. You may pass the param multiple times to filter for more than one given name + /// + /// + /// Family name of the user to search for. You may pass the param multiple times to filter for more than one family name + /// + /// + /// Email of the user to search for. You may pass the param multiple times to filter for more than one email + /// + /// + /// Filter search results to within a particular organization + /// + /// 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> GetUserAsResponseAsync( + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + global::Braintrust.UserGivenName? givenName = default, + global::Braintrust.UserFamilyName? familyName = default, + global::Braintrust.UserEmail? email = default, + string? orgName = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -144,9 +204,10 @@ partial void ProcessGetUserResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/user", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -155,7 +216,7 @@ partial void ProcessGetUserResponseContent( .AddOptionalParameter("given_name", givenName?.ToString()) .AddOptionalParameter("family_name", familyName?.ToString()) .AddOptionalParameter("email", email?.ToString()) - .AddOptionalParameter("org_name", orgName) + .AddOptionalParameter("org_name", orgName) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -234,6 +295,8 @@ partial void ProcessGetUserResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -244,6 +307,11 @@ partial void ProcessGetUserResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -261,6 +329,8 @@ partial void ProcessGetUserResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -270,8 +340,7 @@ partial void ProcessGetUserResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +349,11 @@ partial void ProcessGetUserResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -296,14 +370,15 @@ partial void ProcessGetUserResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -343,6 +418,8 @@ partial void ProcessGetUserResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -363,6 +440,8 @@ partial void ProcessGetUserResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -577,9 +656,13 @@ partial void ProcessGetUserResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetUserResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetUserResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -607,9 +690,13 @@ partial void ProcessGetUserResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetUserResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetUserResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs index 50aa192..8f64113 100644 --- a/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs @@ -64,6 +64,29 @@ partial void ProcessGetUserIdResponseContent( global::System.Guid userId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetUserIdAsResponseAsync( + userId: userId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get user
+ /// Get a user object by its id + ///
+ /// + /// User id + /// + /// 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> GetUserIdAsResponseAsync( + global::System.Guid userId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -93,6 +116,7 @@ partial void ProcessGetUserIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/user/{userId}", baseUri: HttpClient.BaseAddress); @@ -166,6 +190,8 @@ partial void ProcessGetUserIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +202,11 @@ partial void ProcessGetUserIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +224,8 @@ partial void ProcessGetUserIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +235,7 @@ partial void ProcessGetUserIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +244,11 @@ partial void ProcessGetUserIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +265,15 @@ partial void ProcessGetUserIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +313,8 @@ partial void ProcessGetUserIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +335,8 @@ partial void ProcessGetUserIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -509,9 +551,13 @@ partial void ProcessGetUserIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.User.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.User.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +585,13 @@ partial void ProcessGetUserIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.User.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.UsersClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.UsersClient.g.cs index 81def3e..5190564 100644 --- a/src/libs/Braintrust/Generated/Braintrust.UsersClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.UsersClient.g.cs @@ -72,10 +72,10 @@ public UsersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public UsersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs index 737cfa9..2e8fd33 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs @@ -66,6 +66,34 @@ partial void ProcessDeleteViewIdResponseContent( public async global::System.Threading.Tasks.Task DeleteViewIdAsync( global::System.Guid viewId, + global::Braintrust.DeleteView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteViewIdAsResponseAsync( + viewId: viewId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete view
+ /// Delete a view object by its id + ///
+ /// + /// View id + /// + /// + /// 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> DeleteViewIdAsResponseAsync( + global::System.Guid viewId, + global::Braintrust.DeleteView request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessDeleteViewIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/view/{viewId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessDeleteViewIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessDeleteViewIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessDeleteViewIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessDeleteViewIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessDeleteViewIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessDeleteViewIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessDeleteViewIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessDeleteViewIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessDeleteViewIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessDeleteViewIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs index ef0efa9..025dc6d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs @@ -108,6 +108,66 @@ partial void ProcessGetViewResponseContent( global::Braintrust.ViewType? viewType = default, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetViewAsResponseAsync( + objectType: objectType, + objectId: objectId, + limit: limit, + startingAfter: startingAfter, + endingBefore: endingBefore, + ids: ids, + viewName: viewName, + viewType: viewType, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List views
+ /// List out all views. The views are sorted by creation date, with the most recently-created views coming first + ///
+ /// + /// Limit the number of objects to return + /// + /// + /// Pagination cursor id.
+ /// For example, if the final item in the last page you fetched had an id of `foo`, pass `starting_after=foo` to fetch the next page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Pagination cursor id.
+ /// For example, if the initial item in the last page you fetched had an id of `foo`, pass `ending_before=foo` to fetch the previous page. Note: you may only pass one of `starting_after` and `ending_before` + /// + /// + /// Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times + /// + /// + /// Name of the view to search for + /// + /// + /// Type of object that the view corresponds to. + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// 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> GetViewAsResponseAsync( + global::Braintrust.AclObjectType objectType, + global::System.Guid objectId, + int? limit = default, + global::System.Guid? startingAfter = default, + global::System.Guid? endingBefore = default, + global::Braintrust.Ids? ids = default, + string? viewName = default, + global::Braintrust.ViewType? viewType = default, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -144,9 +204,10 @@ partial void ProcessGetViewResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/view", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("starting_after", startingAfter?.ToString()) @@ -155,7 +216,7 @@ partial void ProcessGetViewResponseContent( .AddOptionalParameter("view_name", viewName) .AddOptionalParameter("view_type", viewType?.ToValueString()) .AddRequiredParameter("object_type", objectType.ToValueString()) - .AddRequiredParameter("object_id", objectId.ToString()!) + .AddRequiredParameter("object_id", objectId.ToString()!) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -234,6 +295,8 @@ partial void ProcessGetViewResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -244,6 +307,11 @@ partial void ProcessGetViewResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -261,6 +329,8 @@ partial void ProcessGetViewResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -270,8 +340,7 @@ partial void ProcessGetViewResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +349,11 @@ partial void ProcessGetViewResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -296,14 +370,15 @@ partial void ProcessGetViewResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -343,6 +418,8 @@ partial void ProcessGetViewResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -363,6 +440,8 @@ partial void ProcessGetViewResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -577,9 +656,13 @@ partial void ProcessGetViewResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.GetViewResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.GetViewResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -607,9 +690,13 @@ partial void ProcessGetViewResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.GetViewResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.GetViewResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs index 0aa227d..39ec060 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs @@ -76,6 +76,39 @@ partial void ProcessGetViewIdResponseContent( global::System.Guid objectId, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetViewIdAsResponseAsync( + viewId: viewId, + objectType: objectType, + objectId: objectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get view
+ /// Get a view object by its id + ///
+ /// + /// View id + /// + /// + /// The object type that the ACL applies to + /// + /// + /// The id of the object the ACL applies to + /// + /// 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> GetViewIdAsResponseAsync( + global::System.Guid viewId, + global::Braintrust.AclObjectType objectType, + global::System.Guid objectId, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -107,12 +140,13 @@ partial void ProcessGetViewIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/view/{viewId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddRequiredParameter("object_type", objectType.ToValueString()) - .AddRequiredParameter("object_id", objectId.ToString()!) + .AddRequiredParameter("object_id", objectId.ToString()!) ; var __path = __pathBuilder.ToString(); __path = global::Braintrust.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -186,6 +220,8 @@ partial void ProcessGetViewIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +232,11 @@ partial void ProcessGetViewIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +254,8 @@ partial void ProcessGetViewIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +265,7 @@ partial void ProcessGetViewIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +274,11 @@ partial void ProcessGetViewIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +295,15 @@ partial void ProcessGetViewIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +343,8 @@ partial void ProcessGetViewIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +365,8 @@ partial void ProcessGetViewIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -529,9 +581,13 @@ partial void ProcessGetViewIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -559,9 +615,13 @@ partial void ProcessGetViewIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs index 596c423..81d4779 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs @@ -66,6 +66,34 @@ partial void ProcessPatchViewIdResponseContent( public async global::System.Threading.Tasks.Task PatchViewIdAsync( global::System.Guid viewId, + global::Braintrust.PatchView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchViewIdAsResponseAsync( + viewId: viewId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Partially update view
+ /// Partially update a view object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null. + ///
+ /// + /// View id + /// + /// + /// 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> PatchViewIdAsResponseAsync( + global::System.Guid viewId, + global::Braintrust.PatchView request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +129,7 @@ partial void ProcessPatchViewIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: $"/v1/view/{viewId}", baseUri: HttpClient.BaseAddress); @@ -181,6 +210,8 @@ partial void ProcessPatchViewIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +222,11 @@ partial void ProcessPatchViewIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +244,8 @@ partial void ProcessPatchViewIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +255,7 @@ partial void ProcessPatchViewIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +264,11 @@ partial void ProcessPatchViewIdResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +285,15 @@ partial void ProcessPatchViewIdResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +333,8 @@ partial void ProcessPatchViewIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +355,8 @@ partial void ProcessPatchViewIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -524,9 +571,13 @@ partial void ProcessPatchViewIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -554,9 +605,13 @@ partial void ProcessPatchViewIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs index bd20038..245c11d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs @@ -60,6 +60,29 @@ partial void ProcessPostViewResponseContent( /// public async global::System.Threading.Tasks.Task PostViewAsync( + global::Braintrust.CreateView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PostViewAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create view
+ /// Create a new view. If there is an existing view with the same name as the one specified in the request, will return the existing view unmodified + ///
+ /// + /// 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> PostViewAsResponseAsync( + global::Braintrust.CreateView request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPostViewResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/view", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPostViewResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPostViewResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPostViewResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPostViewResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPostViewResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPostViewResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPostViewResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPostViewResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPostViewResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPostViewResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs index 4e275ed..30744fb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs @@ -60,6 +60,29 @@ partial void ProcessPutViewResponseContent( /// public async global::System.Threading.Tasks.Task PutViewAsync( + global::Braintrust.CreateView request, + global::Braintrust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PutViewAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create or replace view
+ /// Create or replace view. If there is an existing view with the same name as the one specified in the request, will replace the existing view with the provided fields + ///
+ /// + /// 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> PutViewAsResponseAsync( + global::Braintrust.CreateView request, global::Braintrust.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -94,6 +117,7 @@ partial void ProcessPutViewResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Braintrust.PathBuilder( path: "/v1/view", baseUri: HttpClient.BaseAddress); @@ -173,6 +197,8 @@ partial void ProcessPutViewResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +209,11 @@ partial void ProcessPutViewResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +231,8 @@ partial void ProcessPutViewResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +242,7 @@ partial void ProcessPutViewResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +251,11 @@ partial void ProcessPutViewResponseContent( __attempt < __maxAttempts && global::Braintrust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Braintrust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Braintrust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Braintrust.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +272,15 @@ partial void ProcessPutViewResponseContent( 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::Braintrust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +320,8 @@ partial void ProcessPutViewResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +342,8 @@ partial void ProcessPutViewResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // The request was unacceptable, often due to missing a required parameter @@ -516,9 +558,13 @@ partial void ProcessPutViewResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Braintrust.View.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -546,9 +592,13 @@ partial void ProcessPutViewResponseContent( #endif ).ConfigureAwait(false); - return - await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Braintrust.View.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Braintrust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.g.cs index 164e8fb..62ed04a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.g.cs @@ -72,10 +72,10 @@ public ViewsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ViewsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Braintrust.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Braintrust.AutoSDKClientOptions? options, bool disposeHttpClient = true) {