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

[lib/c#] Return iterator information in list endpoints #1203

Merged
merged 1 commit into from
Feb 13, 2024
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/IApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Task<bool> DeleteAsync(string appId, string idempotencyKey = default,
Task<ApplicationOut> GetAsync(string appId, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<ApplicationOut> List(ListOptions options = null, string idempotencyKey = default);
ListResponseApplicationOut List(ListOptions options = null, string idempotencyKey = default);

Task<List<ApplicationOut>> ListAsync(ListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);
Task<ListResponseApplicationOut> ListAsync(ListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);

ApplicationOut Update(string appId, ApplicationIn application, string idempotencyKey = default);

Expand Down
4 changes: 2 additions & 2 deletions csharp/Svix/Abstractions/IBackgroundTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public interface IBackgroundTask
Task<BackgroundTaskOut> GetAsync(string taskId, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<BackgroundTaskOut> List(BackgroundTaskListOptions options = null, string idempotencyKey = default);
ListResponseBackgroundTaskOut List(BackgroundTaskListOptions options = null, string idempotencyKey = default);

Task<List<BackgroundTaskOut>> ListAsync(BackgroundTaskListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);
Task<ListResponseBackgroundTaskOut> ListAsync(BackgroundTaskListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);
}
}
4 changes: 2 additions & 2 deletions csharp/Svix/Abstractions/IEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Task<EndpointHeadersOut> GetHeadersAsync(string appId, string endpointId, string
Task<string> GetSecretAsync(string appId, string endpointId, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<EndpointOut> List(string appId, ListOptions options = null, string idempotencyKey = default);
ListResponseEndpointOut List(string appId, ListOptions options = null, string idempotencyKey = default);

Task<List<EndpointOut>> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
Task<ListResponseEndpointOut> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);

bool PatchHeaders(string appId, string endpointId, EndpointHeadersPatchIn headers, string idempotencyKey = default);
Expand Down
4 changes: 2 additions & 2 deletions csharp/Svix/Abstractions/IEventType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Task<EventTypeOut> CreateAsync(EventTypeIn eventType, string idempotencyKey = de
Task<EventTypeOut> GetAsync(string eventType, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<EventTypeOut> List(EventTypeListOptions options = null, string idempotencyKey = default);
ListResponseEventTypeOut List(EventTypeListOptions options = null, string idempotencyKey = default);

Task<List<EventTypeOut>> ListAsync(EventTypeListOptions options = null, string idempotencyKey = default,
Task<ListResponseEventTypeOut> ListAsync(EventTypeListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);

EventTypeOut Update(string eventType, EventTypeUpdate update, string idempotencyKey = default);
Expand Down
4 changes: 2 additions & 2 deletions csharp/Svix/Abstractions/IIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Task<bool> DeleteAsync(string appId, string integrationId, string idempotencyKey
Task<string> GetKeyAsync(string appId, string integrationId, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<IntegrationOut> List(string appId, ListOptions options = null, string idempotencyKey = default);
ListResponseIntegrationOut List(string appId, ListOptions options = null, string idempotencyKey = default);

Task<List<IntegrationOut>> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
Task<ListResponseIntegrationOut> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);

string RotateKey(string appId, string integrationId, string idempotencyKey = default);
Expand Down
4 changes: 2 additions & 2 deletions csharp/Svix/Abstractions/IMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Task<MessageOut> CreateAsync(string appId, MessageIn message, MessageCreateOptio
Task<MessageOut> GetAsync(string appId, string messageId, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<MessageOut> List(string appId, MessageListOptions options = null, string idempotencyKey = default);
ListResponseMessageOut List(string appId, MessageListOptions options = null, string idempotencyKey = default);

Task<List<MessageOut>> ListAsync(string appId, MessageListOptions options = null, string idempotencyKey = default,
Task<ListResponseMessageOut> ListAsync(string appId, MessageListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);
}
}
24 changes: 12 additions & 12 deletions csharp/Svix/Abstractions/IMessageAttempt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ public interface IMessageAttempt

Task<MessageAttemptOut> GetAttemptAsync(string appId, string attemptId, string messageId, string idempotencyKey = default, CancellationToken cancellationToken = default);

List<EndpointMessageOut> ListAttemptedMessages(string appId, string endpointId, MessageAttemptListOptions options = null,
ListResponseEndpointMessageOut ListAttemptedMessages(string appId, string endpointId, MessageAttemptListOptions options = null,
string idempotencyKey = default);

Task<List<EndpointMessageOut>> ListAttemptedMessagesAsync(string appId, string endpointId, MessageAttemptListOptions options = null,
Task<ListResponseEndpointMessageOut> ListAttemptedMessagesAsync(string appId, string endpointId, MessageAttemptListOptions options = null,
string idempotencyKey = default, CancellationToken cancellationToken = default);

List<MessageAttemptOut> ListAttemptsByEndpoint(string appId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default);
ListResponseMessageAttemptOut ListAttemptsByEndpoint(string appId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default);

Task<List<MessageAttemptOut>> ListAttemptsByEndpointAsync(string appId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);
Task<ListResponseMessageAttemptOut> ListAttemptsByEndpointAsync(string appId, string endpointId, AttemptsByEndpointListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default);

List<MessageAttemptOut> ListAttemptsByMessage(string appId, string messageId, AttemptsByMessageListOptions options = null, string idempotencyKey = default);
ListResponseMessageAttemptOut ListAttemptsByMessage(string appId, string messageId, AttemptsByMessageListOptions options = null, string idempotencyKey = default);

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

List<MessageAttemptEndpointOut> ListAttemptsForEndpoint(string appId, string messageId, string endpointId,
ListResponseMessageAttemptEndpointOut ListAttemptsForEndpoint(string appId, string messageId, string endpointId,
AttemptsByEndpointListOptions options = null, string idempotencyKey = default);

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

List<MessageAttemptOut> ListAttempts(string appId, string messageId,
ListResponseMessageAttemptOut ListAttempts(string appId, string messageId,
MessageAttemptListOptions options = null, string idempotencyKey = default);

Task<List<MessageAttemptOut>> ListAttemptsAsync(string appId, string messageId,
Task<ListResponseMessageAttemptOut> ListAttemptsAsync(string appId, string messageId,
MessageAttemptListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);

List<MessageEndpointOut> ListAttemptedDestinations(string appId, string messageId,
ListResponseMessageEndpointOut ListAttemptedDestinations(string appId, string messageId,
ListOptions options = null, string idempotencyKey = default);

Task<List<MessageEndpointOut>> ListAttemptedDestinationsAsync(string appId, string messageId,
Task<ListResponseMessageEndpointOut> ListAttemptedDestinationsAsync(string appId, string messageId,
ListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default);

Expand Down
12 changes: 6 additions & 6 deletions csharp/Svix/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public async Task<ApplicationOut> GetAsync(string appId, string idempotencyKey =
}
}

public List<ApplicationOut> List(ListOptions options = null, string idempotencyKey = default)
public ListResponseApplicationOut List(ListOptions options = null, string idempotencyKey = default)
{
try
{
Expand All @@ -158,7 +158,7 @@ public List<ApplicationOut> List(ListOptions options = null, string idempotencyK
options?.Iterator,
options?.Order);

return lResponse?.Data;
return lResponse;
}
catch (ApiException e)
{
Expand All @@ -167,11 +167,11 @@ public List<ApplicationOut> List(ListOptions options = null, string idempotencyK
if (Throw)
throw;

return new List<ApplicationOut>();
return new ListResponseApplicationOut();
}
}

public async Task<List<ApplicationOut>> ListAsync(ListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default)
public async Task<ListResponseApplicationOut> ListAsync(ListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default)
{
try
{
Expand All @@ -181,7 +181,7 @@ public async Task<List<ApplicationOut>> ListAsync(ListOptions options = null, st
options?.Order,
cancellationToken);

return lResponse?.Data;
return lResponse;
}
catch (ApiException e)
{
Expand All @@ -190,7 +190,7 @@ public async Task<List<ApplicationOut>> ListAsync(ListOptions options = null, st
if (Throw)
throw;

return new List<ApplicationOut>();
return new ListResponseApplicationOut();
}
}

Expand Down
12 changes: 6 additions & 6 deletions csharp/Svix/BackgroundTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public async Task<BackgroundTaskOut> GetAsync(string taskId, string idempotencyK
}
}

public List<BackgroundTaskOut> List(BackgroundTaskListOptions options = null, string idempotencyKey = default)
public ListResponseBackgroundTaskOut List(BackgroundTaskListOptions options = null, string idempotencyKey = default)
{
try
{
Expand All @@ -71,7 +71,7 @@ public List<BackgroundTaskOut> List(BackgroundTaskListOptions options = null, st
options?.Iterator,
options?.Order);

return lResponse?.Data;
return lResponse;
}
catch (ApiException e)
{
Expand All @@ -80,11 +80,11 @@ public List<BackgroundTaskOut> List(BackgroundTaskListOptions options = null, st
if (Throw)
throw;

return new List<BackgroundTaskOut>();
return new ListResponseBackgroundTaskOut();
}
}

public async Task<List<BackgroundTaskOut>> ListAsync(BackgroundTaskListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default)
public async Task<ListResponseBackgroundTaskOut> ListAsync(BackgroundTaskListOptions options = null, string idempotencyKey = default, CancellationToken cancellationToken = default)
{
try
{
Expand All @@ -96,7 +96,7 @@ public async Task<List<BackgroundTaskOut>> ListAsync(BackgroundTaskListOptions o
options?.Order,
cancellationToken);

return lResponse?.Data;
return lResponse;
}
catch (ApiException e)
{
Expand All @@ -105,7 +105,7 @@ public async Task<List<BackgroundTaskOut>> ListAsync(BackgroundTaskListOptions o
if (Throw)
throw;

return new List<BackgroundTaskOut>();
return new ListResponseBackgroundTaskOut();
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions csharp/Svix/Endpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public async Task<string> GetSecretAsync(string appId, string endpointId, string
}
}

public List<EndpointOut> List(string appId, ListOptions options = null, string idempotencyKey = default)
public ListResponseEndpointOut List(string appId, ListOptions options = null, string idempotencyKey = default)
{
try
{
Expand All @@ -254,7 +254,7 @@ public List<EndpointOut> List(string appId, ListOptions options = null, string i
options?.Iterator,
options?.Order);

return lEndpoints?.Data;
return lEndpoints;
}
catch (ApiException e)
{
Expand All @@ -263,11 +263,11 @@ public List<EndpointOut> List(string appId, ListOptions options = null, string i
if (Throw)
throw;

return new List<EndpointOut>();
return new ListResponseEndpointOut();
}
}

public async Task<List<EndpointOut>> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
public async Task<ListResponseEndpointOut> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default)
{
try
Expand All @@ -279,7 +279,7 @@ public async Task<List<EndpointOut>> ListAsync(string appId, ListOptions options
options?.Order,
cancellationToken);

return lEndpoints?.Data;
return lEndpoints;
}
catch (ApiException e)
{
Expand All @@ -288,7 +288,7 @@ public async Task<List<EndpointOut>> ListAsync(string appId, ListOptions options
if (Throw)
throw;

return new List<EndpointOut>();
return new ListResponseEndpointOut();
}
}

Expand Down
12 changes: 6 additions & 6 deletions csharp/Svix/EventType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public async Task<EventTypeOut> GetAsync(string eventType, string idempotencyKey
}
}

public List<EventTypeOut> List(EventTypeListOptions options = null, string idempotencyKey = default)
public ListResponseEventTypeOut List(EventTypeListOptions options = null, string idempotencyKey = default)
{
try
{
Expand All @@ -159,7 +159,7 @@ public List<EventTypeOut> List(EventTypeListOptions options = null, string idemp
options?.IncludeArchived,
options?.WithContent);

return lResults?.Data;
return lResults;
}
catch (ApiException e)
{
Expand All @@ -168,11 +168,11 @@ public List<EventTypeOut> List(EventTypeListOptions options = null, string idemp
if (Throw)
throw;

return new List<EventTypeOut>();
return new ListResponseEventTypeOut();
}
}

public async Task<List<EventTypeOut>> ListAsync(EventTypeListOptions options = null, string idempotencyKey = default,
public async Task<ListResponseEventTypeOut> ListAsync(EventTypeListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default)
{
try
Expand All @@ -185,7 +185,7 @@ public async Task<List<EventTypeOut>> ListAsync(EventTypeListOptions options = n
options?.WithContent,
cancellationToken);

return lResults?.Data;
return lResults;
}
catch (ApiException e)
{
Expand All @@ -194,7 +194,7 @@ public async Task<List<EventTypeOut>> ListAsync(EventTypeListOptions options = n
if (Throw)
throw;

return new List<EventTypeOut>();
return new ListResponseEventTypeOut();
}
}

Expand Down
12 changes: 6 additions & 6 deletions csharp/Svix/Integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public async Task<string> GetKeyAsync(string appId, string integrationId, string
}
}

public List<IntegrationOut> List(string appId, ListOptions options = null, string idempotencyKey = default)
public ListResponseIntegrationOut List(string appId, ListOptions options = null, string idempotencyKey = default)
{
try
{
Expand All @@ -207,7 +207,7 @@ public List<IntegrationOut> List(string appId, ListOptions options = null, strin
options?.Limit,
options?.Iterator);

return lResult?.Data;
return lResult;
}
catch (ApiException e)
{
Expand All @@ -216,11 +216,11 @@ public List<IntegrationOut> List(string appId, ListOptions options = null, strin
if (Throw)
throw;

return new List<IntegrationOut>();
return new ListResponseIntegrationOut();
}
}

public async Task<List<IntegrationOut>> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
public async Task<ListResponseIntegrationOut> ListAsync(string appId, ListOptions options = null, string idempotencyKey = default,
CancellationToken cancellationToken = default)
{
try
Expand All @@ -231,7 +231,7 @@ public async Task<List<IntegrationOut>> ListAsync(string appId, ListOptions opti
options?.Iterator,
cancellationToken);

return lResult?.Data;
return lResult;
}
catch (ApiException e)
{
Expand All @@ -240,7 +240,7 @@ public async Task<List<IntegrationOut>> ListAsync(string appId, ListOptions opti
if (Throw)
throw;

return new List<IntegrationOut>();
return new ListResponseIntegrationOut();
}
}

Expand Down
Loading
Loading