Skip to content

Commit

Permalink
update libs
Browse files Browse the repository at this point in the history
  • Loading branch information
svix-lucho committed Nov 29, 2023
1 parent 3d4e622 commit e1f1c27
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 3 deletions.
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 @@ -18,5 +18,7 @@ public sealed class AttemptsByEndpointListOptions : ListOptions
public DateTime? After { get; set; }

public bool? WithContent { get; set; }

public bool? WithMsg { get; set; }
}
}
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 }
}
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

0 comments on commit e1f1c27

Please sign in to comment.