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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
public async global::System.Threading.Tasks.Task<global::Weave.AnnotationQueueAddCallsRes> AnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostAsync(
string queueId,

global::Weave.AnnotationQueueAddCallsBody request,
global::Weave.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __response = await AnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostAsResponseAsync(
queueId: queueId,

request: request,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);

return __response.Body;
}
/// <summary>
/// Annotation Queue Add Calls<br/>
/// Add calls to an annotation queue.
/// </summary>
/// <param name="queueId"></param>
/// <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::Weave.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Weave.AutoSDKHttpResponse<global::Weave.AnnotationQueueAddCallsRes>> AnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostAsResponseAsync(
string queueId,

global::Weave.AnnotationQueueAddCallsBody request,
global::Weave.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -90,6 +116,7 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo

global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{

var __pathBuilder = new global::Weave.PathBuilder(
path: $"/annotation_queues/{queueId}/items",
baseUri: HttpClient.BaseAddress);
Expand Down Expand Up @@ -170,6 +197,8 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
Expand All @@ -180,6 +209,11 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
var __retryDelay = global::Weave.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: null,
attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Weave.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
Expand All @@ -197,6 +231,8 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
Expand All @@ -206,8 +242,7 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
__httpRequest.Dispose();
__httpRequest = null;
await global::Weave.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand All @@ -216,6 +251,11 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
__attempt < __maxAttempts &&
global::Weave.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
var __retryDelay = global::Weave.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: __response,
attempt: __attempt);
await global::Weave.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Weave.AutoSDKRequestOptionsSupport.CreateHookContext(
Expand All @@ -232,14 +272,15 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
retryDelay: __retryDelay,
retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Weave.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand Down Expand Up @@ -279,6 +320,8 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
Expand All @@ -299,6 +342,8 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
Expand Down Expand Up @@ -361,9 +406,13 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
{
__response.EnsureSuccessStatusCode();

return
global::Weave.AnnotationQueueAddCallsRes.FromJson(__content, JsonSerializerContext) ??
var __value = global::Weave.AnnotationQueueAddCallsRes.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return new global::Weave.AutoSDKHttpResponse<global::Weave.AnnotationQueueAddCallsRes>(
statusCode: __response.StatusCode,
headers: global::Weave.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down Expand Up @@ -391,9 +440,13 @@ partial void ProcessAnnotationQueueAddCallsAnnotationQueuesQueueIdItemsPostRespo
#endif
).ConfigureAwait(false);

return
await global::Weave.AnnotationQueueAddCallsRes.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
var __value = await global::Weave.AnnotationQueueAddCallsRes.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
return new global::Weave.AutoSDKHttpResponse<global::Weave.AnnotationQueueAddCallsRes>(
statusCode: __response.StatusCode,
headers: global::Weave.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri,
body: __value);
}
catch (global::System.Exception __ex)
{
Expand Down
Loading