ringcentral / RingCentral.Net

RingCentral SDK for .NET
MIT License
19 stars 26 forks source link

[Feature Request] better way to handle notification payloads #50

Closed tylerlong closed 6 months ago

tylerlong commented 1 year ago

For now, developer received notification payload string. and they need to manually convert those string to C# objects: https://github.com/ringcentral/RingCentral.Net/blob/master/RingCentral.Tests/SubscriptionTest.cs#L66

In the future, could we give users C# objects directly? But since user could specify multiple event filters in a single subscription, there is no way to determine the exact type of a notification payload in compile time (unless user only subscribes to one and only one event filter). However, in run time, we could check the payload and determine the payload type. And possibly convert the payload to corresponding C# objects. As the end user, he would get a stream of "Events", he he could check the type of the events to determine their specific types.

Discussion with the team is required before implementation.