-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat: webhook classes for messages #382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, just check "WhatsAppPreferredProduct" should probably be "WhatsAppReferredProduct"
/// <summary> | ||
/// The number of inbound SMS messages concatenated together to comprise this message. SMS messages are 160 characters, if an inbound message exceeds that size they are concatenated together to forma single message. This number indicates how many messages formed this webhook. | ||
/// </summary> | ||
[JsonPropertyName("total_count")] public string TotalCount { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to parse as int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same as below) The problem is that the value in the JSON file is a string. I could turn it around, but it would require a string->int customer converter that could fail. I don't think it's worth it, we could decide tol leave the possibility to parse the value to the caller.
/// <summary> | ||
/// The number of inbound SMS messages concatenated together to comprise this message. SMS messages are 160 characters, if an inbound message exceeds that size they are concatenated together to forma single message. This number indicates how many messages formed this webhook. | ||
/// </summary> | ||
[JsonPropertyName("num_messages")] public string MessagesCount { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be an int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the value in the JSON file is a string. I could turn it around, but it would require a string->int customer converter that could fail. I don't think it's worth it, we could decide tol leave the possibility to parse the value to the caller.
/// <summary> | ||
/// The channel the message came in on. | ||
/// </summary> | ||
public string Channel { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be. But if I set it up as an enum, I would have to change the SDK when they bring a new channel.
Leaving it as a string, we kind of cover every kind of value in it. I see that as a compromise, given it's just a webhook class.
Kudos, SonarCloud Quality Gate passed! |
No description provided.