Skip to content

Commit

Permalink
feat: add constructor with Obsolete attr to avoid breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
Dovchik committed Feb 7, 2025
1 parent d2fab3e commit 046fb1d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/Sinch/Conversation/Messages/Message/ChoiceMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ public class UrlMessage
/// </summary>
public sealed class CallMessage
{
[JsonConstructor]
public CallMessage()
{
}

/// <summary>
/// Create an instance of CallMessage
/// </summary>
/// <param name="phoneNumber">Phone number in E.164 with leading +.</param>
/// <param name="title">Title shown close to the phone number. The title is clickable in some cases.</param>
[Obsolete(
message:
"This method is obsolete and will be removed in a future version. Consider initializing properties directly",
error: false)]
public CallMessage(string phoneNumber, string title)
{
PhoneNumber = phoneNumber;
Title = title;
}

/// <summary>
/// Phone number in E.164 with leading +.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion tests/Sinch.Tests/Conversation/Messages/AppMessageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ public void DeserializeAppMessageTextMessage()
}
});
}

[Fact]
public void DeserializeAppMessageListMessageProduct()
{
Expand Down

0 comments on commit 046fb1d

Please sign in to comment.