@@ -88,20 +88,14 @@ public virtual async Task<V1Workflow> UploadWorkflowAsync(V1UploadWorkflowComman
8888 }
8989
9090 /// <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 )
9292 {
9393 var result = await this . Adapter . GetWorkflowsAsync ( query , cancellationToken ) ;
9494 if ( ! result . Succeeded )
9595 throw new SynapseApiException ( result ) ;
9696 return result . Data ! ;
9797 }
9898
99- /// <inheritdoc/>
100- public virtual async Task < List < V1Workflow > > GetWorkflowsAsync ( CancellationToken cancellationToken = default )
101- {
102- return await this . GetWorkflowsAsync ( null ! , cancellationToken ) ;
103- }
104-
10599 /// <inheritdoc/>
106100 public virtual async Task < V1Workflow > GetWorkflowByIdAsync ( string id , CancellationToken cancellationToken = default )
107101 {
@@ -158,20 +152,14 @@ public virtual async Task<V1WorkflowInstance> GetWorkflowInstanceByIdAsync(strin
158152 }
159153
160154 /// <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 )
162156 {
163157 var result = await this . Adapter . GetWorkflowInstancesAsync ( query , cancellationToken ) ;
164158 if ( ! result . Succeeded )
165159 throw new SynapseApiException ( result ) ;
166160 return result . Data ! ;
167161 }
168162
169- /// <inheritdoc/>
170- public virtual async Task < List < V1WorkflowInstance > > GetWorkflowInstancesAsync ( CancellationToken cancellationToken = default )
171- {
172- return await this . GetWorkflowInstancesAsync ( null ! , cancellationToken ) ;
173- }
174-
175163 /// <inheritdoc/>
176164 public virtual async Task SuspendWorkflowInstanceAsync ( string id , CancellationToken cancellationToken = default )
177165 {
@@ -236,7 +224,7 @@ public virtual async Task<V1Correlation> CreateCorrelationAsync(V1CreateCorrelat
236224 }
237225
238226 /// <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 )
240228 {
241229 var result = await this . Adapter . GetCorrelationsAsync ( query , cancellationToken ) ;
242230 if ( ! result . Succeeded )
@@ -245,18 +233,34 @@ public virtual async Task<List<V1Correlation>> GetCorrelationsAsync(string query
245233 }
246234
247235 /// <inheritdoc/>
248- public virtual async Task < List < V1Correlation > > GetCorrelationsAsync ( CancellationToken cancellationToken = default )
236+ public virtual async Task < V1Correlation > GetCorrelationByIdAsync ( string id , CancellationToken cancellationToken = default )
249237 {
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 ! ;
251243 }
252244
253245 /// <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 )
255247 {
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 ) ;
257262 if ( ! result . Succeeded )
258263 throw new SynapseApiException ( result ) ;
259- return result . Data ! ;
260264 }
261265
262266 /// <inheritdoc/>
@@ -288,14 +292,9 @@ public virtual async Task<V1AuthenticationDefinitionCollection> GetAuthenticatio
288292 return result . Data ! ;
289293 }
290294
291- /// <inheritdoc/>
292- public virtual async Task < List < V1AuthenticationDefinitionCollection > > GetAuthenticationDefinitionCollectionsAsync ( CancellationToken cancellationToken = default )
293- {
294- return await this . GetAuthenticationDefinitionCollectionsAsync ( null ! , cancellationToken ) ;
295- }
296295
297296 /// <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 )
299298 {
300299 var result = await this . Adapter . GetAuthenticationDefinitionCollectionsAsync ( query , cancellationToken ) ;
301300 if ( ! result . Succeeded )
@@ -334,13 +333,7 @@ public virtual async Task<V1EventDefinitionCollection> GetEventDefinitionCollect
334333 }
335334
336335 /// <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 )
344337 {
345338 var result = await this . Adapter . GetEventDefinitionCollectionsAsync ( query , cancellationToken ) ;
346339 if ( ! result . Succeeded )
@@ -379,13 +372,7 @@ public virtual async Task<V1FunctionDefinitionCollection> GetFunctionDefinitionC
379372 }
380373
381374 /// <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 )
389376 {
390377 var result = await this . Adapter . GetFunctionDefinitionCollectionsAsync ( query , cancellationToken ) ;
391378 if ( ! result . Succeeded )
@@ -437,10 +424,7 @@ public virtual async Task<V1Schedule> GetScheduleByIdAsync(string id, Cancellati
437424 }
438425
439426 /// <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 )
444428 {
445429 var result = await this . Adapter . GetSchedulesAsync ( query , cancellationToken ) ;
446430 if ( ! result . Succeeded ) throw new SynapseApiException ( result ) ;
0 commit comments