Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump OpenAPI spec and regenerate libs #1673

Merged
merged 7 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions csharp/Svix/Abstractions/IMessageAttempt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Task<ListResponseEndpointMessageOut> ListAttemptedMessagesAsync(string appId, st

Task<ListResponseMessageAttemptOut> ListAttemptsByMessageAsync(string appId, string messageId, AttemptsByMessageListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);

ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId,
ListResponseMessageAttemptOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId,
AttemptsByEndpointListOptions options = null, string idempotencyKey = default);

Task<ListResponseMessageAttemptEndpointOut> ListAttemptsForEndpointAsync(string appId, string messageId, string endpointId,
Task<ListResponseMessageAttemptOut> ListAttemptsForEndpointAsync(string appId, string messageId, string endpointId,
AttemptsByEndpointListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);

Expand Down
8 changes: 4 additions & 4 deletions csharp/Svix/BackgroundTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public BackgroundTaskOut Get(string taskId, string idempotencyKey = default)
{
try
{
var lBackgroundTask = _backgroundTaskApi.GetBackgroundTask(taskId);
var lBackgroundTask = _backgroundTaskApi.V1BackgroundTaskGet(taskId);

return lBackgroundTask;
}
Expand All @@ -45,7 +45,7 @@ public async Task<BackgroundTaskOut> GetAsync(string taskId, string idempotencyK
{
try
{
var lBackgroundTask = await _backgroundTaskApi.GetBackgroundTaskAsync(taskId);
var lBackgroundTask = await _backgroundTaskApi.V1BackgroundTaskGetAsync(taskId);

return lBackgroundTask;
}
Expand All @@ -64,7 +64,7 @@ public ListResponseBackgroundTaskOut List(BackgroundTaskListOptions options = nu
{
try
{
var lResponse = _backgroundTaskApi.ListBackgroundTasks(
var lResponse = _backgroundTaskApi.V1BackgroundTaskList(
options?.Status,
options?.Task,
options?.Limit,
Expand All @@ -88,7 +88,7 @@ public async Task<ListResponseBackgroundTaskOut> ListAsync(BackgroundTaskListOpt
{
try
{
var lResponse = await _backgroundTaskApi.ListBackgroundTasksAsync(
var lResponse = await _backgroundTaskApi.V1BackgroundTaskListAsync(
options?.Status,
options?.Task,
options?.Limit,
Expand Down
164 changes: 52 additions & 112 deletions csharp/Svix/MessageAttempt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,139 +266,79 @@ public async Task<ListResponseMessageAttemptOut> ListAttemptsByMessageAsync(stri

// Deprecated
[Obsolete("Use ListAttemptsByMessage instead, passing the endpoint ID through options")]
public ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId,
public ListResponseMessageAttemptOut ListAttemptsForEndpoint(string appId, string messageId,
string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default)
{
try
{
var lResults = _messageAttemptApi.V1MessageAttemptListByEndpointDeprecated(
appId,
messageId,
endpointId,
options?.Limit,
options?.Iterator,
options?.Channel,
options?.Tag,
(Svix.Model.MessageStatus?)options?.Status,
options?.Before,
options?.After,
options?.EventTypes);

return lResults;
}
catch (ApiException e)
{
Logger?.LogError(e, $"{nameof(ListAttemptsForEndpoint)} failed");

if (Throw)
throw;

return new ListResponseMessageAttemptEndpointOut();
}
var listByMessageOptions = new AttemptsByMessageListOptions();
listByMessageOptions.Limit = options?.Limit;
listByMessageOptions.Iterator = options?.Iterator;
listByMessageOptions.Channel = options?.Channel;
listByMessageOptions.Tag = options?.Tag;
listByMessageOptions.Status = options?.Status;
listByMessageOptions.Before = options?.Before;
listByMessageOptions.After = options?.After;
listByMessageOptions.EventTypes = options?.EventTypes;
listByMessageOptions.EndpointId = endpointId;

return ListAttemptsByMessage(appId, messageId, listByMessageOptions, idempotencyKey);
}

// Deprecated
[Obsolete("Use ListAttemptsByMessageAsync instead, passing the endpoint ID through options")]
public async Task<ListResponseMessageAttemptEndpointOut> ListAttemptsForEndpointAsync(string appId,
public async Task<ListResponseMessageAttemptOut> ListAttemptsForEndpointAsync(string appId,
string messageId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default)
{
try
{
var lResults = await _messageAttemptApi.V1MessageAttemptListByEndpointDeprecatedAsync(
appId,
messageId,
endpointId,
options?.Limit,
options?.Iterator,
options?.Channel,
options?.Tag,
(Svix.Model.MessageStatus?)options?.Status,
options?.Before,
options?.After,
options?.EventTypes?.ToList(),
cancellationToken);

return lResults;
}
catch (ApiException e)
{
Logger?.LogError(e, $"{nameof(ListAttemptsForEndpointAsync)} failed");

if (Throw)
throw;

return new ListResponseMessageAttemptEndpointOut();
}
var listByMessageOptions = new AttemptsByMessageListOptions();
listByMessageOptions.Limit = options?.Limit;
listByMessageOptions.Iterator = options?.Iterator;
listByMessageOptions.Channel = options?.Channel;
listByMessageOptions.Tag = options?.Tag;
listByMessageOptions.Status = options?.Status;
listByMessageOptions.Before = options?.Before;
listByMessageOptions.After = options?.After;
listByMessageOptions.EventTypes = options?.EventTypes;
listByMessageOptions.EndpointId = endpointId;

return await ListAttemptsByMessageAsync(appId, messageId, listByMessageOptions, idempotencyKey);
}

// Deprecated
[Obsolete("Use ListAttemptsByEndpoint or ListAttemptsByMessage instead")]
[Obsolete("Use ListAttemptsByMessage instead")]
public ListResponseMessageAttemptOut ListAttempts(string appId, string messageId, MessageAttemptListOptions options = null,
string idempotencyKey = default)
{
try
{
var lResults = _messageAttemptApi.V1MessageAttemptListByMsgDeprecated(
appId,
messageId,
options?.Limit,
options?.Iterator,
options?.EndpointId,
options?.Channel,
options?.Tag,
(Svix.Model.MessageStatus?)options?.Status,
options?.Before,
options?.After,
null,
options?.EventTypes);

return lResults;
}
catch (ApiException e)
{
Logger?.LogError(e, $"{nameof(ListAttempts)} failed");

if (Throw)
throw;

return new ListResponseMessageAttemptOut();
}
var listByMessageOptions = new AttemptsByMessageListOptions();
listByMessageOptions.Limit = options?.Limit;
listByMessageOptions.Iterator = options?.Iterator;
listByMessageOptions.EndpointId = options?.EndpointId;
listByMessageOptions.Channel = options?.Channel;
listByMessageOptions.Tag = options?.Tag;
listByMessageOptions.Status = options?.Status;
listByMessageOptions.Before = options?.Before;
listByMessageOptions.After = options?.After;
listByMessageOptions.EventTypes = options?.EventTypes;

return ListAttemptsByMessage(appId, messageId, listByMessageOptions, idempotencyKey);
}

// Deprecated
[Obsolete("Use ListAttemptsByEndpointAsync or ListAttemptsByMessageAsync instead")]
[Obsolete("Use ListAttemptsByMessageAsync instead")]
public async Task<ListResponseMessageAttemptOut> ListAttemptsAsync(string appId, string messageId, MessageAttemptListOptions options = null,
string idempotencyKey = default, CancellationToken cancellationToken = default)
{
try
{
var lResults = await _messageAttemptApi.V1MessageAttemptListByMsgDeprecatedAsync(
appId,
messageId,
options?.Limit,
options?.Iterator,
options?.EndpointId,
options?.Channel,
options?.Tag,
(Svix.Model.MessageStatus?)options?.Status,
options?.Before,
options?.After,
null,
options?.EventTypes,
cancellationToken);

return lResults;
}
catch (ApiException e)
{
Logger?.LogError(e, $"{nameof(ListAttemptsAsync)} failed");

if (Throw)
throw;

return new ListResponseMessageAttemptOut();
}
var listByMessageOptions = new AttemptsByMessageListOptions();
listByMessageOptions.Limit = options?.Limit;
listByMessageOptions.Iterator = options?.Iterator;
listByMessageOptions.EndpointId = options?.EndpointId;
listByMessageOptions.Channel = options?.Channel;
listByMessageOptions.Tag = options?.Tag;
listByMessageOptions.Status = options?.Status;
listByMessageOptions.Before = options?.Before;
listByMessageOptions.After = options?.After;
listByMessageOptions.EventTypes = options?.EventTypes;

return await ListAttemptsByMessageAsync(appId, messageId, listByMessageOptions, idempotencyKey);
}

public ListResponseMessageEndpointOut ListAttemptedDestinations(string appId, string messageId, ListOptions options = null,
Expand Down
28 changes: 14 additions & 14 deletions csharp/Svix/OperationalWebhookEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public OperationalWebhookEndpointOut Create(
{
try
{
var lEndpoint = _opWebhookEndpointApi.CreateOperationalWebhookEndpoint(
var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointCreate(
endpoint,
idempotencyKey);

Expand All @@ -50,7 +50,7 @@ public async Task<OperationalWebhookEndpointOut> CreateAsync(
{
try
{
var lEndpoint = await _opWebhookEndpointApi.CreateOperationalWebhookEndpointAsync(
var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointCreateAsync(
endpoint,
idempotencyKey,
cancellationToken);
Expand All @@ -72,7 +72,7 @@ public bool Delete(string endpointId, string idempotencyKey = default)
{
try
{
var lResponse = _opWebhookEndpointApi.DeleteOperationalWebhookEndpointWithHttpInfo(
var lResponse = _opWebhookEndpointApi.V1OperationalWebhookEndpointDeleteWithHttpInfo(
endpointId);

return lResponse.StatusCode == HttpStatusCode.NoContent;
Expand All @@ -93,7 +93,7 @@ public async Task<bool> DeleteAsync(string endpointId, string idempotencyKey = d
{
try
{
var lResponse = await _opWebhookEndpointApi.DeleteOperationalWebhookEndpointWithHttpInfoAsync(
var lResponse = await _opWebhookEndpointApi.V1OperationalWebhookEndpointDeleteWithHttpInfoAsync(
endpointId,
cancellationToken);

Expand All @@ -114,7 +114,7 @@ public OperationalWebhookEndpointOut Get(string endpointId, string idempotencyKe
{
try
{
var lEndpoint = _opWebhookEndpointApi.GetOperationalWebhookEndpoint(endpointId);
var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointGet(endpointId);
return lEndpoint;
}
catch (ApiException e)
Expand All @@ -133,7 +133,7 @@ public async Task<OperationalWebhookEndpointOut> GetAsync(string endpointId, str
{
try
{
var lEndpoint = await _opWebhookEndpointApi.GetOperationalWebhookEndpointAsync(
var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointGetAsync(
endpointId,
cancellationToken);

Expand All @@ -154,7 +154,7 @@ public string GetSecret(string endpointId, string idempotencyKey = default)
{
try
{
var lSecret = _opWebhookEndpointApi.GetOperationalWebhookEndpointSecret(
var lSecret = _opWebhookEndpointApi.V1OperationalWebhookEndpointGetSecret(
endpointId);

return lSecret?.Key;
Expand All @@ -175,7 +175,7 @@ public async Task<string> GetSecretAsync(string endpointId, string idempotencyKe
{
try
{
var lSecret = await _opWebhookEndpointApi.GetOperationalWebhookEndpointSecretAsync(
var lSecret = await _opWebhookEndpointApi.V1OperationalWebhookEndpointGetSecretAsync(
endpointId,
cancellationToken);

Expand All @@ -197,7 +197,7 @@ public ListResponseOperationalWebhookEndpointOut List(ListOptions options = null
{
try
{
var lEndpoints = _opWebhookEndpointApi.ListOperationalWebhookEndpoints(
var lEndpoints = _opWebhookEndpointApi.V1OperationalWebhookEndpointList(
options?.Limit,
options?.Iterator,
options?.Order);
Expand All @@ -221,7 +221,7 @@ public async Task<ListResponseOperationalWebhookEndpointOut> ListAsync(
{
try
{
var lEndpoints = await _opWebhookEndpointApi.ListOperationalWebhookEndpointsAsync(
var lEndpoints = await _opWebhookEndpointApi.V1OperationalWebhookEndpointListAsync(
options?.Limit,
options?.Iterator,
options?.Order,
Expand All @@ -244,7 +244,7 @@ public bool RotateSecret(string endpointId, OperationalWebhookEndpointSecretIn s
{
try
{
var lResponse = _opWebhookEndpointApi.RotateOperationalWebhookEndpointSecretWithHttpInfo(
var lResponse = _opWebhookEndpointApi.V1OperationalWebhookEndpointRotateSecretWithHttpInfo(
endpointId,
secret,
idempotencyKey);
Expand All @@ -267,7 +267,7 @@ public async Task<bool> RotateSecretAsync(string endpointId, OperationalWebhookE
{
try
{
var lResponse = await _opWebhookEndpointApi.RotateOperationalWebhookEndpointSecretWithHttpInfoAsync(
var lResponse = await _opWebhookEndpointApi.V1OperationalWebhookEndpointRotateSecretWithHttpInfoAsync(
endpointId,
secret,
idempotencyKey);
Expand All @@ -290,7 +290,7 @@ public OperationalWebhookEndpointOut Update(string endpointId,
{
try
{
var lEndpoint = _opWebhookEndpointApi.UpdateOperationalWebhookEndpoint(
var lEndpoint = _opWebhookEndpointApi.V1OperationalWebhookEndpointUpdate(
endpointId,
endpoint);

Expand All @@ -313,7 +313,7 @@ public async Task<OperationalWebhookEndpointOut> UpdateAsync(string endpointId,
{
try
{
var lEndpoint = await _opWebhookEndpointApi.UpdateOperationalWebhookEndpointAsync(
var lEndpoint = await _opWebhookEndpointApi.V1OperationalWebhookEndpointUpdateAsync(
endpointId,
endpoint,
cancellationToken);
Expand Down
4 changes: 2 additions & 2 deletions go/background_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (backgroundTask *BackgroundTask) List(
ctx context.Context,
options *BackgroundTaskListOptions,
) (*ListResponseBackgroundTaskOut, error) {
req := backgroundTask.api.BackgroundTasksAPI.ListBackgroundTasks(
req := backgroundTask.api.BackgroundTasksAPI.V1BackgroundTaskList(
ctx,
)

Expand Down Expand Up @@ -64,7 +64,7 @@ func (backgroundTask *BackgroundTask) Get(
ctx context.Context,
taskId string,
) (*BackgroundTaskOut, error) {
req := backgroundTask.api.BackgroundTasksAPI.GetBackgroundTask(
req := backgroundTask.api.BackgroundTasksAPI.V1BackgroundTaskGet(
ctx,
taskId,
)
Expand Down
Loading
Loading