From cf8ce6b3cb89f0cf2bfab5f78f2c47d3fc8fd0e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 May 2026 13:02:34 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../ScaleAI.AutoSDKHttpResponse.g.cs | 121 ++ .../ScaleAI.IScaleAIClient.AddTaskTags.g.cs | 15 + ...caleAI.IScaleAIClient.AssignTeammates.g.cs | 13 + .../ScaleAI.IScaleAIClient.CancelTask.g.cs | 14 + .../ScaleAI.IScaleAIClient.CreateBatch.g.cs | 13 + .../ScaleAI.IScaleAIClient.CreateProject.g.cs | 13 + ...eAI.IScaleAIClient.CreateProjectGroup.g.cs | 15 + .../ScaleAI.IScaleAIClient.CreateTask.g.cs | 13 + ...caleAIClient.CreateTextCollectionTask.g.cs | 13 + ...ScaleAI.IScaleAIClient.DeleteTaskTags.g.cs | 15 + ...eAI.IScaleAIClient.DeleteTaskUniqueId.g.cs | 12 + .../ScaleAI.IScaleAIClient.FinalizeBatch.g.cs | 12 + .../ScaleAI.IScaleAIClient.GetBatch.g.cs | 12 + ...ScaleAI.IScaleAIClient.GetBatchStatus.g.cs | 12 + .../ScaleAI.IScaleAIClient.GetProject.g.cs | 12 + .../ScaleAI.IScaleAIClient.GetTask.g.cs | 12 + .../ScaleAI.IScaleAIClient.ImportFile.g.cs | 13 + ...leAI.IScaleAIClient.InviteTeamMembers.g.cs | 13 + ...caleAI.IScaleAIClient.ListAssignments.g.cs | 10 + .../ScaleAI.IScaleAIClient.ListBatches.g.cs | 24 + ...leAI.IScaleAIClient.ListProjectGroups.g.cs | 12 + .../ScaleAI.IScaleAIClient.ListProjects.g.cs | 12 + ...leAI.IScaleAIClient.ListStudioBatches.g.cs | 10 + .../ScaleAI.IScaleAIClient.ListTasks.g.cs | 38 + ...caleAI.IScaleAIClient.ListTeamMembers.g.cs | 10 + ...I.IScaleAIClient.ListTrainingAttempts.g.cs | 18 + ...caleAI.IScaleAIClient.PrioritizeBatch.g.cs | 15 + ...leAIClient.ResetStudioBatchPriorities.g.cs | 13 + ...caleAIClient.SetStudioBatchPriorities.g.cs | 13 + ...caleAI.IScaleAIClient.SetTaskMetadata.g.cs | 15 + ...leAI.IScaleAIClient.UnassignTeammates.g.cs | 13 + ...AI.IScaleAIClient.UpdateProjectParams.g.cs | 15 + ...eAI.IScaleAIClient.UpdateTaskUniqueId.g.cs | 15 + ...ScaleAI.IScaleAIClient.UpdateTeamRole.g.cs | 13 + .../ScaleAI.IScaleAIClient.UploadFile.g.cs | 82 ++ .../Generated/ScaleAI.OptionsSupport.g.cs | 231 +++- .../ScaleAI.ScaleAIClient.AddTaskTags.g.cs | 69 +- ...ScaleAI.ScaleAIClient.AssignTeammates.g.cs | 62 +- .../ScaleAI.ScaleAIClient.CancelTask.g.cs | 71 +- .../ScaleAI.ScaleAIClient.CreateBatch.g.cs | 66 +- .../ScaleAI.ScaleAIClient.CreateProject.g.cs | 66 +- ...leAI.ScaleAIClient.CreateProjectGroup.g.cs | 65 +- .../ScaleAI.ScaleAIClient.CreateTask.g.cs | 66 +- ...caleAIClient.CreateTextCollectionTask.g.cs | 66 +- .../ScaleAI.ScaleAIClient.DeleteTaskTags.g.cs | 69 +- ...leAI.ScaleAIClient.DeleteTaskUniqueId.g.cs | 64 +- .../ScaleAI.ScaleAIClient.FinalizeBatch.g.cs | 64 +- .../ScaleAI.ScaleAIClient.GetBatch.g.cs | 64 +- .../ScaleAI.ScaleAIClient.GetBatchStatus.g.cs | 64 +- .../ScaleAI.ScaleAIClient.GetProject.g.cs | 64 +- .../ScaleAI.ScaleAIClient.GetTask.g.cs | 64 +- .../ScaleAI.ScaleAIClient.ImportFile.g.cs | 66 +- ...aleAI.ScaleAIClient.InviteTeamMembers.g.cs | 66 +- ...ScaleAI.ScaleAIClient.ListAssignments.g.cs | 57 +- .../ScaleAI.ScaleAIClient.ListBatches.g.cs | 86 +- ...aleAI.ScaleAIClient.ListProjectGroups.g.cs | 60 +- .../ScaleAI.ScaleAIClient.ListProjects.g.cs | 68 +- ...aleAI.ScaleAIClient.ListStudioBatches.g.cs | 57 +- .../ScaleAI.ScaleAIClient.ListTasks.g.cs | 107 +- ...ScaleAI.ScaleAIClient.ListTeamMembers.g.cs | 61 +- ...AI.ScaleAIClient.ListTrainingAttempts.g.cs | 73 +- ...ScaleAI.ScaleAIClient.PrioritizeBatch.g.cs | 69 +- ...leAIClient.ResetStudioBatchPriorities.g.cs | 62 +- ...caleAIClient.SetStudioBatchPriorities.g.cs | 62 +- ...ScaleAI.ScaleAIClient.SetTaskMetadata.g.cs | 69 +- ...aleAI.ScaleAIClient.UnassignTeammates.g.cs | 62 +- ...eAI.ScaleAIClient.UpdateProjectParams.g.cs | 69 +- ...leAI.ScaleAIClient.UpdateTaskUniqueId.g.cs | 69 +- .../ScaleAI.ScaleAIClient.UpdateTeamRole.g.cs | 66 +- .../ScaleAI.ScaleAIClient.UploadFile.g.cs | 1019 ++++++++++++++++- .../Generated/ScaleAI.ScaleAIClient.g.cs | 8 +- 71 files changed, 3864 insertions(+), 278 deletions(-) create mode 100644 src/libs/ScaleAI/Generated/ScaleAI.AutoSDKHttpResponse.g.cs diff --git a/src/libs/ScaleAI/Generated/ScaleAI.AutoSDKHttpResponse.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..a7166f6 --- /dev/null +++ b/src/libs/ScaleAI/Generated/ScaleAI.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace ScaleAI +{ + /// + /// 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/ScaleAI/Generated/ScaleAI.IScaleAIClient.AddTaskTags.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AddTaskTags.g.cs index 5517fd9..a7c7ea6 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AddTaskTags.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AddTaskTags.g.cs @@ -16,6 +16,21 @@ public partial interface IScaleAIClient global::System.Threading.Tasks.Task AddTaskTagsAsync( string taskId, + global::System.Collections.Generic.IList request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add tags to a task
+ /// Add tags to a task. Tags are used for organizing and filtering tasks. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AddTaskTagsAsResponseAsync( + string taskId, + global::System.Collections.Generic.IList request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AssignTeammates.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AssignTeammates.g.cs index 29ba120..b32ccbf 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AssignTeammates.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.AssignTeammates.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Assign teammates to projects
/// Assign team members to Studio projects. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AssignTeammatesAsResponseAsync( + + global::ScaleAI.AssignTeamRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Assign teammates to projects
+ /// Assign team members to Studio projects. + ///
/// /// Email addresses of teammates. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CancelTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CancelTask.g.cs index 6c897a4..8ef7b2c 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CancelTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CancelTask.g.cs @@ -18,5 +18,19 @@ public partial interface IScaleAIClient bool? clearUniqueId = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel a task
+ /// Cancel a pending task. Completed tasks cannot be canceled. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelTaskAsResponseAsync( + string taskId, + bool? clearUniqueId = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateBatch.g.cs index 7093a50..ab59708 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateBatch.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Create a batch
/// Create a new batch within a project for grouping tasks. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateBatchAsResponseAsync( + + global::ScaleAI.CreateBatchRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a batch
+ /// Create a new batch within a project for grouping tasks. + ///
/// /// Project name to create this batch in. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProject.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProject.g.cs index 163c228..bd07b0a 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProject.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProject.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Create a project
/// Create a new project for organizing tasks and batches. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateProjectAsResponseAsync( + + global::ScaleAI.CreateProjectRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a project
+ /// Create a new project for organizing tasks and batches. + ///
/// /// Task type: imageannotation, textcollection, namedentityrecognition, etc. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProjectGroup.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProjectGroup.g.cs index c0f638d..b7b4a3e 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProjectGroup.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateProjectGroup.g.cs @@ -24,6 +24,21 @@ public partial interface IScaleAIClient /// Create a new group within a Studio project. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateProjectGroupAsResponseAsync( + string projectName, + + object request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a project group
+ /// Create a new group within a Studio project. + ///
+ /// /// 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/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTask.g.cs index 497f6bc..d58be34 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTask.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Create a task
/// Create a new labeling task. Each task represents an individual unit of work for a labeler. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateTaskAsResponseAsync( + + global::ScaleAI.CreateTaskRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a task
+ /// Create a new labeling task. Each task represents an individual unit of work for a labeler. + ///
/// /// Project name to create this task in. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTextCollectionTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTextCollectionTask.g.cs index 53d3983..c110066 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTextCollectionTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.CreateTextCollectionTask.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Create a text collection task
/// Create a GenAI text collection task for data collection, RLHF, or evaluation workflows. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateTextCollectionTaskAsResponseAsync( + + global::ScaleAI.CreateTextCollectionTaskRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a text collection task
+ /// Create a GenAI text collection task for data collection, RLHF, or evaluation workflows. + ///
/// /// Project name. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskTags.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskTags.g.cs index b228cbe..c5abba2 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskTags.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskTags.g.cs @@ -16,6 +16,21 @@ public partial interface IScaleAIClient global::System.Threading.Tasks.Task DeleteTaskTagsAsync( string taskId, + global::System.Collections.Generic.IList request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Remove tags from a task
+ /// Remove specific tags from a task. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteTaskTagsAsResponseAsync( + string taskId, + global::System.Collections.Generic.IList request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskUniqueId.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskUniqueId.g.cs index 87c92fa..f03a321 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskUniqueId.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.DeleteTaskUniqueId.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string taskId, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete task unique_id
+ /// Remove the unique_id from a task. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteTaskUniqueIdAsResponseAsync( + string taskId, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.FinalizeBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.FinalizeBatch.g.cs index 113bc9d..64a96a4 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.FinalizeBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.FinalizeBatch.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string batchName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Finalize a batch
+ /// Finalize a batch to indicate no more tasks will be added and begin processing. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FinalizeBatchAsResponseAsync( + string batchName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatch.g.cs index 2dc097b..1287f03 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatch.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string batchName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve a batch
+ /// Get details of a specific batch by name. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetBatchAsResponseAsync( + string batchName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatchStatus.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatchStatus.g.cs index 1ec001e..e6d8378 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatchStatus.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetBatchStatus.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string batchName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get batch status
+ /// Get the status of a batch with task counts grouped by status. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetBatchStatusAsResponseAsync( + string batchName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetProject.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetProject.g.cs index 50b1c8f..da1ed9a 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetProject.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetProject.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string projectName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve a project
+ /// Get details of a specific project by name. + ///
+ /// + /// Per-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( + string projectName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetTask.g.cs index 9fcb787..bf4523b 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.GetTask.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string taskId, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve a task
+ /// Get details of a specific task by 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> GetTaskAsResponseAsync( + string taskId, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ImportFile.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ImportFile.g.cs index 20ce956..e1d6e3b 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ImportFile.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ImportFile.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Import a file from URL
/// Import a file from a URL for use as task attachments. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImportFileAsResponseAsync( + + global::ScaleAI.ImportFileRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Import a file from URL
+ /// Import a file from a URL for use as task attachments. + ///
/// /// URL of the file to import. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.InviteTeamMembers.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.InviteTeamMembers.g.cs index 6dc28ce..e725cfb 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.InviteTeamMembers.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.InviteTeamMembers.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Invite teammates
/// Invite new teammates to your Scale account by email. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> InviteTeamMembersAsResponseAsync( + + global::ScaleAI.InviteTeamRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Invite teammates
+ /// Invite new teammates to your Scale account by email. + ///
/// /// Email addresses to invite. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListAssignments.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListAssignments.g.cs index d292b4b..065155f 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListAssignments.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListAssignments.g.cs @@ -14,5 +14,15 @@ public partial interface IScaleAIClient global::System.Threading.Tasks.Task ListAssignmentsAsync( global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all assignments
+ /// Get a list of all Studio project assignments. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListAssignmentsAsResponseAsync( + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListBatches.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListBatches.g.cs index a0e40b4..e48fdcc 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListBatches.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListBatches.g.cs @@ -28,5 +28,29 @@ public partial interface IScaleAIClient int? offset = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all batches
+ /// Returns a paginated list of all batches, optionally filtered by project or status. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListBatchesAsResponseAsync( + string? project = default, + global::ScaleAI.ListBatchesStatus? status = default, + bool? detailed = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + int? limit = default, + int? offset = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjectGroups.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjectGroups.g.cs index 7a22d31..5bcb6b5 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjectGroups.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjectGroups.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient string projectName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List project groups
+ /// Get a list of all groups within a Studio project. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListProjectGroupsAsResponseAsync( + string projectName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjects.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjects.g.cs index 331e70a..15a3ace 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjects.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListProjects.g.cs @@ -16,5 +16,17 @@ public partial interface IScaleAIClient bool? archived = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all projects
+ /// Returns a list of all projects in your account. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListProjectsAsResponseAsync( + bool? archived = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListStudioBatches.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListStudioBatches.g.cs index 67aa508..616128a 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListStudioBatches.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListStudioBatches.g.cs @@ -14,5 +14,15 @@ public partial interface IScaleAIClient global::System.Threading.Tasks.Task ListStudioBatchesAsync( global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Studio batches
+ /// Get a list of all Studio batches. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListStudioBatchesAsResponseAsync( + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTasks.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTasks.g.cs index c104f2c..7934f81 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTasks.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTasks.g.cs @@ -42,5 +42,43 @@ public partial interface IScaleAIClient string? nextToken = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List tasks
+ /// Returns a paginated list of tasks with optional filtering by project, batch, status, and time range. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTasksAsResponseAsync( + string? project = default, + string? batch = default, + global::ScaleAI.ListTasksStatus? status = default, + string? type = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + global::System.DateTime? completedAfter = default, + global::System.DateTime? completedBefore = default, + global::ScaleAI.ListTasksCustomerReviewStatus? customerReviewStatus = default, + int? limit = default, + string? uniqueId = default, + string? tags = default, + bool? includeAttachmentUrl = default, + string? nextToken = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTeamMembers.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTeamMembers.g.cs index 07ee09a..4207010 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTeamMembers.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTeamMembers.g.cs @@ -14,5 +14,15 @@ public partial interface IScaleAIClient global::System.Threading.Tasks.Task> ListTeamMembersAsync( global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List all teammates
+ /// Get a list of all team members in your Scale account. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListTeamMembersAsResponseAsync( + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTrainingAttempts.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTrainingAttempts.g.cs index a2466f2..e9d2a20 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTrainingAttempts.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ListTrainingAttempts.g.cs @@ -22,5 +22,23 @@ public partial interface IScaleAIClient int? limit = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List training attempts
+ /// Get a list of labeler training attempts for quality management. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListTrainingAttemptsAsResponseAsync( + global::System.Collections.Generic.IList? qualityTaskIds = default, + global::System.Collections.Generic.IList? labelerEmails = default, + string? nextToken = default, + int? limit = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.PrioritizeBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.PrioritizeBatch.g.cs index 404b897..9fab4ff 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.PrioritizeBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.PrioritizeBatch.g.cs @@ -24,6 +24,21 @@ public partial interface IScaleAIClient /// Set the priority of a batch. Higher priority batches are processed first. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PrioritizeBatchAsResponseAsync( + string batchName, + + global::ScaleAI.BatchPrioritizeRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set batch priority
+ /// Set the priority of a batch. Higher priority batches are processed first. + ///
+ /// /// /// Priority value between 10 (lowest) and 30 (highest). /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ResetStudioBatchPriorities.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ResetStudioBatchPriorities.g.cs index e5461db..b21e7dc 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ResetStudioBatchPriorities.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.ResetStudioBatchPriorities.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Reset Studio batch priorities
/// Reset all Studio batch priorities to defaults. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ResetStudioBatchPrioritiesAsResponseAsync( + + object request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reset Studio batch priorities
+ /// Reset all Studio batch priorities to defaults. + ///
/// 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/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetStudioBatchPriorities.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetStudioBatchPriorities.g.cs index d4d4733..2a0485a 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetStudioBatchPriorities.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetStudioBatchPriorities.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Set Studio batch priorities
/// Set the priorities of Studio batches. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SetStudioBatchPrioritiesAsResponseAsync( + + object request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set Studio batch priorities
+ /// Set the priorities of Studio batches. + ///
/// 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/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetTaskMetadata.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetTaskMetadata.g.cs index 1a53046..876a246 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetTaskMetadata.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.SetTaskMetadata.g.cs @@ -24,6 +24,21 @@ public partial interface IScaleAIClient /// Set custom key-value metadata on a task. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SetTaskMetadataAsResponseAsync( + string taskId, + + global::ScaleAI.SetMetadataRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set task metadata
+ /// Set custom key-value metadata on a task. + ///
+ /// /// 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/ScaleAI/Generated/ScaleAI.IScaleAIClient.UnassignTeammates.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UnassignTeammates.g.cs index 5fec79e..a8523b8 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UnassignTeammates.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UnassignTeammates.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Unassign teammates from projects
/// Remove team members from Studio project assignments. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UnassignTeammatesAsResponseAsync( + + global::ScaleAI.UnassignTeamRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unassign teammates from projects
+ /// Remove team members from Studio project assignments. + ///
/// /// Email addresses of teammates. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateProjectParams.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateProjectParams.g.cs index 6ec03de..b4746c4 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateProjectParams.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateProjectParams.g.cs @@ -24,6 +24,21 @@ public partial interface IScaleAIClient /// Update default parameters for a project. Creates a new version in param_history. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateProjectParamsAsResponseAsync( + string projectName, + + global::ScaleAI.UpdateProjectParamsRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update project parameters
+ /// Update default parameters for a project. Creates a new version in param_history. + ///
+ /// /// /// If true, merge with existing params instead of replacing. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTaskUniqueId.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTaskUniqueId.g.cs index 1bf6f2d..1ee265c 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTaskUniqueId.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTaskUniqueId.g.cs @@ -24,6 +24,21 @@ public partial interface IScaleAIClient /// Update the unique_id of a task. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateTaskUniqueIdAsResponseAsync( + string taskId, + + global::ScaleAI.UpdateUniqueIdRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update task unique_id
+ /// Update the unique_id of a task. + ///
+ /// /// /// New unique_id value. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTeamRole.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTeamRole.g.cs index 531146d..54a1850 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTeamRole.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UpdateTeamRole.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Update teammate role
/// Update the role of existing team members. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> UpdateTeamRoleAsResponseAsync( + + global::ScaleAI.SetRoleRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update teammate role
+ /// Update the role of existing team members. + ///
/// /// Email addresses to update. /// diff --git a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UploadFile.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UploadFile.g.cs index 64307a5..b1d1454 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UploadFile.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.IScaleAIClient.UploadFile.g.cs @@ -21,6 +21,19 @@ public partial interface IScaleAIClient /// Upload a file
/// Upload a local file for use as task attachments. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadFileAsResponseAsync( + + global::ScaleAI.UploadFileRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a file
+ /// Upload a local file for use as task attachments. + ///
/// /// The file to upload. /// @@ -51,5 +64,74 @@ public partial interface IScaleAIClient string? metadata = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload a file
+ /// Upload a local file for use as task attachments. + ///
+ /// + /// The file to upload. + /// + /// + /// The file to upload. + /// + /// + /// Human-readable file name. + /// + /// + /// Project to associate the file with. + /// + /// + /// Unique upload identifier for idempotency. + /// + /// + /// JSON string of additional metadata. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UploadFileAsync( + global::System.IO.Stream file, + string filename, + string? displayName = default, + string? projectName = default, + string? referenceId = default, + string? metadata = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload a file
+ /// Upload a local file for use as task attachments. + ///
+ /// + /// The file to upload. + /// + /// + /// The file to upload. + /// + /// + /// Human-readable file name. + /// + /// + /// Project to associate the file with. + /// + /// + /// Unique upload identifier for idempotency. + /// + /// + /// JSON string of additional metadata. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadFileAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? displayName = default, + string? projectName = default, + string? referenceId = default, + string? metadata = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.OptionsSupport.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.OptionsSupport.g.cs index 7b2f5d6..7f6ca22 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.OptionsSupport.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.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::ScaleAI.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::ScaleAI.AutoSDKClientOptions clientOptions, global::ScaleAI.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::ScaleAI.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::ScaleAI.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/ScaleAI/Generated/ScaleAI.ScaleAIClient.AddTaskTags.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AddTaskTags.g.cs index ff6bd14..dc88e8b 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AddTaskTags.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AddTaskTags.g.cs @@ -55,6 +55,32 @@ partial void ProcessAddTaskTagsResponseContent( public async global::System.Threading.Tasks.Task AddTaskTagsAsync( string taskId, + global::System.Collections.Generic.IList request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddTaskTagsAsResponseAsync( + taskId: taskId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add tags to a task
+ /// Add tags to a task. Tags are used for organizing and filtering tasks. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AddTaskTagsAsResponseAsync( + string taskId, + global::System.Collections.Generic.IList request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessAddTaskTagsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}/tags", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessAddTaskTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessAddTaskTagsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessAddTaskTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessAddTaskTagsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessAddTaskTagsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessAddTaskTagsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessAddTaskTagsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessAddTaskTagsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessAddTaskTagsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +402,13 @@ partial void ProcessAddTaskTagsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AssignTeammates.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AssignTeammates.g.cs index 803aed0..cce534d 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AssignTeammates.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AssignTeammates.g.cs @@ -51,6 +51,29 @@ partial void ProcessAssignTeammatesResponseContent( /// public async global::System.Threading.Tasks.Task AssignTeammatesAsync( + global::ScaleAI.AssignTeamRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AssignTeammatesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Assign teammates to projects
+ /// Assign team members to Studio projects. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AssignTeammatesAsResponseAsync( + global::ScaleAI.AssignTeamRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessAssignTeammatesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/studio/assignments/add", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessAssignTeammatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessAssignTeammatesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessAssignTeammatesResponseContent( 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 ProcessAssignTeammatesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessAssignTeammatesResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessAssignTeammatesResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessAssignTeammatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessAssignTeammatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,7 +359,11 @@ partial void ProcessAssignTeammatesResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -345,7 +391,11 @@ partial void ProcessAssignTeammatesResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CancelTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CancelTask.g.cs index 5a9bb7f..3e6d4b6 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CancelTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CancelTask.g.cs @@ -57,6 +57,30 @@ partial void ProcessCancelTaskResponseContent( bool? clearUniqueId = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelTaskAsResponseAsync( + taskId: taskId, + clearUniqueId: clearUniqueId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel a task
+ /// Cancel a pending task. Completed tasks cannot be canceled. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CancelTaskAsResponseAsync( + string taskId, + bool? clearUniqueId = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -87,11 +111,12 @@ partial void ProcessCancelTaskResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}/cancel", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("clear_unique_id", clearUniqueId?.ToString().ToLowerInvariant()) + .AddOptionalParameter("clear_unique_id", clearUniqueId?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -164,6 +189,8 @@ partial void ProcessCancelTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +201,11 @@ partial void ProcessCancelTaskResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +223,8 @@ partial void ProcessCancelTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +234,7 @@ partial void ProcessCancelTaskResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +243,11 @@ partial void ProcessCancelTaskResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +264,15 @@ partial void ProcessCancelTaskResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +312,8 @@ partial void ProcessCancelTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +334,8 @@ partial void ProcessCancelTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +360,13 @@ partial void ProcessCancelTaskResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +394,13 @@ partial void ProcessCancelTaskResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateBatch.g.cs index c52f8b8..45cf86b 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateBatch.g.cs @@ -51,6 +51,29 @@ partial void ProcessCreateBatchResponseContent( /// public async global::System.Threading.Tasks.Task CreateBatchAsync( + global::ScaleAI.CreateBatchRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateBatchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a batch
+ /// Create a new batch within a project for grouping tasks. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateBatchAsResponseAsync( + global::ScaleAI.CreateBatchRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessCreateBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/batches", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessCreateBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessCreateBatchResponseContent( 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 ProcessCreateBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessCreateBatchResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessCreateBatchResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessCreateBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Batch.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Batch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessCreateBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Batch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Batch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProject.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProject.g.cs index 8e8e083..57a3c46 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProject.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProject.g.cs @@ -51,6 +51,29 @@ partial void ProcessCreateProjectResponseContent( /// public async global::System.Threading.Tasks.Task CreateProjectAsync( + global::ScaleAI.CreateProjectRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateProjectAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a project
+ /// Create a new project for organizing tasks and batches. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateProjectAsResponseAsync( + global::ScaleAI.CreateProjectRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessCreateProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/projects", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessCreateProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessCreateProjectResponseContent( 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 ProcessCreateProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessCreateProjectResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessCreateProjectResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessCreateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessCreateProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessCreateProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProjectGroup.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProjectGroup.g.cs index 053a2da..25df004 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProjectGroup.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateProjectGroup.g.cs @@ -55,6 +55,32 @@ partial void ProcessCreateProjectGroupResponseContent( public async global::System.Threading.Tasks.Task CreateProjectGroupAsync( string projectName, + object request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateProjectGroupAsResponseAsync( + projectName: projectName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a project group
+ /// Create a new group within a Studio project. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateProjectGroupAsResponseAsync( + string projectName, + object request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessCreateProjectGroupResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/studio/projects/{projectName}/groups", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessCreateProjectGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessCreateProjectGroupResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessCreateProjectGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessCreateProjectGroupResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessCreateProjectGroupResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessCreateProjectGroupResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessCreateProjectGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessCreateProjectGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,7 +368,11 @@ partial void ProcessCreateProjectGroupResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -351,7 +400,11 @@ partial void ProcessCreateProjectGroupResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTask.g.cs index adfbb8a..5c25048 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTask.g.cs @@ -51,6 +51,29 @@ partial void ProcessCreateTaskResponseContent( /// public async global::System.Threading.Tasks.Task CreateTaskAsync( + global::ScaleAI.CreateTaskRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateTaskAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a task
+ /// Create a new labeling task. Each task represents an individual unit of work for a labeler. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateTaskAsResponseAsync( + global::ScaleAI.CreateTaskRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessCreateTaskResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/task", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessCreateTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessCreateTaskResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessCreateTaskResponseContent( 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 ProcessCreateTaskResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessCreateTaskResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessCreateTaskResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessCreateTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessCreateTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessCreateTaskResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessCreateTaskResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTextCollectionTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTextCollectionTask.g.cs index 3c9e69d..2727222 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTextCollectionTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateTextCollectionTask.g.cs @@ -51,6 +51,29 @@ partial void ProcessCreateTextCollectionTaskResponseContent( /// public async global::System.Threading.Tasks.Task CreateTextCollectionTaskAsync( + global::ScaleAI.CreateTextCollectionTaskRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateTextCollectionTaskAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a text collection task
+ /// Create a GenAI text collection task for data collection, RLHF, or evaluation workflows. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateTextCollectionTaskAsResponseAsync( + global::ScaleAI.CreateTextCollectionTaskRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessCreateTextCollectionTaskResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/task/textcollection", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessCreateTextCollectionTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessCreateTextCollectionTaskResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessCreateTextCollectionTaskResponseContent( 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 ProcessCreateTextCollectionTaskResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessCreateTextCollectionTaskResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessCreateTextCollectionTaskResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessCreateTextCollectionTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessCreateTextCollectionTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessCreateTextCollectionTaskResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessCreateTextCollectionTaskResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskTags.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskTags.g.cs index ad6ec6c..7b84b95 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskTags.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskTags.g.cs @@ -55,6 +55,32 @@ partial void ProcessDeleteTaskTagsResponseContent( public async global::System.Threading.Tasks.Task DeleteTaskTagsAsync( string taskId, + global::System.Collections.Generic.IList request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteTaskTagsAsResponseAsync( + taskId: taskId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Remove tags from a task
+ /// Remove specific tags from a task. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteTaskTagsAsResponseAsync( + string taskId, + global::System.Collections.Generic.IList request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessDeleteTaskTagsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}/tags", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessDeleteTaskTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessDeleteTaskTagsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessDeleteTaskTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessDeleteTaskTagsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessDeleteTaskTagsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessDeleteTaskTagsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessDeleteTaskTagsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessDeleteTaskTagsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessDeleteTaskTagsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +402,13 @@ partial void ProcessDeleteTaskTagsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskUniqueId.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskUniqueId.g.cs index 9630d31..2ca6f7b 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskUniqueId.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.DeleteTaskUniqueId.g.cs @@ -53,6 +53,27 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( string taskId, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteTaskUniqueIdAsResponseAsync( + taskId: taskId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete task unique_id
+ /// Remove the unique_id from a task. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteTaskUniqueIdAsResponseAsync( + string taskId, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}/unique_id", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessDeleteTaskUniqueIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.FinalizeBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.FinalizeBatch.g.cs index 3e9ba4e..e33f78d 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.FinalizeBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.FinalizeBatch.g.cs @@ -53,6 +53,27 @@ partial void ProcessFinalizeBatchResponseContent( string batchName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FinalizeBatchAsResponseAsync( + batchName: batchName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Finalize a batch
+ /// Finalize a batch to indicate no more tasks will be added and begin processing. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FinalizeBatchAsResponseAsync( + string batchName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessFinalizeBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/batches/{batchName}/finalize", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessFinalizeBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessFinalizeBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessFinalizeBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessFinalizeBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessFinalizeBatchResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessFinalizeBatchResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessFinalizeBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessFinalizeBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessFinalizeBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Batch.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Batch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessFinalizeBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Batch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Batch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatch.g.cs index cbbb41b..6e021c1 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatch.g.cs @@ -53,6 +53,27 @@ partial void ProcessGetBatchResponseContent( string batchName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetBatchAsResponseAsync( + batchName: batchName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve a batch
+ /// Get details of a specific batch by name. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetBatchAsResponseAsync( + string batchName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessGetBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/batches/{batchName}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessGetBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessGetBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessGetBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessGetBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessGetBatchResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessGetBatchResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessGetBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessGetBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessGetBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Batch.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Batch.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessGetBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Batch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Batch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatchStatus.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatchStatus.g.cs index 34f76e0..4dff02c 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatchStatus.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetBatchStatus.g.cs @@ -53,6 +53,27 @@ partial void ProcessGetBatchStatusResponseContent( string batchName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetBatchStatusAsResponseAsync( + batchName: batchName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get batch status
+ /// Get the status of a batch with task counts grouped by status. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetBatchStatusAsResponseAsync( + string batchName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessGetBatchStatusResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/batches/{batchName}/status", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessGetBatchStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessGetBatchStatusResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessGetBatchStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessGetBatchStatusResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessGetBatchStatusResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessGetBatchStatusResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessGetBatchStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessGetBatchStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessGetBatchStatusResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.BatchStatus2.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.BatchStatus2.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessGetBatchStatusResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.BatchStatus2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.BatchStatus2.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetProject.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetProject.g.cs index 542c147..d648a63 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetProject.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetProject.g.cs @@ -53,6 +53,27 @@ partial void ProcessGetProjectResponseContent( string projectName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetProjectAsResponseAsync( + projectName: projectName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve a project
+ /// Get details of a specific project by name. + ///
+ /// + /// Per-request overrides 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( + string projectName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessGetProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/projects/{projectName}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessGetProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,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) { @@ -191,8 +222,7 @@ partial void ProcessGetProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessGetProjectResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessGetProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessGetProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessGetProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetTask.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetTask.g.cs index 5f7afb6..f9d40c4 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetTask.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.GetTask.g.cs @@ -53,6 +53,27 @@ partial void ProcessGetTaskResponseContent( string taskId, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTaskAsResponseAsync( + taskId: taskId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve a task
+ /// Get details of a specific task by 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> GetTaskAsResponseAsync( + string taskId, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessGetTaskResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessGetTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessGetTaskResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessGetTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessGetTaskResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessGetTaskResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessGetTaskResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessGetTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessGetTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessGetTaskResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -338,9 +382,13 @@ partial void ProcessGetTaskResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ImportFile.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ImportFile.g.cs index 8747a23..4f6ca41 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ImportFile.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ImportFile.g.cs @@ -51,6 +51,29 @@ partial void ProcessImportFileResponseContent( /// public async global::System.Threading.Tasks.Task ImportFileAsync( + global::ScaleAI.ImportFileRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImportFileAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Import a file from URL
+ /// Import a file from a URL for use as task attachments. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImportFileAsResponseAsync( + global::ScaleAI.ImportFileRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessImportFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/files/import", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessImportFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessImportFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessImportFileResponseContent( 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 ProcessImportFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessImportFileResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessImportFileResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessImportFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessImportFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessImportFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessImportFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.FileUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.FileUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.InviteTeamMembers.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.InviteTeamMembers.g.cs index d5ac5f8..a176a13 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.InviteTeamMembers.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.InviteTeamMembers.g.cs @@ -51,6 +51,29 @@ partial void ProcessInviteTeamMembersResponseContent( /// public async global::System.Threading.Tasks.Task> InviteTeamMembersAsync( + global::ScaleAI.InviteTeamRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InviteTeamMembersAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Invite teammates
+ /// Invite new teammates to your Scale account by email. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> InviteTeamMembersAsResponseAsync( + global::ScaleAI.InviteTeamRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessInviteTeamMembersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/teams/invite", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessInviteTeamMembersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessInviteTeamMembersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessInviteTeamMembersResponseContent( 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 ProcessInviteTeamMembersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessInviteTeamMembersResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessInviteTeamMembersResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessInviteTeamMembersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessInviteTeamMembersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessInviteTeamMembersResponseContent( { __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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessInviteTeamMembersResponseContent( #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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListAssignments.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListAssignments.g.cs index 416c567..7af337b 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListAssignments.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListAssignments.g.cs @@ -49,6 +49,24 @@ partial void ProcessListAssignmentsResponseContent( public async global::System.Threading.Tasks.Task ListAssignmentsAsync( global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAssignmentsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all assignments
+ /// Get a list of all Studio project assignments. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListAssignmentsAsResponseAsync( + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -77,6 +95,7 @@ partial void ProcessListAssignmentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/studio/assignments", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessListAssignmentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessListAssignmentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +202,8 @@ partial void ProcessListAssignmentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +213,7 @@ partial void ProcessListAssignmentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +222,11 @@ partial void ProcessListAssignmentsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +243,15 @@ partial void ProcessListAssignmentsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +291,8 @@ partial void ProcessListAssignmentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessListAssignmentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -302,7 +339,11 @@ partial void ProcessListAssignmentsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -330,7 +371,11 @@ partial void ProcessListAssignmentsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListBatches.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListBatches.g.cs index 6cb7563..cc6e8fa 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListBatches.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListBatches.g.cs @@ -77,6 +77,45 @@ partial void ProcessListBatchesResponseContent( int? offset = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListBatchesAsResponseAsync( + project: project, + status: status, + detailed: detailed, + startTime: startTime, + endTime: endTime, + limit: limit, + offset: offset, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all batches
+ /// Returns a paginated list of all batches, optionally filtered by project or status. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListBatchesAsResponseAsync( + string? project = default, + global::ScaleAI.ListBatchesStatus? status = default, + bool? detailed = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + int? limit = default, + int? offset = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,9 +151,10 @@ partial void ProcessListBatchesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/batches", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("project", project) .AddOptionalParameter("status", status?.ToValueString()) @@ -122,7 +162,7 @@ partial void ProcessListBatchesResponseContent( .AddOptionalParameter("start_time", startTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("end_time", endTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("offset", offset?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -200,6 +240,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +252,11 @@ partial void ProcessListBatchesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +274,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +285,7 @@ partial void ProcessListBatchesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +294,11 @@ partial void ProcessListBatchesResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +315,15 @@ partial void ProcessListBatchesResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +363,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +385,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -353,9 +411,13 @@ partial void ProcessListBatchesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.BatchListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.BatchListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -383,9 +445,13 @@ partial void ProcessListBatchesResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.BatchListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.BatchListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjectGroups.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjectGroups.g.cs index b3dd4bb..e464753 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjectGroups.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjectGroups.g.cs @@ -53,6 +53,27 @@ partial void ProcessListProjectGroupsResponseContent( string projectName, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListProjectGroupsAsResponseAsync( + projectName: projectName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List project groups
+ /// Get a list of all groups within a Studio project. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListProjectGroupsAsResponseAsync( + string projectName, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessListProjectGroupsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/studio/projects/{projectName}/groups", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessListProjectGroupsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessListProjectGroupsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -182,6 +211,8 @@ partial void ProcessListProjectGroupsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -191,8 +222,7 @@ partial void ProcessListProjectGroupsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -201,6 +231,11 @@ partial void ProcessListProjectGroupsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -217,14 +252,15 @@ partial void ProcessListProjectGroupsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -264,6 +300,8 @@ partial void ProcessListProjectGroupsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessListProjectGroupsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,7 +348,11 @@ partial void ProcessListProjectGroupsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -336,7 +380,11 @@ partial void ProcessListProjectGroupsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjects.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjects.g.cs index 8c567e3..3859aac 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjects.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListProjects.g.cs @@ -53,6 +53,27 @@ partial void ProcessListProjectsResponseContent( bool? archived = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListProjectsAsResponseAsync( + archived: archived, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all projects
+ /// Returns a list of all projects in your account. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListProjectsAsResponseAsync( + bool? archived = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,11 +103,12 @@ partial void ProcessListProjectsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/projects", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("archived", archived?.ToString().ToLowerInvariant()) + .AddOptionalParameter("archived", archived?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -158,6 +180,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -168,6 +192,11 @@ partial void ProcessListProjectsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -185,6 +214,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -194,8 +225,7 @@ partial void ProcessListProjectsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -204,6 +234,11 @@ partial void ProcessListProjectsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -220,14 +255,15 @@ partial void ProcessListProjectsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -267,6 +303,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -287,6 +325,8 @@ partial void ProcessListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -311,9 +351,13 @@ partial void ProcessListProjectsResponseContent( { __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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -341,9 +385,13 @@ partial void ProcessListProjectsResponseContent( #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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListStudioBatches.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListStudioBatches.g.cs index b83fdce..75e5c02 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListStudioBatches.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListStudioBatches.g.cs @@ -49,6 +49,24 @@ partial void ProcessListStudioBatchesResponseContent( public async global::System.Threading.Tasks.Task ListStudioBatchesAsync( global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStudioBatchesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Studio batches
+ /// Get a list of all Studio batches. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListStudioBatchesAsResponseAsync( + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -77,6 +95,7 @@ partial void ProcessListStudioBatchesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/studio/batches", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessListStudioBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessListStudioBatchesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +202,8 @@ partial void ProcessListStudioBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +213,7 @@ partial void ProcessListStudioBatchesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +222,11 @@ partial void ProcessListStudioBatchesResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +243,15 @@ partial void ProcessListStudioBatchesResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +291,8 @@ partial void ProcessListStudioBatchesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessListStudioBatchesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -302,7 +339,11 @@ partial void ProcessListStudioBatchesResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -330,7 +371,11 @@ partial void ProcessListStudioBatchesResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTasks.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTasks.g.cs index c8f437c..22bba7a 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTasks.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTasks.g.cs @@ -105,6 +105,66 @@ partial void ProcessListTasksResponseContent( string? nextToken = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTasksAsResponseAsync( + project: project, + batch: batch, + status: status, + type: type, + startTime: startTime, + endTime: endTime, + completedAfter: completedAfter, + completedBefore: completedBefore, + customerReviewStatus: customerReviewStatus, + limit: limit, + uniqueId: uniqueId, + tags: tags, + includeAttachmentUrl: includeAttachmentUrl, + nextToken: nextToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List tasks
+ /// Returns a paginated list of tasks with optional filtering by project, batch, status, and time range. + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListTasksAsResponseAsync( + string? project = default, + string? batch = default, + global::ScaleAI.ListTasksStatus? status = default, + string? type = default, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + global::System.DateTime? completedAfter = default, + global::System.DateTime? completedBefore = default, + global::ScaleAI.ListTasksCustomerReviewStatus? customerReviewStatus = default, + int? limit = default, + string? uniqueId = default, + string? tags = default, + bool? includeAttachmentUrl = default, + string? nextToken = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -147,9 +207,10 @@ partial void ProcessListTasksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/tasks", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("project", project) .AddOptionalParameter("batch", batch) @@ -164,7 +225,7 @@ partial void ProcessListTasksResponseContent( .AddOptionalParameter("unique_id", uniqueId) .AddOptionalParameter("tags", tags) .AddOptionalParameter("include_attachment_url", includeAttachmentUrl?.ToString().ToLowerInvariant()) - .AddOptionalParameter("next_token", nextToken) + .AddOptionalParameter("next_token", nextToken) ; var __path = __pathBuilder.ToString(); __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -249,6 +310,8 @@ partial void ProcessListTasksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -259,6 +322,11 @@ partial void ProcessListTasksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -276,6 +344,8 @@ partial void ProcessListTasksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -285,8 +355,7 @@ partial void ProcessListTasksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +364,11 @@ partial void ProcessListTasksResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -311,14 +385,15 @@ partial void ProcessListTasksResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -358,6 +433,8 @@ partial void ProcessListTasksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -378,6 +455,8 @@ partial void ProcessListTasksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -402,9 +481,13 @@ partial void ProcessListTasksResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.TaskListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.TaskListResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -432,9 +515,13 @@ partial void ProcessListTasksResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.TaskListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.TaskListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTeamMembers.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTeamMembers.g.cs index 7ba82a4..f07f6a2 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTeamMembers.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTeamMembers.g.cs @@ -49,6 +49,24 @@ partial void ProcessListTeamMembersResponseContent( public async global::System.Threading.Tasks.Task> ListTeamMembersAsync( global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTeamMembersAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List all teammates
+ /// Get a list of all team members in your Scale account. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListTeamMembersAsResponseAsync( + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -77,6 +95,7 @@ partial void ProcessListTeamMembersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/teams", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessListTeamMembersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessListTeamMembersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -176,6 +202,8 @@ partial void ProcessListTeamMembersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -185,8 +213,7 @@ partial void ProcessListTeamMembersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -195,6 +222,11 @@ partial void ProcessListTeamMembersResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -211,14 +243,15 @@ partial void ProcessListTeamMembersResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -258,6 +291,8 @@ partial void ProcessListTeamMembersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessListTeamMembersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -302,9 +339,13 @@ partial void ProcessListTeamMembersResponseContent( { __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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -332,9 +373,13 @@ partial void ProcessListTeamMembersResponseContent( #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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTrainingAttempts.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTrainingAttempts.g.cs index 302cdc2..13a0ede 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTrainingAttempts.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ListTrainingAttempts.g.cs @@ -65,6 +65,36 @@ partial void ProcessListTrainingAttemptsResponseContent( int? limit = default, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTrainingAttemptsAsResponseAsync( + qualityTaskIds: qualityTaskIds, + labelerEmails: labelerEmails, + nextToken: nextToken, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List training attempts
+ /// Get a list of labeler training attempts for quality management. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListTrainingAttemptsAsResponseAsync( + global::System.Collections.Generic.IList? qualityTaskIds = default, + global::System.Collections.Generic.IList? labelerEmails = default, + string? nextToken = default, + int? limit = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,14 +127,15 @@ partial void ProcessListTrainingAttemptsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/quality/labelers", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("quality_task_ids", qualityTaskIds, delimiter: ",", explode: true) .AddOptionalParameter("labeler_emails", labelerEmails, delimiter: ",", explode: true) .AddOptionalParameter("next_token", nextToken) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -179,6 +210,8 @@ partial void ProcessListTrainingAttemptsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +222,11 @@ partial void ProcessListTrainingAttemptsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +244,8 @@ partial void ProcessListTrainingAttemptsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +255,7 @@ partial void ProcessListTrainingAttemptsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +264,11 @@ partial void ProcessListTrainingAttemptsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +285,15 @@ partial void ProcessListTrainingAttemptsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +333,8 @@ partial void ProcessListTrainingAttemptsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +355,8 @@ partial void ProcessListTrainingAttemptsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,7 +381,11 @@ partial void ProcessListTrainingAttemptsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -360,7 +413,11 @@ partial void ProcessListTrainingAttemptsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.PrioritizeBatch.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.PrioritizeBatch.g.cs index a0812e7..c870e9e 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.PrioritizeBatch.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.PrioritizeBatch.g.cs @@ -55,6 +55,32 @@ partial void ProcessPrioritizeBatchResponseContent( public async global::System.Threading.Tasks.Task PrioritizeBatchAsync( string batchName, + global::ScaleAI.BatchPrioritizeRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PrioritizeBatchAsResponseAsync( + batchName: batchName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Set batch priority
+ /// Set the priority of a batch. Higher priority batches are processed first. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PrioritizeBatchAsResponseAsync( + string batchName, + global::ScaleAI.BatchPrioritizeRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessPrioritizeBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/batches/{batchName}/prioritize", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessPrioritizeBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessPrioritizeBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessPrioritizeBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessPrioritizeBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessPrioritizeBatchResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessPrioritizeBatchResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessPrioritizeBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessPrioritizeBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessPrioritizeBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.SuccessResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.SuccessResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +402,13 @@ partial void ProcessPrioritizeBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.SuccessResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.SuccessResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ResetStudioBatchPriorities.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ResetStudioBatchPriorities.g.cs index dca7d0f..b194ea2 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ResetStudioBatchPriorities.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.ResetStudioBatchPriorities.g.cs @@ -51,6 +51,29 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( /// public async global::System.Threading.Tasks.Task ResetStudioBatchPrioritiesAsync( + object request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ResetStudioBatchPrioritiesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reset Studio batch priorities
+ /// Reset all Studio batch priorities to defaults. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ResetStudioBatchPrioritiesAsResponseAsync( + object request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/studio/batches/reset_priorities", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( 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 ProcessResetStudioBatchPrioritiesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,7 +359,11 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -345,7 +391,11 @@ partial void ProcessResetStudioBatchPrioritiesResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetStudioBatchPriorities.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetStudioBatchPriorities.g.cs index f145b42..c2a53bd 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetStudioBatchPriorities.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetStudioBatchPriorities.g.cs @@ -51,6 +51,29 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( /// public async global::System.Threading.Tasks.Task SetStudioBatchPrioritiesAsync( + object request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SetStudioBatchPrioritiesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Set Studio batch priorities
+ /// Set the priorities of Studio batches. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SetStudioBatchPrioritiesAsResponseAsync( + object request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/studio/batches/set_priorities", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( 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 ProcessSetStudioBatchPrioritiesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,7 +359,11 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -345,7 +391,11 @@ partial void ProcessSetStudioBatchPrioritiesResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetTaskMetadata.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetTaskMetadata.g.cs index 49288f8..f38fb4e 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetTaskMetadata.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.SetTaskMetadata.g.cs @@ -55,6 +55,32 @@ partial void ProcessSetTaskMetadataResponseContent( public async global::System.Threading.Tasks.Task SetTaskMetadataAsync( string taskId, + global::ScaleAI.SetMetadataRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SetTaskMetadataAsResponseAsync( + taskId: taskId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Set task metadata
+ /// Set custom key-value metadata on a task. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SetTaskMetadataAsResponseAsync( + string taskId, + global::ScaleAI.SetMetadataRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessSetTaskMetadataResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}/setMetadata", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessSetTaskMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessSetTaskMetadataResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessSetTaskMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessSetTaskMetadataResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessSetTaskMetadataResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessSetTaskMetadataResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessSetTaskMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessSetTaskMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessSetTaskMetadataResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +402,13 @@ partial void ProcessSetTaskMetadataResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UnassignTeammates.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UnassignTeammates.g.cs index cfba199..f2e8384 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UnassignTeammates.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UnassignTeammates.g.cs @@ -51,6 +51,29 @@ partial void ProcessUnassignTeammatesResponseContent( /// public async global::System.Threading.Tasks.Task UnassignTeammatesAsync( + global::ScaleAI.UnassignTeamRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UnassignTeammatesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Unassign teammates from projects
+ /// Remove team members from Studio project assignments. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UnassignTeammatesAsResponseAsync( + global::ScaleAI.UnassignTeamRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessUnassignTeammatesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/studio/assignments/remove", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessUnassignTeammatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessUnassignTeammatesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessUnassignTeammatesResponseContent( 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 ProcessUnassignTeammatesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessUnassignTeammatesResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessUnassignTeammatesResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessUnassignTeammatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessUnassignTeammatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,7 +359,11 @@ partial void ProcessUnassignTeammatesResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -345,7 +391,11 @@ partial void ProcessUnassignTeammatesResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateProjectParams.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateProjectParams.g.cs index 55badf2..7546ee9 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateProjectParams.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateProjectParams.g.cs @@ -55,6 +55,32 @@ partial void ProcessUpdateProjectParamsResponseContent( public async global::System.Threading.Tasks.Task UpdateProjectParamsAsync( string projectName, + global::ScaleAI.UpdateProjectParamsRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateProjectParamsAsResponseAsync( + projectName: projectName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update project parameters
+ /// Update default parameters for a project. Creates a new version in param_history. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateProjectParamsAsResponseAsync( + string projectName, + global::ScaleAI.UpdateProjectParamsRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessUpdateProjectParamsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/projects/{projectName}/setParams", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessUpdateProjectParamsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessUpdateProjectParamsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessUpdateProjectParamsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessUpdateProjectParamsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessUpdateProjectParamsResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessUpdateProjectParamsResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessUpdateProjectParamsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessUpdateProjectParamsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessUpdateProjectParamsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Project.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Project.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +402,13 @@ partial void ProcessUpdateProjectParamsResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Project.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTaskUniqueId.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTaskUniqueId.g.cs index fe660b5..82e7c97 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTaskUniqueId.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTaskUniqueId.g.cs @@ -55,6 +55,32 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( public async global::System.Threading.Tasks.Task UpdateTaskUniqueIdAsync( string taskId, + global::ScaleAI.UpdateUniqueIdRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateTaskUniqueIdAsResponseAsync( + taskId: taskId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update task unique_id
+ /// Update the unique_id of a task. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateTaskUniqueIdAsResponseAsync( + string taskId, + global::ScaleAI.UpdateUniqueIdRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: $"/task/{taskId}/unique_id", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +231,8 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +242,7 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +251,11 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +272,15 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +320,8 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.Task.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +402,13 @@ partial void ProcessUpdateTaskUniqueIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.Task.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTeamRole.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTeamRole.g.cs index f119933..8a7ac7c 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTeamRole.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UpdateTeamRole.g.cs @@ -51,6 +51,29 @@ partial void ProcessUpdateTeamRoleResponseContent( /// public async global::System.Threading.Tasks.Task> UpdateTeamRoleAsync( + global::ScaleAI.SetRoleRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateTeamRoleAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update teammate role
+ /// Update the role of existing team members. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> UpdateTeamRoleAsResponseAsync( + global::ScaleAI.SetRoleRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessUpdateTeamRoleResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/teams/set_role", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessUpdateTeamRoleResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessUpdateTeamRoleResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +222,8 @@ partial void ProcessUpdateTeamRoleResponseContent( 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 ProcessUpdateTeamRoleResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +242,11 @@ partial void ProcessUpdateTeamRoleResponseContent( __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +263,15 @@ partial void ProcessUpdateTeamRoleResponseContent( 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::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +311,8 @@ partial void ProcessUpdateTeamRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessUpdateTeamRoleResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +359,13 @@ partial void ProcessUpdateTeamRoleResponseContent( { __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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +393,13 @@ partial void ProcessUpdateTeamRoleResponseContent( #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::ScaleAI.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UploadFile.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UploadFile.g.cs index c23ba0b..3f61840 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UploadFile.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.UploadFile.g.cs @@ -51,6 +51,29 @@ partial void ProcessUploadFileResponseContent( /// public async global::System.Threading.Tasks.Task UploadFileAsync( + global::ScaleAI.UploadFileRequest request, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadFileAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload a file
+ /// Upload a local file for use as task attachments. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadFileAsResponseAsync( + global::ScaleAI.UploadFileRequest request, global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -81,10 +104,11 @@ partial void ProcessUploadFileResponseContent( var __maxAttempts = global::ScaleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::ScaleAI.PathBuilder( path: "/files/upload", baseUri: HttpClient.BaseAddress); @@ -117,6 +141,7 @@ partial void ProcessUploadFileResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -155,35 +180,42 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + if (request.DisplayName != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.DisplayName ?? string.Empty), name: "\"display_name\""); - } + + } if (request.ProjectName != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.ProjectName ?? string.Empty), name: "\"project_name\""); - } + + } if (request.ReferenceId != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.ReferenceId ?? string.Empty), name: "\"reference_id\""); - } + + } if (request.Metadata != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), name: "\"metadata\""); + } + __httpRequest.Content = __httpRequestContent; + global::ScaleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -225,6 +257,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -235,6 +269,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -252,6 +291,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -261,8 +302,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -271,6 +311,11 @@ request.Filename is null __attempt < __maxAttempts && global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -287,14 +332,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -334,6 +380,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -354,6 +402,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -378,9 +428,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::ScaleAI.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::ScaleAI.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +462,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::ScaleAI.FileUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::ScaleAI.FileUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -498,5 +556,942 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload a file
+ /// Upload a local file for use as task attachments. + ///
+ /// + /// The file to upload. + /// + /// + /// The file to upload. + /// + /// + /// Human-readable file name. + /// + /// + /// Project to associate the file with. + /// + /// + /// Unique upload identifier for idempotency. + /// + /// + /// JSON string of additional metadata. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadFileAsync( + global::System.IO.Stream file, + string filename, + string? displayName = default, + string? projectName = default, + string? referenceId = default, + string? metadata = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ScaleAI.UploadFileRequest + { + File = global::System.Array.Empty(), + Filename = filename, + DisplayName = displayName, + ProjectName = projectName, + ReferenceId = referenceId, + Metadata = metadata, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadFileArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadFileSecurityRequirements, + operationName: "UploadFileAsync"); + + using var __timeoutCancellationTokenSource = global::ScaleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ScaleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ScaleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ScaleAI.PathBuilder( + path: "/files/upload", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.DisplayName != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DisplayName ?? string.Empty), + name: "\"display_name\""); + + } + if (request.ProjectName != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ProjectName ?? string.Empty), + name: "\"project_name\""); + + } + if (request.ReferenceId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ReferenceId ?? string.Empty), + name: "\"reference_id\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ScaleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::ScaleAI.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::ScaleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::ScaleAI.FileUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ScaleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upload a file
+ /// Upload a local file for use as task attachments. + ///
+ /// + /// The file to upload. + /// + /// + /// The file to upload. + /// + /// + /// Human-readable file name. + /// + /// + /// Project to associate the file with. + /// + /// + /// Unique upload identifier for idempotency. + /// + /// + /// JSON string of additional metadata. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadFileAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? displayName = default, + string? projectName = default, + string? referenceId = default, + string? metadata = default, + global::ScaleAI.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::ScaleAI.UploadFileRequest + { + File = global::System.Array.Empty(), + Filename = filename, + DisplayName = displayName, + ProjectName = projectName, + ReferenceId = referenceId, + Metadata = metadata, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadFileArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadFileSecurityRequirements, + operationName: "UploadFileAsync"); + + using var __timeoutCancellationTokenSource = global::ScaleAI.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::ScaleAI.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::ScaleAI.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::ScaleAI.PathBuilder( + path: "/files/upload", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::ScaleAI.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.DisplayName != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.DisplayName ?? string.Empty), + name: "\"display_name\""); + + } + if (request.ProjectName != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ProjectName ?? string.Empty), + name: "\"project_name\""); + + } + if (request.ReferenceId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ReferenceId ?? string.Empty), + name: "\"reference_id\""); + + } + if (request.Metadata != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Metadata ?? string.Empty), + name: "\"metadata\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::ScaleAI.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::ScaleAI.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::ScaleAI.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::ScaleAI.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::ScaleAI.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::ScaleAI.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/files/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::ScaleAI.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::ScaleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::ScaleAI.FileUploadResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::ScaleAI.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::ScaleAI.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::ScaleAI.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.g.cs b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.g.cs index 4c925db..f3e7923 100644 --- a/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.g.cs +++ b/src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.g.cs @@ -75,10 +75,10 @@ public ScaleAIClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ScaleAIClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::ScaleAI.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::ScaleAI.AutoSDKClientOptions? options, bool disposeHttpClient = true) {