Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,29 @@ partial void ProcessAclBatchUpdateResponseContent(
/// <exception cref="global::Braintrust.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Braintrust.AclBatchUpdateResponse> 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;
}
/// <summary>
/// Batch update acls<br/>
/// 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.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Braintrust.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Braintrust.AutoSDKHttpResponse<global::Braintrust.AclBatchUpdateResponse>> AclBatchUpdateAsResponseAsync(

global::Braintrust.AclBatchUpdateRequest request,
global::Braintrust.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
{
Expand All @@ -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,
Expand All @@ -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)
{
Expand All @@ -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;
}
Expand All @@ -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(
Expand All @@ -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;
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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<global::Braintrust.AclBatchUpdateResponse>(
statusCode: __response.StatusCode,
headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down Expand Up @@ -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<global::Braintrust.AclBatchUpdateResponse>(
statusCode: __response.StatusCode,
headers: global::Braintrust.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down
Loading