chore(mobile): make openapi requests abortable (#28692)

make open-api requests abortable
This commit is contained in:
Mert
2026-05-30 11:31:17 -04:00
committed by GitHub
parent 14aff51da9
commit 65611bb860
41 changed files with 1104 additions and 769 deletions
+28 -21
View File
@@ -25,7 +25,7 @@ class WorkflowsApi {
/// Parameters:
///
/// * [WorkflowCreateDto] workflowCreateDto (required):
Future<Response> createWorkflowWithHttpInfo(WorkflowCreateDto workflowCreateDto,) async {
Future<Response> createWorkflowWithHttpInfo(WorkflowCreateDto workflowCreateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows';
@@ -47,6 +47,7 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -57,8 +58,8 @@ class WorkflowsApi {
/// Parameters:
///
/// * [WorkflowCreateDto] workflowCreateDto (required):
Future<WorkflowResponseDto?> createWorkflow(WorkflowCreateDto workflowCreateDto,) async {
final response = await createWorkflowWithHttpInfo(workflowCreateDto,);
Future<WorkflowResponseDto?> createWorkflow(WorkflowCreateDto workflowCreateDto, { Future<void>? abortTrigger, }) async {
final response = await createWorkflowWithHttpInfo(workflowCreateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -81,7 +82,7 @@ class WorkflowsApi {
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteWorkflowWithHttpInfo(String id,) async {
Future<Response> deleteWorkflowWithHttpInfo(String id, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
@@ -104,6 +105,7 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -114,8 +116,8 @@ class WorkflowsApi {
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteWorkflow(String id,) async {
final response = await deleteWorkflowWithHttpInfo(id,);
Future<void> deleteWorkflow(String id, { Future<void>? abortTrigger, }) async {
final response = await deleteWorkflowWithHttpInfo(id, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -130,7 +132,7 @@ class WorkflowsApi {
/// Parameters:
///
/// * [String] id (required):
Future<Response> getWorkflowWithHttpInfo(String id,) async {
Future<Response> getWorkflowWithHttpInfo(String id, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
@@ -153,6 +155,7 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -163,8 +166,8 @@ class WorkflowsApi {
/// Parameters:
///
/// * [String] id (required):
Future<WorkflowResponseDto?> getWorkflow(String id,) async {
final response = await getWorkflowWithHttpInfo(id,);
Future<WorkflowResponseDto?> getWorkflow(String id, { Future<void>? abortTrigger, }) async {
final response = await getWorkflowWithHttpInfo(id, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -187,7 +190,7 @@ class WorkflowsApi {
/// Parameters:
///
/// * [String] id (required):
Future<Response> getWorkflowForShareWithHttpInfo(String id,) async {
Future<Response> getWorkflowForShareWithHttpInfo(String id, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}/share'
.replaceAll('{id}', id);
@@ -210,6 +213,7 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -220,8 +224,8 @@ class WorkflowsApi {
/// Parameters:
///
/// * [String] id (required):
Future<WorkflowShareResponseDto?> getWorkflowForShare(String id,) async {
final response = await getWorkflowForShareWithHttpInfo(id,);
Future<WorkflowShareResponseDto?> getWorkflowForShare(String id, { Future<void>? abortTrigger, }) async {
final response = await getWorkflowForShareWithHttpInfo(id, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -240,7 +244,7 @@ class WorkflowsApi {
/// Retrieve a list of all available workflow triggers.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getWorkflowTriggersWithHttpInfo() async {
Future<Response> getWorkflowTriggersWithHttpInfo({ Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/triggers';
@@ -262,14 +266,15 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// List all workflow triggers
///
/// Retrieve a list of all available workflow triggers.
Future<List<WorkflowTriggerResponseDto>?> getWorkflowTriggers() async {
final response = await getWorkflowTriggersWithHttpInfo();
Future<List<WorkflowTriggerResponseDto>?> getWorkflowTriggers({ Future<void>? abortTrigger, }) async {
final response = await getWorkflowTriggersWithHttpInfo(abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -308,7 +313,7 @@ class WorkflowsApi {
///
/// * [WorkflowTrigger] trigger:
/// Workflow trigger type
Future<Response> searchWorkflowsWithHttpInfo({ String? description, bool? enabled, String? id, String? name, WorkflowTrigger? trigger, }) async {
Future<Response> searchWorkflowsWithHttpInfo({ String? description, bool? enabled, String? id, String? name, WorkflowTrigger? trigger, Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows';
@@ -346,6 +351,7 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -369,8 +375,8 @@ class WorkflowsApi {
///
/// * [WorkflowTrigger] trigger:
/// Workflow trigger type
Future<List<WorkflowResponseDto>?> searchWorkflows({ String? description, bool? enabled, String? id, String? name, WorkflowTrigger? trigger, }) async {
final response = await searchWorkflowsWithHttpInfo( description: description, enabled: enabled, id: id, name: name, trigger: trigger, );
Future<List<WorkflowResponseDto>?> searchWorkflows({ String? description, bool? enabled, String? id, String? name, WorkflowTrigger? trigger, Future<void>? abortTrigger, }) async {
final response = await searchWorkflowsWithHttpInfo(description: description, enabled: enabled, id: id, name: name, trigger: trigger, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -398,7 +404,7 @@ class WorkflowsApi {
/// * [String] id (required):
///
/// * [WorkflowUpdateDto] workflowUpdateDto (required):
Future<Response> updateWorkflowWithHttpInfo(String id, WorkflowUpdateDto workflowUpdateDto,) async {
Future<Response> updateWorkflowWithHttpInfo(String id, WorkflowUpdateDto workflowUpdateDto, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
@@ -421,6 +427,7 @@ class WorkflowsApi {
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -433,8 +440,8 @@ class WorkflowsApi {
/// * [String] id (required):
///
/// * [WorkflowUpdateDto] workflowUpdateDto (required):
Future<WorkflowResponseDto?> updateWorkflow(String id, WorkflowUpdateDto workflowUpdateDto,) async {
final response = await updateWorkflowWithHttpInfo(id, workflowUpdateDto,);
Future<WorkflowResponseDto?> updateWorkflow(String id, WorkflowUpdateDto workflowUpdateDto, { Future<void>? abortTrigger, }) async {
final response = await updateWorkflowWithHttpInfo(id, workflowUpdateDto, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}