kenakamu / UCWA2.0-CS

C# library for UCWA 2.0
MIT License
24 stars 13 forks source link

Add Reason to UcwaEvents #36

Open elav000 opened 7 years ago

elav000 commented 7 years ago

For ParticipantInvitation events, if the state is 'Failure' the 'Reason' object from the response is not passed down, so the client does not get any detailed information regarding the failure.

If Reason is added to the Event object, it can also be passed to the event delegates. I have made this change locally and added another delegate to pass along the reason information. I'm not sure how best to solve for all cases?

Example below:

"events" : [{ "link" : { "rel" : "participantInvitation", "href" : "/ucwa/oauth/v1/applications/asdf/communication/participantInvitations/..." }, "status" : "Failure", "_embedded" : { "participantInvitation" : { "direction" : "Outgoing", "importance" : "Normal", "state" : "Failed", ... }, "rel" : "participantInvitation" } }, "reason" : { "code" : "RemoteFailure", "subcode" : "Declined", "message" : "Your invitation was declined." }, "type" : "completed" } ]

baywet commented 6 years ago

Hi @elav000 sorry for the late reply. Do you think you could author a PR for that?

kenakamu commented 6 years ago

didn't we already done this?

baywet commented 6 years ago

I think we did it for errors but not for events so far.