Skip to content

Commit

Permalink
Update openapi spec and regenerate libs for 'tags'
Browse files Browse the repository at this point in the history
  • Loading branch information
svix-aaron1011 committed Dec 7, 2023
1 parent 22f5542 commit d9aa41f
Show file tree
Hide file tree
Showing 17 changed files with 281 additions and 54 deletions.
2 changes: 2 additions & 0 deletions csharp/Svix/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public List<MessageOut> List(string appId, MessageListOptions options = null, st
options?.Before,
options?.After,
options?.WithContent,
options?.Tag,
options?.EventTypes
);

Expand Down Expand Up @@ -156,6 +157,7 @@ public async Task<List<MessageOut>> ListAsync(string appId, MessageListOptions o
options?.Before,
options?.After,
options?.WithContent,
options?.Tag,
options?.EventTypes,
cancellationToken);

Expand Down
2 changes: 2 additions & 0 deletions csharp/Svix/Models/MessageListOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ public sealed class MessageListOptions : ListOptions
public DateTime? After { get; set; }

public bool? WithContent { get; set; }

public string? Tag { get; set; }

Check warning on line 18 in csharp/Svix/Models/MessageListOptions.cs

View workflow job for this annotation

GitHub Actions / C# Lint

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
}
}
8 changes: 4 additions & 4 deletions csharp/Svix/Statistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public AppUsageStatsOut AggregateAppStats(AppUsageStatsIn appUsageStatsIn, strin
{
try
{
var res = _statisticsApi.AggregateAppStats(
var res = _statisticsApi.V1StatisticsAggregateAppStats(
appUsageStatsIn,
idempotencyKey);

Expand All @@ -43,7 +43,7 @@ public async Task<AppUsageStatsOut> AggregateAppStatsAsync(AppUsageStatsIn appUs
{
try
{
var res = await _statisticsApi.AggregateAppStatsAsync(
var res = await _statisticsApi.V1StatisticsAggregateAppStatsAsync(
appUsageStatsIn,
idempotencyKey);

Expand All @@ -64,7 +64,7 @@ public AggregateEventTypesOut AggregateEventTypes()
{
try
{
var res = _statisticsApi.AggregateEventTypes();
var res = _statisticsApi.V1StatisticsAggregateEventTypes();

return res;
}
Expand All @@ -83,7 +83,7 @@ public async Task<AggregateEventTypesOut> AggregateEventTypesAsync()
{
try
{
var res = await _statisticsApi.AggregateEventTypesAsync();
var res = await _statisticsApi.V1StatisticsAggregateEventTypesAsync();

return res;
}
Expand Down
8 changes: 8 additions & 0 deletions go/internal/openapi/api_message.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions go/internal/openapi/api_statistics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions go/internal/openapi/model_message_in.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type (
)

func (s *Statistics) AggregateAppStats(ctx context.Context, appUsageStatsIn *AppUsageStatsIn, options *PostOptions) (*AppUsageStatsOut, error) {
req := s.api.StatisticsApi.AggregateAppStats(ctx)
req := s.api.StatisticsApi.V1StatisticsAggregateAppStats(ctx)
if appUsageStatsIn != nil {
req = req.AppUsageStatsIn(*appUsageStatsIn)
}
Expand All @@ -35,7 +35,7 @@ func (s *Statistics) AggregateAppStats(ctx context.Context, appUsageStatsIn *App
}

func (s *Statistics) AggregateEventTypes(ctx context.Context) (*AggregateEventTypesOut, error) {
req := s.api.StatisticsApi.AggregateEventTypes(ctx)
req := s.api.StatisticsApi.V1StatisticsAggregateEventTypes(ctx)

out, res, err := req.Execute()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions java/lib/src/main/java/com/svix/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public ListResponseMessageOut list(final String appId, final MessageListOptions
options.getBefore(),
options.getAfter(),
options.getWithContent(),
options.getTag(),
new HashSet<>(options.getEventTypes())
);
} catch (com.svix.internal.ApiException e) {
Expand Down
14 changes: 14 additions & 0 deletions java/lib/src/main/java/com/svix/MessageListOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class MessageListOptions extends ListOptions {
private OffsetDateTime after;
private String channel;
private Boolean withContent;
private String tag;

public MessageListOptions eventTypes(final List<String> eventTypes) {
this.eventTypes = eventTypes;
Expand Down Expand Up @@ -74,4 +75,17 @@ public MessageListOptions withContent(final Boolean withContent) {
this.withContent = withContent;
return this;
}

public String getTag() {
return tag;
}

public MessageListOptions tag(final String tag) {
this.tag = tag;
return this;
}

public void setTag(final String tag) {
this.tag = tag;
}
}
4 changes: 2 additions & 2 deletions java/lib/src/main/java/com/svix/Statistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public class Statistics {

public AppUsageStatsOut aggregateAppStats(final AppUsageStatsIn appUsageStatsIn, final PostOptions options) throws ApiException {
try {
return api.aggregateAppStats(appUsageStatsIn, options.getIdempotencyKey());
return api.v1StatisticsAggregateAppStats(appUsageStatsIn, options.getIdempotencyKey());
} catch (com.svix.internal.ApiException e) {
throw Utils.wrapInternalApiException(e);
}
}

public AggregateEventTypesOut aggregateEventTypes() throws com.svix.internal.ApiException {
try {
return api.aggregateEventTypes();
return api.v1StatisticsAggregateEventTypes();
} catch (com.svix.internal.ApiException e) {
throw Utils.wrapInternalApiException(e);
}
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,14 +890,14 @@ class Statistics {
}

public aggregateEventTypes(): Promise<AggregateEventTypesOut> {
return this.api.aggregateEventTypes({});
return this.api.v1StatisticsAggregateEventTypes({});
}

public aggregateAppStats(
appUsageStatsIn: AppUsageStatsIn,
options?: PostOptions
): Promise<AppUsageStatsOut> {
return this.api.aggregateAppStats({
return this.api.v1StatisticsAggregateAppStats({
appUsageStatsIn,
...options,
});
Expand Down
1 change: 1 addition & 0 deletions kotlin/lib/src/main/kotlin/Message.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Message internal constructor(token: String, options: SvixOptions) {
options.before,
options.after,
options.withContent,
options.tag,
HashSet(options.eventTypes)
)
} catch (e: Exception) {
Expand Down
2 changes: 2 additions & 0 deletions kotlin/lib/src/main/kotlin/MessageListOptions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class MessageListOptions : ListOptions() {
var after: OffsetDateTime? = null
var channel: String? = null
var withContent: Boolean? = null
var tag: String? = null

fun eventTypes(eventTypes: List<String>) = apply { this.eventTypes = eventTypes }

Expand All @@ -21,4 +22,5 @@ class MessageListOptions : ListOptions() {
override fun limit(limit: Int) = apply { super.limit(limit) }

fun withContent(withContent: Boolean) = apply { this.withContent = withContent }
fun tag(tag: String) = apply { this.tag = tag }
}
4 changes: 2 additions & 2 deletions kotlin/lib/src/main/kotlin/Statistics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class Statistics internal constructor(token: String, options: SvixOptions) {

suspend fun aggregateAppStats(appUsageStatsIn: AppUsageStatsIn, options: PostOptions = PostOptions()): AppUsageStatsOut {
try {
return api.aggregateAppStats(appUsageStatsIn, options.idempotencyKey)
return api.v1StatisticsAggregateAppStats(appUsageStatsIn, options.idempotencyKey)
} catch (e: Exception) {
throw ApiException.wrap(e)
}
}

suspend fun aggregateEventTypes(): AggregateEventTypesOut {
try {
return api.aggregateEventTypes()
return api.v1StatisticsAggregateEventTypes()
} catch (e: Exception) {
throw ApiException.wrap(e)
}
Expand Down
Loading

0 comments on commit d9aa41f

Please sign in to comment.