Skip to content

Commit a3014c1

Browse files
committed
Upgrade DTOs to the latest openAPI spec
1 parent 8be260a commit a3014c1

13 files changed

Lines changed: 100 additions & 39 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//----------------------
2+
// <auto-generated>
3+
// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
4+
// </auto-generated>
5+
//----------------------
6+
7+
8+
using StreamChat.Core.InternalDTO.Responses;
9+
using StreamChat.Core.InternalDTO.Requests;
10+
using StreamChat.Core.InternalDTO.Models;
11+
12+
namespace StreamChat.Core.InternalDTO.Events
13+
{
14+
using System = global::System;
15+
16+
/// <summary>
17+
/// The discriminator object for all websocket events, it maps events' payload to the final type
18+
/// </summary>
19+
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
20+
internal partial class WebhookEventInternalDTO
21+
{
22+
23+
private System.Collections.Generic.Dictionary<string, object> _additionalProperties;
24+
25+
[Newtonsoft.Json.JsonExtensionData]
26+
public System.Collections.Generic.Dictionary<string, object> AdditionalProperties
27+
{
28+
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
29+
set { _additionalProperties = value; }
30+
}
31+
32+
}
33+
34+
}
35+

Assets/Plugins/StreamChat/Core/InternalDTO/Events/WebhookEventInternalDTO.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/StreamChat/Core/InternalDTO/Models/APIErrorInternalDTO.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ internal partial class APIErrorInternalDTO
5858
[Newtonsoft.Json.JsonProperty("more_info", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
5959
public string MoreInfo { get; set; }
6060

61+
/// <summary>
62+
/// Flag that indicates if the error is unrecoverable, requests that return unrecoverable errors should not be retried, this error only applies to the request that caused it
63+
/// </summary>
64+
[Newtonsoft.Json.JsonProperty("unrecoverable", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
65+
public bool? Unrecoverable { get; set; }
66+
6167
private System.Collections.Generic.Dictionary<string, object> _additionalProperties;
6268

6369
[Newtonsoft.Json.JsonExtensionData]

Assets/Plugins/StreamChat/Core/InternalDTO/Models/LabelThresholdsInternalDTO.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@ namespace StreamChat.Core.InternalDTO.Models
1616
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
1717
internal partial class LabelThresholdsInternalDTO
1818
{
19-
/// <summary>
20-
/// Threshold for automatic message block
21-
/// </summary>
2219
[Newtonsoft.Json.JsonProperty("block", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2320
public float? Block { get; set; }
2421

25-
/// <summary>
26-
/// Threshold for automatic message flag
27-
/// </summary>
2822
[Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2923
public float? Flag { get; set; }
3024

Assets/Plugins/StreamChat/Core/InternalDTO/Models/ThresholdsInternalDTO.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,15 @@ namespace StreamChat.Core.InternalDTO.Models
1313
{
1414
using System = global::System;
1515

16-
/// <summary>
17-
/// Sets thresholds for AI moderation
18-
/// </summary>
1916
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
2017
internal partial class ThresholdsInternalDTO
2118
{
22-
/// <summary>
23-
/// Thresholds for explicit messages
24-
/// </summary>
2519
[Newtonsoft.Json.JsonProperty("explicit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2620
public LabelThresholdsInternalDTO Explicit { get; set; }
2721

28-
/// <summary>
29-
/// Thresholds for spam
30-
/// </summary>
3122
[Newtonsoft.Json.JsonProperty("spam", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3223
public LabelThresholdsInternalDTO Spam { get; set; }
3324

34-
/// <summary>
35-
/// Thresholds for toxic messages
36-
/// </summary>
3725
[Newtonsoft.Json.JsonProperty("toxic", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3826
public LabelThresholdsInternalDTO Toxic { get; set; }
3927

Assets/Plugins/StreamChat/Core/InternalDTO/Requests/MessageRequestInternalDTO.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ internal partial class MessageRequestInternalDTO
1818
{
1919
[Newtonsoft.Json.JsonProperty("attachments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2020
public System.Collections.Generic.List<AttachmentRequestInternalDTO> Attachments { get; set; }
21-
22-
/// <summary>
23-
/// Contains HTML markup of the message. Can only be set when using server-side API
24-
/// </summary>
25-
[Newtonsoft.Json.JsonProperty("html", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
26-
public string Html { get; set; }
2721

2822
[Newtonsoft.Json.JsonProperty("custom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2923
public System.Collections.Generic.Dictionary<string, object> Custom { get; set; }
@@ -49,11 +43,6 @@ internal partial class MessageRequestInternalDTO
4943
[Newtonsoft.Json.JsonProperty("pinned_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
5044
public System.DateTimeOffset? PinnedAt { get; set; }
5145

52-
/// <summary>
53-
/// Contains user who pinned the message
54-
/// </summary>
55-
[Newtonsoft.Json.JsonProperty("pinned_by", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
56-
public string PinnedBy { get; set; }
5746
[Newtonsoft.Json.JsonProperty("poll_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
5847
public string PollId { get; set; }
5948

Assets/Plugins/StreamChat/Core/InternalDTO/Responses/MessageModerationResultInternalDTO.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,75 @@ namespace StreamChat.Core.InternalDTO.Responses
1313
{
1414
using System = global::System;
1515

16+
/// <summary>
17+
/// Result of the message moderation
18+
/// </summary>
1619
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
1720
internal partial class MessageModerationResultInternalDTO
1821
{
22+
/// <summary>
23+
/// Action taken by automod
24+
/// </summary>
1925
[Newtonsoft.Json.JsonProperty("action", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2026
public string Action { get; set; }
2127

28+
/// <summary>
29+
/// Response from AI moderation
30+
/// </summary>
2231
[Newtonsoft.Json.JsonProperty("ai_moderation_response", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2332
public ModerationResponseInternalDTO AiModerationResponse { get; set; }
2433

34+
/// <summary>
35+
/// Word that was blocked
36+
/// </summary>
2537
[Newtonsoft.Json.JsonProperty("blocked_word", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2638
public string BlockedWord { get; set; }
2739

40+
/// <summary>
41+
/// Name of the blocklist
42+
/// </summary>
2843
[Newtonsoft.Json.JsonProperty("blocklist_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2944
public string BlocklistName { get; set; }
3045

46+
/// <summary>
47+
/// Date/time of creation
48+
/// </summary>
3149
[Newtonsoft.Json.JsonProperty("created_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3250
public System.DateTimeOffset CreatedAt { get; set; }
3351

52+
/// <summary>
53+
/// ID of the message
54+
/// </summary>
3455
[Newtonsoft.Json.JsonProperty("message_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3556
public string MessageId { get; set; }
3657

58+
/// <summary>
59+
/// User who moderated the message
60+
/// </summary>
3761
[Newtonsoft.Json.JsonProperty("moderated_by", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3862
public string ModeratedBy { get; set; }
3963

64+
/// <summary>
65+
/// Thresholds for AI moderation
66+
/// </summary>
4067
[Newtonsoft.Json.JsonProperty("moderation_thresholds", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
4168
public ThresholdsInternalDTO ModerationThresholds { get; set; }
4269

70+
/// <summary>
71+
/// Date/time of the last update
72+
/// </summary>
4373
[Newtonsoft.Json.JsonProperty("updated_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
4474
public System.DateTimeOffset UpdatedAt { get; set; }
4575

76+
/// <summary>
77+
/// Whether user has bad karma
78+
/// </summary>
4679
[Newtonsoft.Json.JsonProperty("user_bad_karma", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
4780
public bool UserBadKarma { get; set; }
4881

82+
/// <summary>
83+
/// Karma of the user
84+
/// </summary>
4985
[Newtonsoft.Json.JsonProperty("user_karma", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
5086
public float UserKarma { get; set; }
5187

Assets/Plugins/StreamChat/Core/InternalDTO/Responses/MessageResponseInternalDTO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal partial class MessageResponseInternalDTO
2020
public MessageInternalDTO Message { get; set; }
2121

2222
[Newtonsoft.Json.JsonProperty("attachments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
23-
public System.Collections.Generic.List<AttachmentInternalDTO> Attachments { get; set; } = new System.Collections.Generic.List<AttachmentInternalDTO>();
23+
public System.Collections.Generic.List<AttachmentInternalDTO> Attachments { get; set; }
2424

2525
[Newtonsoft.Json.JsonProperty("cid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2626
public string Cid { get; set; }

Assets/Plugins/StreamChat/Core/InternalDTO/Responses/UserResponseInternalDTO.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ internal partial class UserResponseInternalDTO
5757

5858
[Newtonsoft.Json.JsonProperty("invisible", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
5959
public bool? Invisible { get; set; }
60+
6061
[Newtonsoft.Json.JsonProperty("image", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
6162
public string Image { get; set; }
6263

@@ -83,10 +84,10 @@ internal partial class UserResponseInternalDTO
8384
/// </summary>
8485
[Newtonsoft.Json.JsonProperty("online", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
8586
public bool Online { get; set; }
86-
8787
[Newtonsoft.Json.JsonProperty("push_notifications", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
8888
public PushNotificationSettingsInternalDTO PushNotifications { get; set; }
8989

90+
9091
/// <summary>
9192
/// Revocation date for tokens
9293
/// </summary>

Assets/Plugins/StreamChat/Core/LowLevelClient/Requests/MessageRequest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public class MessageRequest : RequestObjectBase, ISavableTo<MessageRequestIntern
2424
/// <summary>
2525
/// Contains HTML markup of the message. Can only be set when using server-side API
2626
/// </summary>
27-
public string Html { get; set; }
27+
[Obsolete("Has no effect and will be removed in a future release")] //StreamTODO: remove this in a major release
28+
public string Html { get; set; } //StreamTodo: mark as obsolete, this is most probably server-side only
2829

2930
/// <summary>
3031
/// Message ID is unique string identifier of the message
@@ -97,7 +98,7 @@ MessageRequestInternalDTO ISavableTo<MessageRequestInternalDTO>.SaveToDto() =>
9798
new MessageRequestInternalDTO
9899
{
99100
Attachments = Attachments?.TrySaveToDtoCollection<AttachmentRequest, AttachmentRequestInternalDTO>(),
100-
Html = Html,
101+
//Html = Html,
101102
Id = Id,
102103
MentionedUsers = MentionedUsers,
103104
Mml = Mml,

0 commit comments

Comments
 (0)