@@ -88,20 +88,14 @@ public virtual async Task<V1Workflow> UploadWorkflowAsync(V1UploadWorkflowComman
88
88
}
89
89
90
90
/// <inheritdoc/>
91
- public virtual async Task < List < V1Workflow > > GetWorkflowsAsync ( string query , CancellationToken cancellationToken = default )
91
+ public virtual async Task < List < V1Workflow > > GetWorkflowsAsync ( string ? query = null , CancellationToken cancellationToken = default )
92
92
{
93
93
var result = await this . Adapter . GetWorkflowsAsync ( query , cancellationToken ) ;
94
94
if ( ! result . Succeeded )
95
95
throw new SynapseApiException ( result ) ;
96
96
return result . Data ! ;
97
97
}
98
98
99
- /// <inheritdoc/>
100
- public virtual async Task < List < V1Workflow > > GetWorkflowsAsync ( CancellationToken cancellationToken = default )
101
- {
102
- return await this . GetWorkflowsAsync ( null ! , cancellationToken ) ;
103
- }
104
-
105
99
/// <inheritdoc/>
106
100
public virtual async Task < V1Workflow > GetWorkflowByIdAsync ( string id , CancellationToken cancellationToken = default )
107
101
{
@@ -158,20 +152,14 @@ public virtual async Task<V1WorkflowInstance> GetWorkflowInstanceByIdAsync(strin
158
152
}
159
153
160
154
/// <inheritdoc/>
161
- public virtual async Task < List < V1WorkflowInstance > > GetWorkflowInstancesAsync ( string query , CancellationToken cancellationToken = default )
155
+ public virtual async Task < List < V1WorkflowInstance > > GetWorkflowInstancesAsync ( string ? query = null , CancellationToken cancellationToken = default )
162
156
{
163
157
var result = await this . Adapter . GetWorkflowInstancesAsync ( query , cancellationToken ) ;
164
158
if ( ! result . Succeeded )
165
159
throw new SynapseApiException ( result ) ;
166
160
return result . Data ! ;
167
161
}
168
162
169
- /// <inheritdoc/>
170
- public virtual async Task < List < V1WorkflowInstance > > GetWorkflowInstancesAsync ( CancellationToken cancellationToken = default )
171
- {
172
- return await this . GetWorkflowInstancesAsync ( null ! , cancellationToken ) ;
173
- }
174
-
175
163
/// <inheritdoc/>
176
164
public virtual async Task SuspendWorkflowInstanceAsync ( string id , CancellationToken cancellationToken = default )
177
165
{
@@ -236,7 +224,7 @@ public virtual async Task<V1Correlation> CreateCorrelationAsync(V1CreateCorrelat
236
224
}
237
225
238
226
/// <inheritdoc/>
239
- public virtual async Task < List < V1Correlation > > GetCorrelationsAsync ( string query , CancellationToken cancellationToken = default )
227
+ public virtual async Task < List < V1Correlation > > GetCorrelationsAsync ( string ? query = null , CancellationToken cancellationToken = default )
240
228
{
241
229
var result = await this . Adapter . GetCorrelationsAsync ( query , cancellationToken ) ;
242
230
if ( ! result . Succeeded )
@@ -245,18 +233,34 @@ public virtual async Task<List<V1Correlation>> GetCorrelationsAsync(string query
245
233
}
246
234
247
235
/// <inheritdoc/>
248
- public virtual async Task < List < V1Correlation > > GetCorrelationsAsync ( CancellationToken cancellationToken = default )
236
+ public virtual async Task < V1Correlation > GetCorrelationByIdAsync ( string id , CancellationToken cancellationToken = default )
249
237
{
250
- return await this . GetCorrelationsAsync ( null ! , cancellationToken ) ;
238
+ if ( string . IsNullOrWhiteSpace ( id ) ) throw new ArgumentNullException ( nameof ( id ) ) ;
239
+ var result = await this . Adapter . GetCorrelationByIdAsync ( id , cancellationToken ) ;
240
+ if ( ! result . Succeeded )
241
+ throw new SynapseApiException ( result ) ;
242
+ return result . Data ! ;
251
243
}
252
244
253
245
/// <inheritdoc/>
254
- public virtual async Task < V1Correlation > GetCorrelationByIdAsync ( string id , CancellationToken cancellationToken = default )
246
+ public virtual async Task DeleteCorrelationContextAsync ( string correlationId , string contextId , CancellationToken cancellationToken = default )
255
247
{
256
- var result = await this . Adapter . GetCorrelationByIdAsync ( id , cancellationToken ) ;
248
+ if ( string . IsNullOrWhiteSpace ( correlationId ) ) throw new ArgumentNullException ( nameof ( correlationId ) ) ;
249
+ if ( string . IsNullOrWhiteSpace ( contextId ) ) throw new ArgumentNullException ( nameof ( contextId ) ) ;
250
+ var result = await this . Adapter . DeleteCorrelationContextAsync ( new ( ) { CorrelationId = correlationId , ContextId = contextId } , cancellationToken ) ;
251
+ if ( ! result . Succeeded )
252
+ throw new SynapseApiException ( result ) ;
253
+ }
254
+
255
+ /// <inheritdoc/>
256
+ public virtual async Task DeleteCorrelationContextEventAsync ( string correlationId , string contextId , string eventId , CancellationToken cancellationToken = default )
257
+ {
258
+ if ( string . IsNullOrWhiteSpace ( correlationId ) ) throw new ArgumentNullException ( nameof ( correlationId ) ) ;
259
+ if ( string . IsNullOrWhiteSpace ( contextId ) ) throw new ArgumentNullException ( nameof ( contextId ) ) ;
260
+ if ( string . IsNullOrWhiteSpace ( eventId ) ) throw new ArgumentNullException ( nameof ( eventId ) ) ;
261
+ var result = await this . Adapter . DeleteCorrelationContextEventAsync ( new ( ) { CorrelationId = correlationId , ContextId = contextId , EventId = eventId } , cancellationToken ) ;
257
262
if ( ! result . Succeeded )
258
263
throw new SynapseApiException ( result ) ;
259
- return result . Data ! ;
260
264
}
261
265
262
266
/// <inheritdoc/>
@@ -288,14 +292,9 @@ public virtual async Task<V1AuthenticationDefinitionCollection> GetAuthenticatio
288
292
return result . Data ! ;
289
293
}
290
294
291
- /// <inheritdoc/>
292
- public virtual async Task < List < V1AuthenticationDefinitionCollection > > GetAuthenticationDefinitionCollectionsAsync ( CancellationToken cancellationToken = default )
293
- {
294
- return await this . GetAuthenticationDefinitionCollectionsAsync ( null ! , cancellationToken ) ;
295
- }
296
295
297
296
/// <inheritdoc/>
298
- public virtual async Task < List < V1AuthenticationDefinitionCollection > > GetAuthenticationDefinitionCollectionsAsync ( string ? query , CancellationToken cancellationToken = default )
297
+ public virtual async Task < List < V1AuthenticationDefinitionCollection > > GetAuthenticationDefinitionCollectionsAsync ( string ? query = null , CancellationToken cancellationToken = default )
299
298
{
300
299
var result = await this . Adapter . GetAuthenticationDefinitionCollectionsAsync ( query , cancellationToken ) ;
301
300
if ( ! result . Succeeded )
@@ -334,13 +333,7 @@ public virtual async Task<V1EventDefinitionCollection> GetEventDefinitionCollect
334
333
}
335
334
336
335
/// <inheritdoc/>
337
- public virtual async Task < List < V1EventDefinitionCollection > > GetEventDefinitionCollectionsAsync ( CancellationToken cancellationToken = default )
338
- {
339
- return await this . GetEventDefinitionCollectionsAsync ( null ! , cancellationToken ) ;
340
- }
341
-
342
- /// <inheritdoc/>
343
- public virtual async Task < List < V1EventDefinitionCollection > > GetEventDefinitionCollectionsAsync ( string ? query , CancellationToken cancellationToken = default )
336
+ public virtual async Task < List < V1EventDefinitionCollection > > GetEventDefinitionCollectionsAsync ( string ? query = null , CancellationToken cancellationToken = default )
344
337
{
345
338
var result = await this . Adapter . GetEventDefinitionCollectionsAsync ( query , cancellationToken ) ;
346
339
if ( ! result . Succeeded )
@@ -379,13 +372,7 @@ public virtual async Task<V1FunctionDefinitionCollection> GetFunctionDefinitionC
379
372
}
380
373
381
374
/// <inheritdoc/>
382
- public virtual async Task < List < V1FunctionDefinitionCollection > > GetFunctionDefinitionCollectionsAsync ( CancellationToken cancellationToken = default )
383
- {
384
- return await this . GetFunctionDefinitionCollectionsAsync ( null ! , cancellationToken ) ;
385
- }
386
-
387
- /// <inheritdoc/>
388
- public virtual async Task < List < V1FunctionDefinitionCollection > > GetFunctionDefinitionCollectionsAsync ( string query , CancellationToken cancellationToken = default )
375
+ public virtual async Task < List < V1FunctionDefinitionCollection > > GetFunctionDefinitionCollectionsAsync ( string ? query = null , CancellationToken cancellationToken = default )
389
376
{
390
377
var result = await this . Adapter . GetFunctionDefinitionCollectionsAsync ( query , cancellationToken ) ;
391
378
if ( ! result . Succeeded )
@@ -437,10 +424,7 @@ public virtual async Task<V1Schedule> GetScheduleByIdAsync(string id, Cancellati
437
424
}
438
425
439
426
/// <inheritdoc/>
440
- public virtual async Task < List < V1Schedule > > GetSchedulesAsync ( CancellationToken cancellationToken = default ) => await this . GetSchedulesAsync ( null ! , cancellationToken ) ;
441
-
442
- /// <inheritdoc/>
443
- public virtual async Task < List < V1Schedule > > GetSchedulesAsync ( string query , CancellationToken cancellationToken = default )
427
+ public virtual async Task < List < V1Schedule > > GetSchedulesAsync ( string ? query = null , CancellationToken cancellationToken = default )
444
428
{
445
429
var result = await this . Adapter . GetSchedulesAsync ( query , cancellationToken ) ;
446
430
if ( ! result . Succeeded ) throw new SynapseApiException ( result ) ;
0 commit comments