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

Update OpenAPI spec and regenerate libs #1134

Merged
merged 2 commits into from
Nov 29, 2023
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
2 changes: 2 additions & 0 deletions csharp/Svix/MessageAttempt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public List<MessageAttemptOut> ListAttemptsByEndpoint(string appId, string endpo
options?.Before,
options?.After,
options?.WithContent,
options?.WithMsg,
options?.EventTypes);

return lResults?.Data;
Expand Down Expand Up @@ -175,6 +176,7 @@ public async Task<List<MessageAttemptOut>> ListAttemptsByEndpointAsync(string ap
options?.Before,
options?.After,
options?.WithContent,
options?.WithMsg,
options?.EventTypes,
cancellationToken);

Expand Down
2 changes: 2 additions & 0 deletions csharp/Svix/Models/AttemptsByEndpointListOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

public List<string> EventTypes { get; set; }

public string? Channel { get; set; }

Check warning on line 14 in csharp/Svix/Models/AttemptsByEndpointListOptions.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.

Check warning on line 14 in csharp/Svix/Models/AttemptsByEndpointListOptions.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.

public DateTime? Before { get; set; }

public DateTime? After { get; set; }

public bool? WithContent { get; set; }

public bool? WithMsg { get; set; }
}
}
8 changes: 8 additions & 0 deletions go/internal/openapi/api_message_attempt.go

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

1 change: 1 addition & 0 deletions java/lib/src/main/java/com/svix/MessageAttempt.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public ListResponseMessageAttemptOut listByEndpoint(final String appId, final St
options.getBefore(),
options.getAfter(),
options.getWithContent(),
options.getWithMsg(),
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/MessageAttemptListOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class MessageAttemptListOptions extends ListOptions {
private String channel;
private Boolean withContent;
private String endpointId;
private Boolean withMsg;

public MessageAttemptListOptions() {
super();
Expand Down Expand Up @@ -124,4 +125,17 @@ public MessageAttemptListOptions endpointId(final String endpointId) {
this.endpointId = endpointId;
return this;
}

public Boolean getWithMsg() {
return withMsg;
}

public void setWithMsg(final Boolean withMsg) {
this.withMsg = withMsg;
}

public MessageAttemptListOptions withMsg(final Boolean withMsg) {
this.withMsg = withMsg;
return this;
}
}
1 change: 1 addition & 0 deletions kotlin/lib/src/main/kotlin/MessageAttempt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class MessageAttempt internal constructor(token: String, options: SvixOptions) {
options.before,
options.after,
options.withContent,
options.withMsg,
HashSet(options.eventTypes)
)
} catch (e: Exception) {
Expand Down
6 changes: 5 additions & 1 deletion kotlin/lib/src/main/kotlin/MessageAttemptListOptions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.svix.kotlin.models.MessageStatus
import com.svix.kotlin.models.StatusCodeClass
import java.time.OffsetDateTime

class MessageAttemptListOptions(var messageStatus: MessageStatus? = null, var before: OffsetDateTime? = null, var after: OffsetDateTime? = null, var eventTypes: List<String>? = null, var statusCodeClass: StatusCodeClass? = null, var channel: String? = null, var endpointId: String? = null, var withContent: Boolean? = null) : ListOptions() {
class MessageAttemptListOptions(var messageStatus: MessageStatus? = null, var before: OffsetDateTime? = null, var after: OffsetDateTime? = null, var eventTypes: List<String>? = null, var statusCodeClass: StatusCodeClass? = null, var channel: String? = null, var endpointId: String? = null, var withContent: Boolean? = null, var withMsg: Boolean? = null) : ListOptions() {
fun messageStatus(messageStatus: MessageStatus) = apply { this.messageStatus = messageStatus }

fun before(before: OffsetDateTime) = apply { this.before = before }
Expand All @@ -20,4 +20,8 @@ class MessageAttemptListOptions(var messageStatus: MessageStatus? = null, var be
override fun limit(limit: Int) = apply { super.limit(limit) }

fun endpointId(endpointId: String) = apply { this.endpointId = endpointId }

fun withContent(withContent: Boolean) = apply { this.withContent = withContent }

fun withMsg(withMsg: Boolean) = apply { this.withMsg = withMsg }
}
9 changes: 9 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5172,6 +5172,15 @@
},
"style": "form"
},
{
"in": "query",
"name": "with_msg",
"schema": {
"default": false,
"type": "boolean"
},
"style": "form"
},
{
"description": "Filter response based on the event type",
"in": "query",
Expand Down
24 changes: 22 additions & 2 deletions rust/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,24 @@ pub struct MessageAttemptListOptions {
pub endpoint_id: Option<String>,
}

#[derive(Default)]
pub struct MessageAttemptListByEndpointOptions {
pub iterator: Option<String>,
pub limit: Option<i32>,
pub event_types: Option<Vec<String>>,
// FIXME: make before and after actual dates
/// RFC3339 date string
pub before: Option<String>,
/// RFC3339 date string
pub after: Option<String>,
pub channel: Option<String>,
pub status: Option<MessageStatus>,
pub status_code_class: Option<StatusCodeClass>,
pub with_content: Option<bool>,
pub with_msg: Option<bool>,
pub endpoint_id: Option<String>,
}

pub struct MessageAttempt<'a> {
cfg: &'a Configuration,
}
Expand Down Expand Up @@ -952,9 +970,9 @@ impl<'a> MessageAttempt<'a> {
&self,
app_id: String,
endpoint_id: String,
options: Option<MessageAttemptListOptions>,
options: Option<MessageAttemptListByEndpointOptions>,
) -> Result<ListResponseMessageAttemptOut> {
let MessageAttemptListOptions {
let MessageAttemptListByEndpointOptions {
iterator,
limit,
event_types,
Expand All @@ -965,6 +983,7 @@ impl<'a> MessageAttempt<'a> {
status_code_class,
endpoint_id: _,
with_content,
with_msg,
} = options.unwrap_or_default();
Ok(message_attempt_api::v1_message_attempt_list_by_endpoint(
self.cfg,
Expand All @@ -980,6 +999,7 @@ impl<'a> MessageAttempt<'a> {
status,
status_code_class,
with_content,
with_msg,
},
)
.await?)
Expand Down
Loading