Skip to content

Commit 9c81916

Browse files
committed
csharp: Adjust to changes of the lower-level generated code
1 parent 871f668 commit 9c81916

File tree

3 files changed

+70
-130
lines changed

3 files changed

+70
-130
lines changed

csharp/Svix/BackgroundTask.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public BackgroundTaskOut Get(string taskId, string idempotencyKey = default)
2626
{
2727
try
2828
{
29-
var lBackgroundTask = _backgroundTaskApi.GetBackgroundTask(taskId);
29+
var lBackgroundTask = _backgroundTaskApi.V1BackgroundTaskGet(taskId);
3030

3131
return lBackgroundTask;
3232
}
@@ -45,7 +45,7 @@ public async Task<BackgroundTaskOut> GetAsync(string taskId, string idempotencyK
4545
{
4646
try
4747
{
48-
var lBackgroundTask = await _backgroundTaskApi.GetBackgroundTaskAsync(taskId);
48+
var lBackgroundTask = await _backgroundTaskApi.V1BackgroundTaskGetAsync(taskId);
4949

5050
return lBackgroundTask;
5151
}
@@ -64,7 +64,7 @@ public ListResponseBackgroundTaskOut List(BackgroundTaskListOptions options = nu
6464
{
6565
try
6666
{
67-
var lResponse = _backgroundTaskApi.ListBackgroundTasks(
67+
var lResponse = _backgroundTaskApi.V1BackgroundTaskList(
6868
options?.Status,
6969
options?.Task,
7070
options?.Limit,
@@ -88,7 +88,7 @@ public async Task<ListResponseBackgroundTaskOut> ListAsync(BackgroundTaskListOpt
8888
{
8989
try
9090
{
91-
var lResponse = await _backgroundTaskApi.ListBackgroundTasksAsync(
91+
var lResponse = await _backgroundTaskApi.V1BackgroundTaskListAsync(
9292
options?.Status,
9393
options?.Task,
9494
options?.Limit,

csharp/Svix/MessageAttempt.cs

+52-112
Original file line numberDiff line numberDiff line change
@@ -266,139 +266,79 @@ public async Task<ListResponseMessageAttemptOut> ListAttemptsByMessageAsync(stri
266266

267267
// Deprecated
268268
[Obsolete("Use ListAttemptsByMessage instead, passing the endpoint ID through options")]
269-
public ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId,
269+
public ListResponseMessageAttemptOut ListAttemptsForEndpoint(string appId, string messageId,
270270
string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default)
271271
{
272-
try
273-
{
274-
var lResults = _messageAttemptApi.V1MessageAttemptListByEndpointDeprecated(
275-
appId,
276-
messageId,
277-
endpointId,
278-
options?.Limit,
279-
options?.Iterator,
280-
options?.Channel,
281-
options?.Tag,
282-
(Svix.Model.MessageStatus?)options?.Status,
283-
options?.Before,
284-
options?.After,
285-
options?.EventTypes);
286-
287-
return lResults;
288-
}
289-
catch (ApiException e)
290-
{
291-
Logger?.LogError(e, $"{nameof(ListAttemptsForEndpoint)} failed");
292-
293-
if (Throw)
294-
throw;
295-
296-
return new ListResponseMessageAttemptEndpointOut();
297-
}
272+
var listByMessageOptions = new AttemptsByMessageListOptions(
273+
Limit: options?.Limit,
274+
Iterator: options?.Iterator,
275+
Channel: options?.Channel,
276+
Tag: options?.Tag,
277+
Status: options?.Status,
278+
Before: options?.Before,
279+
After: options?.After,
280+
EventTypes: options?.EventTypes,
281+
EndpointId: endpointId
282+
);
283+
return ListAttemptsByMessage(appId, messageId, listByMessageOptions, idempotencyKey);
298284
}
299285

300286
// Deprecated
301287
[Obsolete("Use ListAttemptsByMessageAsync instead, passing the endpoint ID through options")]
302-
public async Task<ListResponseMessageAttemptEndpointOut> ListAttemptsForEndpointAsync(string appId,
288+
public async Task<ListResponseMessageAttemptOut> ListAttemptsForEndpointAsync(string appId,
303289
string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default,
304290
CancellationToken cancellationToken = default)
305291
{
306-
try
307-
{
308-
var lResults = await _messageAttemptApi.V1MessageAttemptListByEndpointDeprecatedAsync(
309-
appId,
310-
messageId,
311-
endpointId,
312-
options?.Limit,
313-
options?.Iterator,
314-
options?.Channel,
315-
options?.Tag,
316-
(Svix.Model.MessageStatus?)options?.Status,
317-
options?.Before,
318-
options?.After,
319-
options?.EventTypes?.ToList(),
320-
cancellationToken);
321-
322-
return lResults;
323-
}
324-
catch (ApiException e)
325-
{
326-
Logger?.LogError(e, $"{nameof(ListAttemptsForEndpointAsync)} failed");
327-
328-
if (Throw)
329-
throw;
330-
331-
return new ListResponseMessageAttemptEndpointOut();
332-
}
292+
var listByMessageOptions = new AttemptsByMessageListOptions(
293+
Limit: options?.Limit,
294+
Iterator: options?.Iterator,
295+
Channel: options?.Channel,
296+
Tag: options?.Tag,
297+
Status: options?.Status,
298+
Before: options?.Before,
299+
After: options?.After,
300+
EventTypes: options?.EventTypes,
301+
EndpointId: endpointId
302+
);
303+
return await ListAttemptsByMessageAsync(appId, messageId, listByMessageOptions, idempotencyKey);
333304
}
334305

335306
// Deprecated
336-
[Obsolete("Use ListAttemptsByEndpoint or ListAttemptsByMessage instead")]
307+
[Obsolete("Use ListAttemptsByMessage instead")]
337308
public ListResponseMessageAttemptOut ListAttempts(string appId, string messageId, MessageAttemptListOptions options = null,
338309
string idempotencyKey = default)
339310
{
340-
try
341-
{
342-
var lResults = _messageAttemptApi.V1MessageAttemptListByMsgDeprecated(
343-
appId,
344-
messageId,
345-
options?.Limit,
346-
options?.Iterator,
347-
options?.EndpointId,
348-
options?.Channel,
349-
options?.Tag,
350-
(Svix.Model.MessageStatus?)options?.Status,
351-
options?.Before,
352-
options?.After,
353-
null,
354-
options?.EventTypes);
355-
356-
return lResults;
357-
}
358-
catch (ApiException e)
359-
{
360-
Logger?.LogError(e, $"{nameof(ListAttempts)} failed");
361-
362-
if (Throw)
363-
throw;
364-
365-
return new ListResponseMessageAttemptOut();
366-
}
311+
ListResponseTemplateOut listByMessageOptions = new AttemptsByMessageListOptions(
312+
Limit: options?.Limit,
313+
Iterator: options?.Iterator,
314+
EndpointId: options?.EndpointId,
315+
Channel: options?.Channel,
316+
Tag: options?.Tag,
317+
Status: options?.Status,
318+
Before: options?.Before,
319+
After: options?.After,
320+
EventTypes: options?.EventTypes
321+
);
322+
return ListAttemptsByMessage(appId, messageId, listByMessageOptions, idempotencyKey);
367323
}
368324

369325
// Deprecated
370-
[Obsolete("Use ListAttemptsByEndpointAsync or ListAttemptsByMessageAsync instead")]
326+
[Obsolete("Use ListAttemptsByMessageAsync instead")]
371327
public async Task<ListResponseMessageAttemptOut> ListAttemptsAsync(string appId, string messageId, MessageAttemptListOptions options = null,
372328
string idempotencyKey = default, CancellationToken cancellationToken = default)
373329
{
374-
try
375-
{
376-
var lResults = await _messageAttemptApi.V1MessageAttemptListByMsgDeprecatedAsync(
377-
appId,
378-
messageId,
379-
options?.Limit,
380-
options?.Iterator,
381-
options?.EndpointId,
382-
options?.Channel,
383-
options?.Tag,
384-
(Svix.Model.MessageStatus?)options?.Status,
385-
options?.Before,
386-
options?.After,
387-
null,
388-
options?.EventTypes,
389-
cancellationToken);
390-
391-
return lResults;
392-
}
393-
catch (ApiException e)
394-
{
395-
Logger?.LogError(e, $"{nameof(ListAttemptsAsync)} failed");
396-
397-
if (Throw)
398-
throw;
399-
400-
return new ListResponseMessageAttemptOut();
401-
}
330+
ListResponseTemplateOut listByMessageOptions = new AttemptsByMessageListOptions(
331+
Limit: options?.Limit,
332+
Iterator: options?.Iterator,
333+
EndpointId: options?.EndpointId,
334+
Channel: options?.Channel,
335+
Tag: options?.Tag,
336+
Status: options?.Status,
337+
Before: options?.Before,
338+
After: options?.After,
339+
EventTypes: options?.EventTypes
340+
);
341+
return await ListAttemptsByMessageAsync(appId, messageId, listByMessageOptions, idempotencyKey);
402342
}
403343

404344
public ListResponseMessageEndpointOut ListAttemptedDestinations(string appId, string messageId, ListOptions options = null,

csharp/Svix/OperationalWebhookEndpoint.cs

+14-14
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public OperationalWebhookEndpointOut Create(
2727
{
2828
try
2929
{
30-
var lEndpoint = _opWebhookEndpointApi.CreateOperationalWebhookEndpoint(
30+
var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointCreate(
3131
endpoint,
3232
idempotencyKey);
3333

@@ -50,7 +50,7 @@ public async Task<OperationalWebhookEndpointOut> CreateAsync(
5050
{
5151
try
5252
{
53-
var lEndpoint = await _opWebhookEndpointApi.CreateOperationalWebhookEndpointAsync(
53+
var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointCreateAsync(
5454
endpoint,
5555
idempotencyKey,
5656
cancellationToken);
@@ -72,7 +72,7 @@ public bool Delete(string endpointId, string idempotencyKey = default)
7272
{
7373
try
7474
{
75-
var lResponse = _opWebhookEndpointApi.DeleteOperationalWebhookEndpointWithHttpInfo(
75+
var lResponse = _opWebhookEndpointApi.V1OperationalWebhookEndpointDeleteWithHttpInfo(
7676
endpointId);
7777

7878
return lResponse.StatusCode == HttpStatusCode.NoContent;
@@ -93,7 +93,7 @@ public async Task<bool> DeleteAsync(string endpointId, string idempotencyKey = d
9393
{
9494
try
9595
{
96-
var lResponse = await _opWebhookEndpointApi.DeleteOperationalWebhookEndpointWithHttpInfoAsync(
96+
var lResponse = await _opWebhookEndpointApi.V1OperationalWebhookEndpointDeleteWithHttpInfoAsync(
9797
endpointId,
9898
cancellationToken);
9999

@@ -114,7 +114,7 @@ public OperationalWebhookEndpointOut Get(string endpointId, string idempotencyKe
114114
{
115115
try
116116
{
117-
var lEndpoint = _opWebhookEndpointApi.GetOperationalWebhookEndpoint(endpointId);
117+
var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointGet(endpointId);
118118
return lEndpoint;
119119
}
120120
catch (ApiException e)
@@ -133,7 +133,7 @@ public async Task<OperationalWebhookEndpointOut> GetAsync(string endpointId, str
133133
{
134134
try
135135
{
136-
var lEndpoint = await _opWebhookEndpointApi.GetOperationalWebhookEndpointAsync(
136+
var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointGetAsync(
137137
endpointId,
138138
cancellationToken);
139139

@@ -154,7 +154,7 @@ public string GetSecret(string endpointId, string idempotencyKey = default)
154154
{
155155
try
156156
{
157-
var lSecret = _opWebhookEndpointApi.GetOperationalWebhookEndpointSecret(
157+
var lSecret = _opWebhookEndpointApi.V1OperationalWebhookEndpointGetSecret(
158158
endpointId);
159159

160160
return lSecret?.Key;
@@ -175,7 +175,7 @@ public async Task<string> GetSecretAsync(string endpointId, string idempotencyKe
175175
{
176176
try
177177
{
178-
var lSecret = await _opWebhookEndpointApi.GetOperationalWebhookEndpointSecretAsync(
178+
var lSecret = await _opWebhookEndpointApi.V1OperationalWebhookEndpointGetSecretAsync(
179179
endpointId,
180180
cancellationToken);
181181

@@ -197,7 +197,7 @@ public ListResponseOperationalWebhookEndpointOut List(ListOptions options = null
197197
{
198198
try
199199
{
200-
var lEndpoints = _opWebhookEndpointApi.ListOperationalWebhookEndpoints(
200+
var lEndpoints = _opWebhookEndpointApi.V1OperationalWebhookEndpointList(
201201
options?.Limit,
202202
options?.Iterator,
203203
options?.Order);
@@ -221,7 +221,7 @@ public async Task<ListResponseOperationalWebhookEndpointOut> ListAsync(
221221
{
222222
try
223223
{
224-
var lEndpoints = await _opWebhookEndpointApi.ListOperationalWebhookEndpointsAsync(
224+
var lEndpoints = await _opWebhookEndpointApi.V1OperationalWebhookEndpointListAsync(
225225
options?.Limit,
226226
options?.Iterator,
227227
options?.Order,
@@ -244,7 +244,7 @@ public bool RotateSecret(string endpointId, OperationalWebhookEndpointSecretIn s
244244
{
245245
try
246246
{
247-
var lResponse = _opWebhookEndpointApi.RotateOperationalWebhookEndpointSecretWithHttpInfo(
247+
var lResponse = _opWebhookEndpointApi.V1OperationalWebhookEndpointRotateSecret(
248248
endpointId,
249249
secret,
250250
idempotencyKey);
@@ -267,7 +267,7 @@ public async Task<bool> RotateSecretAsync(string endpointId, OperationalWebhookE
267267
{
268268
try
269269
{
270-
var lResponse = await _opWebhookEndpointApi.RotateOperationalWebhookEndpointSecretWithHttpInfoAsync(
270+
var lResponse = await _opWebhookEndpointApi.V1OperationalWebhookEndpointRotateSecretAsync(
271271
endpointId,
272272
secret,
273273
idempotencyKey);
@@ -290,7 +290,7 @@ public OperationalWebhookEndpointOut Update(string endpointId,
290290
{
291291
try
292292
{
293-
var lEndpoint = _opWebhookEndpointApi.UpdateOperationalWebhookEndpoint(
293+
var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointUpdate(
294294
endpointId,
295295
endpoint);
296296

@@ -313,7 +313,7 @@ public async Task<OperationalWebhookEndpointOut> UpdateAsync(string endpointId,
313313
{
314314
try
315315
{
316-
var lEndpoint = await _opWebhookEndpointApi.UpdateOperationalWebhookEndpointAsync(
316+
var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointUpdateAsync(
317317
endpointId,
318318
endpoint,
319319
cancellationToken);

0 commit comments

Comments
 (0)