diff --git a/src/Clients/MessageClient.cs b/src/Clients/MessageClient.cs index 809a44a..f593c95 100644 --- a/src/Clients/MessageClient.cs +++ b/src/Clients/MessageClient.cs @@ -264,7 +264,7 @@ public async Task QueryRemindersAsync(string userId, Dic if (filterConditions != null) { - data["filter_conditions"] = filterConditions; + data["filter"] = filterConditions; } if (sort != null) diff --git a/src/Models/ChannelType.cs b/src/Models/ChannelType.cs index 47eada6..6cec5a5 100644 --- a/src/Models/ChannelType.cs +++ b/src/Models/ChannelType.cs @@ -45,6 +45,7 @@ public abstract class ChannelTypeRequestBase public bool? Reactions { get; set; } public bool? Replies { get; set; } public bool? Reminders { get; set; } + public bool? UserMessageReminders { get; set; } public bool? Uploads { get; set; } public bool? MarkMessagesPending { get; set; } public bool? Mutes { get; set; } @@ -92,6 +93,7 @@ public abstract class ChannelTypeResponseBase : ApiResponse public bool? Search { get; set; } public bool? Reactions { get; set; } public bool? Replies { get; set; } + public bool? UserMessageReminders { get; set; } public bool? Uploads { get; set; } public bool? Mutes { get; set; } public string MessageRetention { get; set; } diff --git a/tests/ChannelTypeClientTests.cs b/tests/ChannelTypeClientTests.cs index 5cd6960..600a5e2 100644 --- a/tests/ChannelTypeClientTests.cs +++ b/tests/ChannelTypeClientTests.cs @@ -89,5 +89,90 @@ await WaitForAsync(async () => } }); } + + [Test] + public async Task TestUserMessageRemindersFieldOnChannelTypeAsync() + { + var channelTypeName = Guid.NewGuid().ToString(); + ChannelTypeWithStringCommandsResponse createdChannelType = null; + + try + { + // Create a basic channel type (without user_message_reminders enabled) + // We're testing that the field exists in the model, not that it can be enabled + // (enabling requires Push V3 which may not be configured in test environment) + createdChannelType = await _channelTypeClient.CreateChannelTypeAsync( + new ChannelTypeWithStringCommandsRequest + { + Name = channelTypeName, + }); + + // Retrieve the channel type + await WaitForAsync(async () => + { + try + { + var retrieved = await _channelTypeClient.GetChannelTypeAsync(channelTypeName); + return retrieved.Name == channelTypeName; + } + catch + { + return false; + } + }); + + // Test that the field can be set to false (should work without Push V3) + var updated = await _channelTypeClient.UpdateChannelTypeAsync(channelTypeName, + new ChannelTypeWithStringCommandsRequest + { + UserMessageReminders = false, + }); + + // Verify the field is accessible in the response (even if false) + updated.UserMessageReminders.Should().NotBeNull(); + + // Verify the update persisted and field is accessible + await WaitForAsync(async () => + { + try + { + var retrieved = await _channelTypeClient.GetChannelTypeAsync(channelTypeName); + + // The field should be present in the response + return retrieved.UserMessageReminders != null; + } + catch + { + return false; + } + }); + } + finally + { + // Cleanup + if (createdChannelType != null) + { + try + { + await WaitForAsync(async () => + { + try + { + await _channelTypeClient.DeleteChannelTypeAsync(channelTypeName); + return true; + } + catch + { + return false; + } + }); + } + catch (TimeoutException) + { + // Ignore cleanup failures + } + } + } + } } } \ No newline at end of file